Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 4 additions & 25 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,6 @@ def configureMtagsScalaVersionDynamically(
)
}

def crossTestDyn(state: State, scalaV: String): State = {
val configured = configureMtagsScalaVersionDynamically(state, scalaV)
val (out, _) =
Project
.extract(configured)
.runTask(cross / Test / test, configured)
out
}

def crossTestDynOnly(state: State, scalaV: String, testName: String): State = {
val configured = configureMtagsScalaVersionDynamically(state, scalaV)
val (out, _) =
Project
.extract(configured)
.runInputTask(cross / Test / testOnly, testName, configured)
out
}

commands ++= Seq(
Command.command("save-expect") { s =>
"unit/test:runMain tests.SaveExpect" :: "quick-publish-local" :: "slow/test:runMain tests.feature.SlowSaveExpect" :: s
Expand All @@ -141,9 +123,6 @@ commands ++= Seq(
"mtags-java/publishLocal" ::
publishMtags
},
Command.single("test-mtags-dyn") { (s, scalaV) =>
crossTestDyn(s, scalaV)
},
)

// -Xlint is unusable because of
Expand Down Expand Up @@ -588,7 +567,6 @@ lazy val input3 = project
.settings(
sharedSettings,
scalaVersion := V.scala3,
target := (ThisBuild / baseDirectory).value / "tests" / "input" / "target" / "target3",
Compile / unmanagedSourceDirectories := Seq(
(input / baseDirectory).value / "src" / "main" / "scala",
(input / baseDirectory).value / "src" / "main" / "scala-3",
Expand Down Expand Up @@ -794,13 +772,14 @@ lazy val unit = project
buildInfoPackage := "tests",
Compile / resourceGenerators += InputProperties
.resourceGenerator(input, input3),
Compile / compile :=
Compile / compile := Def.uncached(
(Compile / compile)
.dependsOn(
input / Test / compile,
input3 / Test / compile,
)
.value,
.value
),
buildInfoKeys := Seq[BuildInfoKey](
"sourceroot" -> (ThisBuild / baseDirectory).value,
"targetDirectory" -> (Test / target).value,
Expand Down Expand Up @@ -833,7 +812,7 @@ lazy val slow = project
.evaluated,
Test / test := (Test / test)
.dependsOn(`sbt-metals` / publishLocal, publishBinaryMtags)
.value,
.evaluated,
)
.dependsOn(unit, `metals-mcp`)

Expand Down
22 changes: 11 additions & 11 deletions project/Developers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,67 @@ object Developers {
"arthurm1",
"arthur McGibbon",
"",
url("https://github.com/Arthurm1"),
uri("https://github.com/Arthurm1"),
),
Developer(
"adpi2",
"Adrien Piquerez",
"adrien.piquerez@epfl.ch",
url("https://github.com/adpi2"),
uri("https://github.com/adpi2"),
),
Developer(
"ckipp01",
"Chris Kipp",
"ckipp@pm.me",
url("https://chris-kipp.io"),
uri("https://chris-kipp.io"),
),
Developer(
"gabro",
"Gabriele Petronella",
"gabriele@buildo.io",
url("https://github.com/gabro"),
uri("https://github.com/gabro"),
),
Developer(
"jkciesluk",
"Jakub Cie艣luk",
"jciesluk@virtuslab.com",
url("https://github.com/jkciesluk"),
uri("https://github.com/jkciesluk"),
),
Developer(
"kpodsiad",
"Kamil Podsiad艂o",
"kpodsiadlo@virtuslab.com ",
url("https://github.com/kpodsiad)"),
uri("https://github.com/kpodsiad)"),
),
Developer(
"kasiaMarek",
"Katarzyna Marek",
"kmarek@virtuslab.com ",
url("https://github.com/kasiaMarek)"),
uri("https://github.com/kasiaMarek)"),
),
Developer(
"majk-p",
"Micha艂 Pawlik",
"admin@michalp.net",
url("https://github.com/majk-p"),
uri("https://github.com/majk-p"),
),
Developer(
"olafurpg",
"脫lafur P谩ll Geirsson",
"olafurpg@gmail.com",
url("https://geirsson.com"),
uri("https://geirsson.com"),
),
Developer(
"tgodzik",
"Tomasz Godzik",
"tgodzik@virtuslab.com",
url("https://github.com/tgodzik"),
uri("https://github.com/tgodzik"),
),
Developer(
"dos65",
"Vadim Chelyshov",
"vchelyshov@virtuslab.com",
url("https://github.com/dos65"),
uri("https://github.com/dos65"),
),
)
}
21 changes: 3 additions & 18 deletions project/InputProperties.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,14 @@ import sbt.Keys._
import sbt._

object InputProperties extends AutoPlugin {
var files: Option[Seq[File]] = None
def resourceGenerator(
input: Reference,
input3: Reference,
): Def.Initialize[Task[Seq[File]]] =
Def.taskDyn {
files.synchronized {
files match {
case Some(value) if value.forall(_.isFile) =>
Def.task(value)
case _ =>
val baseInput = resourceGeneratorImpl(input, "metals-input")
val scala3Input = resourceGeneratorImpl(input3, "metals-input3")
baseInput.zipWith(scala3Input)((a, b) =>
Seq(a, b).join
.map { generated =>
val out = generated.flatten
files = Some(out)
out
}
)
}
}
val baseInput = resourceGeneratorImpl(input, "metals-input")
val scala3Input = resourceGeneratorImpl(input3, "metals-input3")
baseInput.zipWith(scala3Input)((a, b) => Seq(a, b).join.map(_.flatten))
}
def resourceGeneratorImpl(
input: Reference,
Expand Down
12 changes: 1 addition & 11 deletions project/JavaPcSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ object JavaPcSettings {
lazy val currentJavaVersion = settingKey[String]("current java version")

def settings(sharedSettings: Def.SettingsDefinition): Project => Project = {
prj: Project =>
(prj: Project) =>
prj.settings(
sharedSettings,
moduleName := "mtags-java",
Expand All @@ -20,16 +20,6 @@ object JavaPcSettings {
if (version.startsWith("1.")) version.substring(2, 3)
else version.takeWhile(_ != '.')
},
Compile / unmanagedJars ++= {
if (currentJavaVersion.value == "8")
Seq(
file(
currentJavaHome.value.getPath
.stripSuffix("jre") + "lib/tools.jar"
)
)
else Nil
},
)
}
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.12.13
sbt.version=2.0.4
2 changes: 0 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ addSbtPlugin("com.github.reibitto" % "sbt-welcome" % "0.6.0")

// Mima used for mtags-interfaces
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.6")

libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
Loading