mirror of https://github.com/sbt/sbt.git
Merge c81cc2d3cc into b3b1a3477e
This commit is contained in:
commit
f7981c9a89
|
|
@ -54,11 +54,11 @@ jobs:
|
||||||
# test building sbtn on Linux (sbtw native-image dropped: scopt lazy vals break under Graal)
|
# test building sbtn on Linux (sbtw native-image dropped: scopt lazy vals break under Graal)
|
||||||
sbt "-Dsbt.io.virtual=false" nativeImage
|
sbt "-Dsbt.io.virtual=false" nativeImage
|
||||||
# smoke test native Image
|
# smoke test native Image
|
||||||
./client/target/bin/sbtn --sbt-script=$(pwd)/sbt about
|
./target/out/jvm/u/sbt-client/bin/sbtn --sbt-script=$(pwd)/sbt about
|
||||||
./client/target/bin/sbtn --sbt-script=$(pwd)/sbt shutdown
|
./target/out/jvm/u/sbt-client/bin/sbtn --sbt-script=$(pwd)/sbt shutdown
|
||||||
# test launcher script
|
# test launcher script
|
||||||
echo build using JDK 17 test using JDK 17 and JDK 25
|
echo build using JDK 17 test using JDK 17 and JDK 25
|
||||||
sbt -Dsbt.build.version=$TEST_SBT_VER launcherPackage/Rpm/packageBin launcherPackage/Debian/packageBin
|
sbt --server -Dsbt.build.version=$TEST_SBT_VER launcherPackage/Rpm/packageBin launcherPackage/Debian/packageBin
|
||||||
sbt -Dsbt.build.version=$TEST_SBT_VER launcherPackageIntegrationTest/test
|
sbt -Dsbt.build.version=$TEST_SBT_VER launcherPackageIntegrationTest/test
|
||||||
cd launcher-package/citest && ./test.sh
|
cd launcher-package/citest && ./test.sh
|
||||||
JAVA_HOME="$JAVA_HOME_25_X64"
|
JAVA_HOME="$JAVA_HOME_25_X64"
|
||||||
|
|
@ -91,8 +91,8 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# smoke test native Image (sbtn)
|
# smoke test native Image (sbtn)
|
||||||
./client/target/bin/sbtn --sbt-script=$(pwd)/launcher-package/src/universal/bin/sbt.bat about
|
./target/out/jvm/u/sbt-client/bin/sbtn --sbt-script=$(pwd)/launcher-package/src/universal/bin/sbt.bat about
|
||||||
./client/target/bin/sbtn --sbt-script=$(pwd)/launcher-package/src/universal/bin/sbt.bat shutdown
|
./target/out/jvm/u/sbt-client/bin/sbtn --sbt-script=$(pwd)/launcher-package/src/universal/bin/sbt.bat shutdown
|
||||||
# test launcher script
|
# test launcher script
|
||||||
echo build using JDK 17 test using JDK 17 and JDK 25
|
echo build using JDK 17 test using JDK 17 and JDK 25
|
||||||
launcher-package/bin/coursier.bat resolve
|
launcher-package/bin/coursier.bat resolve
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,11 @@ rewrite.scala3.newSyntax.control = false
|
||||||
|
|
||||||
fileOverride {
|
fileOverride {
|
||||||
"glob:**/project/**" {
|
"glob:**/project/**" {
|
||||||
runner.dialect = scala212source3
|
runner.dialect = scala3
|
||||||
runner.dialectOverride.allowAsForImportRename = false
|
runner.dialectOverride.allowAsForImportRename = false
|
||||||
}
|
}
|
||||||
"glob:**/*.sbt" {
|
"glob:**/*.sbt" {
|
||||||
runner.dialect = scala212source3
|
runner.dialect = scala3
|
||||||
runner.dialectOverride.allowAsForImportRename = false
|
runner.dialectOverride.allowAsForImportRename = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
35
build.sbt
35
build.sbt
|
|
@ -91,7 +91,7 @@ def commonSettings: Seq[Setting[?]] = Def.settings(
|
||||||
import scala.sys.process.*
|
import scala.sys.process.*
|
||||||
val devnull = ProcessLogger(_ => ())
|
val devnull = ProcessLogger(_ => ())
|
||||||
val tagOrSha =
|
val tagOrSha =
|
||||||
("git describe --exact-match" #|| "git rev-parse HEAD").lineStream(devnull).head
|
("git describe --exact-match" #|| "git rev-parse HEAD").lazyLines(devnull).head
|
||||||
Seq(
|
Seq(
|
||||||
"-source-links:github://sbt/sbt",
|
"-source-links:github://sbt/sbt",
|
||||||
"-revision",
|
"-revision",
|
||||||
|
|
@ -214,7 +214,7 @@ lazy val sbtRoot: Project = (project in file("."))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val base = baseDirectory.value.toPath
|
val base = baseDirectory.value.toPath
|
||||||
val exec = (sbtClientProj / nativeImage).value.toPath
|
val exec = fileConverter.value.toPath((sbtClientProj / nativeImage).value)
|
||||||
streams.value.log.info(s"installing thin client ${base.relativize(exec)} to ${target}")
|
streams.value.log.info(s"installing thin client ${base.relativize(exec)} to ${target}")
|
||||||
Files.copy(exec, target, java.nio.file.StandardCopyOption.REPLACE_EXISTING)
|
Files.copy(exec, target, java.nio.file.StandardCopyOption.REPLACE_EXISTING)
|
||||||
}
|
}
|
||||||
|
|
@ -467,6 +467,7 @@ lazy val workerProj = (project in file("worker"))
|
||||||
.dependsOn(exampleWorkProj % Test)
|
.dependsOn(exampleWorkProj % Test)
|
||||||
.settings(
|
.settings(
|
||||||
name := "worker",
|
name := "worker",
|
||||||
|
Test / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Raw,
|
||||||
testedBaseSettings,
|
testedBaseSettings,
|
||||||
Compile / doc / javacOptions := Nil,
|
Compile / doc / javacOptions := Nil,
|
||||||
crossPaths := false,
|
crossPaths := false,
|
||||||
|
|
@ -715,6 +716,7 @@ lazy val buildFileProj = (project in file("buildfile"))
|
||||||
mainSettingsProj,
|
mainSettingsProj,
|
||||||
)
|
)
|
||||||
.settings(
|
.settings(
|
||||||
|
exportJars := false,
|
||||||
testedBaseSettings,
|
testedBaseSettings,
|
||||||
name := "build file",
|
name := "build file",
|
||||||
libraryDependencies ++= Seq(scalaCompiler),
|
libraryDependencies ++= Seq(scalaCompiler),
|
||||||
|
|
@ -871,7 +873,11 @@ lazy val serverTestProj = (project in file("server-test"))
|
||||||
Test / run / fork := true,
|
Test / run / fork := true,
|
||||||
Test / sourceGenerators += Def.task {
|
Test / sourceGenerators += Def.task {
|
||||||
val rawClasspath =
|
val rawClasspath =
|
||||||
(Compile / fullClasspathAsJars).value.map(_.data).mkString(java.io.File.pathSeparator)
|
(Compile / fullClasspathAsJars).value
|
||||||
|
.map(_.data)
|
||||||
|
.map(fileConverter.value.toPath)
|
||||||
|
.map(_.toFile.getAbsolutePath)
|
||||||
|
.mkString(java.io.File.pathSeparator)
|
||||||
val cp =
|
val cp =
|
||||||
if (scala.util.Properties.isWin) rawClasspath.replace("\\", "\\\\")
|
if (scala.util.Properties.isWin) rawClasspath.replace("\\", "\\\\")
|
||||||
else rawClasspath
|
else rawClasspath
|
||||||
|
|
@ -889,7 +895,7 @@ lazy val serverTestProj = (project in file("server-test"))
|
||||||
val file =
|
val file =
|
||||||
(Test / target).value / "generated" / "src" / "test" / "scala" / "testpkg" / "TestProperties.scala"
|
(Test / target).value / "generated" / "src" / "test" / "scala" / "testpkg" / "TestProperties.scala"
|
||||||
IO.write(file, content)
|
IO.write(file, content)
|
||||||
file :: Nil
|
Seq(file)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -925,7 +931,7 @@ lazy val sbtClientProj = (project in file("client"))
|
||||||
if (!Files.exists(outputDir)) {
|
if (!Files.exists(outputDir)) {
|
||||||
Files.createDirectories(outputDir)
|
Files.createDirectories(outputDir)
|
||||||
}
|
}
|
||||||
outputDir.resolve("sbtn").toFile
|
fileConverter.value.toVirtualFile(outputDir.resolve("sbtn"))
|
||||||
},
|
},
|
||||||
nativeImageCommand := {
|
nativeImageCommand := {
|
||||||
val orig = nativeImageCommand.value
|
val orig = nativeImageCommand.value
|
||||||
|
|
@ -1031,6 +1037,7 @@ lazy val sbtIgnoredProblems = {
|
||||||
def scriptedTask(launch: Boolean): Def.Initialize[InputTask[Unit]] = Def.inputTask {
|
def scriptedTask(launch: Boolean): Def.Initialize[InputTask[Unit]] = Def.inputTask {
|
||||||
val _ = publishLocalBinAll.value
|
val _ = publishLocalBinAll.value
|
||||||
val launchJar = s"-Dsbt.launch.jar=${(bundledLauncherProj / Compile / packageBin).value}"
|
val launchJar = s"-Dsbt.launch.jar=${(bundledLauncherProj / Compile / packageBin).value}"
|
||||||
|
val converter = fileConverter.value
|
||||||
Scripted.doScripted(
|
Scripted.doScripted(
|
||||||
(scriptedSbtProj / scalaInstance).value,
|
(scriptedSbtProj / scalaInstance).value,
|
||||||
scriptedSource.value,
|
scriptedSource.value,
|
||||||
|
|
@ -1042,10 +1049,12 @@ def scriptedTask(launch: Boolean): Def.Initialize[InputTask[Unit]] = Def.inputTa
|
||||||
version.value,
|
version.value,
|
||||||
(scriptedSbtProj / Test / fullClasspathAsJars).value
|
(scriptedSbtProj / Test / fullClasspathAsJars).value
|
||||||
.map(_.data)
|
.map(_.data)
|
||||||
|
.map(converter.toPath)
|
||||||
|
.map(_.toFile)
|
||||||
.filterNot(_.getName.contains("scala-compiler")),
|
.filterNot(_.getName.contains("scala-compiler")),
|
||||||
(bundledLauncherProj / Compile / packageBin).value,
|
converter.toPath((bundledLauncherProj / Compile / packageBin).value).toFile,
|
||||||
streams.value.log,
|
streams.value.log,
|
||||||
scriptedKeepTempDirectory.value,
|
local.LocalScriptedPlugin.autoImport.scriptedKeepTempDirectory.value,
|
||||||
(scripted / includeFilter).value,
|
(scripted / includeFilter).value,
|
||||||
(scripted / excludeFilter).value,
|
(scripted / excludeFilter).value,
|
||||||
)
|
)
|
||||||
|
|
@ -1116,7 +1125,7 @@ lazy val nonRoots = allProjects.map(p => LocalProject(p.id))
|
||||||
|
|
||||||
ThisBuild / scriptedBufferLog := true
|
ThisBuild / scriptedBufferLog := true
|
||||||
ThisBuild / scriptedPrescripted := { _ => }
|
ThisBuild / scriptedPrescripted := { _ => }
|
||||||
ThisBuild / scriptedKeepTempDirectory := false
|
ThisBuild / local.LocalScriptedPlugin.autoImport.scriptedKeepTempDirectory := false
|
||||||
|
|
||||||
def otherRootSettings =
|
def otherRootSettings =
|
||||||
Seq(
|
Seq(
|
||||||
|
|
@ -1258,6 +1267,7 @@ lazy val lmIvy = (project in file("lm-ivy"))
|
||||||
.enablePlugins(ContrabandPlugin, JsonCodecPlugin)
|
.enablePlugins(ContrabandPlugin, JsonCodecPlugin)
|
||||||
.dependsOn(lmCore)
|
.dependsOn(lmCore)
|
||||||
.settings(
|
.settings(
|
||||||
|
exportJars := false,
|
||||||
commonSettings,
|
commonSettings,
|
||||||
lmTestSettings,
|
lmTestSettings,
|
||||||
name := "librarymanagement-ivy",
|
name := "librarymanagement-ivy",
|
||||||
|
|
@ -1341,6 +1351,7 @@ lazy val lmCoursier = project
|
||||||
lazy val lmCoursierShaded = project
|
lazy val lmCoursierShaded = project
|
||||||
.in(file("lm-coursier/target/shaded-module"))
|
.in(file("lm-coursier/target/shaded-module"))
|
||||||
.settings(
|
.settings(
|
||||||
|
exportJars := false,
|
||||||
lmCoursierSettings,
|
lmCoursierSettings,
|
||||||
Mima.settings,
|
Mima.settings,
|
||||||
Mima.lmCoursierFilters,
|
Mima.lmCoursierFilters,
|
||||||
|
|
@ -1437,13 +1448,15 @@ lazy val launcherPackageIntegrationTest =
|
||||||
Test / fork := true,
|
Test / fork := true,
|
||||||
Test / javaOptions += {
|
Test / javaOptions += {
|
||||||
val cp = (Test / fullClasspath).value
|
val cp = (Test / fullClasspath).value
|
||||||
.map(_.data.getAbsolutePath)
|
.map(_.data)
|
||||||
|
.map(fileConverter.value.toPath)
|
||||||
|
.map(_.toFile.getAbsolutePath)
|
||||||
.mkString(java.io.File.pathSeparator)
|
.mkString(java.io.File.pathSeparator)
|
||||||
s"-Dsbt.test.classpath=$cp"
|
s"-Dsbt.test.classpath=$cp"
|
||||||
},
|
},
|
||||||
Test / javaOptions += s"-Dsbt.test.integrationtest.basedir=${(baseDirectory).value.getAbsolutePath}",
|
Test / javaOptions += s"-Dsbt.test.integrationtest.basedir=${(baseDirectory).value.getAbsolutePath}",
|
||||||
Test / test := {
|
Test / testFull := Def.uncached {
|
||||||
(Test / test)
|
(Test / testFull)
|
||||||
.dependsOn(launcherPackage / Universal / packageBin)
|
.dependsOn(launcherPackage / Universal / packageBin)
|
||||||
.dependsOn(launcherPackage / Universal / stage)
|
.dependsOn(launcherPackage / Universal / stage)
|
||||||
.value
|
.value
|
||||||
|
|
|
||||||
|
|
@ -54,9 +54,10 @@ lazy val isWindows: Boolean =
|
||||||
lazy val isExperimental = sbtVersionToRelease.contains("RC") || sbtVersionToRelease.contains("M")
|
lazy val isExperimental = sbtVersionToRelease.contains("RC") || sbtVersionToRelease.contains("M")
|
||||||
val sbtLaunchJarUrl = SettingKey[String]("sbt-launch-jar-url")
|
val sbtLaunchJarUrl = SettingKey[String]("sbt-launch-jar-url")
|
||||||
val sbtLaunchJarLocation = SettingKey[File]("sbt-launch-jar-location")
|
val sbtLaunchJarLocation = SettingKey[File]("sbt-launch-jar-location")
|
||||||
val sbtLaunchJar = TaskKey[File]("sbt-launch-jar", "Resolves SBT launch jar")
|
val sbtLaunchJar = TaskKey[HashedVirtualFileRef]("sbt-launch-jar", "Resolves SBT launch jar")
|
||||||
val moduleID = (organization) apply { (o) => ModuleID(o, "sbt", sbtVersionToRelease) }
|
val moduleID = (organization) apply { (o) => ModuleID(o, "sbt", sbtVersionToRelease) }
|
||||||
val sbtnJarsMappings = TaskKey[Seq[(File, String)]]("sbtn-jars-mappings", "Resolves sbtn JARs")
|
val sbtnJarsMappings =
|
||||||
|
TaskKey[Seq[(HashedVirtualFileRef, String)]]("sbtn-jars-mappings", "Resolves sbtn JARs")
|
||||||
val sbtnJarsBaseUrl = SettingKey[String]("sbtn-jars-base-url")
|
val sbtnJarsBaseUrl = SettingKey[String]("sbtn-jars-base-url")
|
||||||
|
|
||||||
lazy val bintrayDebianUrl = settingKey[String]("API point for Debian packages")
|
lazy val bintrayDebianUrl = settingKey[String]("API point for Debian packages")
|
||||||
|
|
@ -76,8 +77,10 @@ val bintrayReleaseAllStaged =
|
||||||
val windowsBuildId = settingKey[Int]("build id for Windows installer")
|
val windowsBuildId = settingKey[Int]("build id for Windows installer")
|
||||||
val debianBuildId = settingKey[Int]("build id for Debian")
|
val debianBuildId = settingKey[Int]("build id for Debian")
|
||||||
|
|
||||||
|
@transient
|
||||||
val exportRepoUsingCoursier = taskKey[File]("export Maven style repository")
|
val exportRepoUsingCoursier = taskKey[File]("export Maven style repository")
|
||||||
val exportRepoCsrDirectory = settingKey[File]("")
|
val exportRepoCsrDirectory = settingKey[File]("")
|
||||||
|
@transient
|
||||||
val exportRepo = taskKey[File]("export Ivy style repository")
|
val exportRepo = taskKey[File]("export Ivy style repository")
|
||||||
val exportRepoDirectory = settingKey[File]("directory for exported repository")
|
val exportRepoDirectory = settingKey[File]("directory for exported repository")
|
||||||
|
|
||||||
|
|
@ -107,7 +110,7 @@ val launcherPackage = (project in file("."))
|
||||||
.settings(
|
.settings(
|
||||||
name := "sbt-launcher-packaging",
|
name := "sbt-launcher-packaging",
|
||||||
packageName := "sbt",
|
packageName := "sbt",
|
||||||
crossTarget := target.value,
|
crossPaths := false,
|
||||||
autoScalaLibrary := false,
|
autoScalaLibrary := false,
|
||||||
clean := {
|
clean := {
|
||||||
val _ = (dist / clean).value
|
val _ = (dist / clean).value
|
||||||
|
|
@ -142,7 +145,7 @@ val launcherPackage = (project in file("."))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO - GPG Trust validation.
|
// TODO - GPG Trust validation.
|
||||||
file
|
fileConverter.value.toVirtualFile(file.toPath)
|
||||||
},
|
},
|
||||||
sbtnJarsBaseUrl := "https://github.com/sbt/sbtn-dist/releases/download",
|
sbtnJarsBaseUrl := "https://github.com/sbt/sbtn-dist/releases/download",
|
||||||
sbtnJarsMappings := {
|
sbtnJarsMappings := {
|
||||||
|
|
@ -226,14 +229,20 @@ val launcherPackage = (project in file("."))
|
||||||
IO.move(platformDir / "sbtn.exe", t / x86WindowsImageName)
|
IO.move(platformDir / "sbtn.exe", t / x86WindowsImageName)
|
||||||
}
|
}
|
||||||
if (!sbtIncludeSbtn) Seq()
|
if (!sbtIncludeSbtn) Seq()
|
||||||
else if (isWindows) Seq(t / x86WindowsImageName -> s"bin/$x86WindowsImageName")
|
else if (isWindows)
|
||||||
|
Seq(
|
||||||
|
fileConverter.value
|
||||||
|
.toVirtualFile((t / x86WindowsImageName).toPath) -> s"bin/$x86WindowsImageName"
|
||||||
|
)
|
||||||
else
|
else
|
||||||
Seq(
|
Seq(
|
||||||
t / universalMacImageName -> s"bin/$universalMacImageName",
|
t / universalMacImageName -> s"bin/$universalMacImageName",
|
||||||
t / x86LinuxImageName -> s"bin/$x86LinuxImageName",
|
t / x86LinuxImageName -> s"bin/$x86LinuxImageName",
|
||||||
t / aarch64LinuxImageName -> s"bin/$aarch64LinuxImageName",
|
t / aarch64LinuxImageName -> s"bin/$aarch64LinuxImageName",
|
||||||
t / x86WindowsImageName -> s"bin/$x86WindowsImageName"
|
t / x86WindowsImageName -> s"bin/$x86WindowsImageName"
|
||||||
)
|
).map { (k, v) =>
|
||||||
|
fileConverter.value.toVirtualFile(k.toPath) -> v
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// GENERAL LINUX PACKAGING STUFFS
|
// GENERAL LINUX PACKAGING STUFFS
|
||||||
|
|
@ -332,7 +341,9 @@ val launcherPackage = (project in file("."))
|
||||||
Windows / packageName := packageName.value,
|
Windows / packageName := packageName.value,
|
||||||
Universal / version := sbtVersionToRelease,
|
Universal / version := sbtVersionToRelease,
|
||||||
Universal / mappings += {
|
Universal / mappings += {
|
||||||
(baseDirectory.value.getParentFile / "sbt") -> ("bin" + java.io.File.separator + "sbt")
|
fileConverter.value.toVirtualFile(
|
||||||
|
(baseDirectory.value.getParentFile / "sbt").toPath
|
||||||
|
) -> ("bin" + java.io.File.separator + "sbt")
|
||||||
},
|
},
|
||||||
Universal / mappings := {
|
Universal / mappings := {
|
||||||
val t = (Universal / target).value
|
val t = (Universal / target).value
|
||||||
|
|
@ -342,7 +353,7 @@ val launcherPackage = (project in file("."))
|
||||||
prev.toList map {
|
prev.toList map {
|
||||||
case (k, BinSbt) =>
|
case (k, BinSbt) =>
|
||||||
import java.nio.file.{ Files, FileSystems }
|
import java.nio.file.{ Files, FileSystems }
|
||||||
val x = IO.read(k)
|
val x = IO.read(fileConverter.value.toPath(k).toFile)
|
||||||
IO.write(
|
IO.write(
|
||||||
t / "sbt",
|
t / "sbt",
|
||||||
x.replace(
|
x.replace(
|
||||||
|
|
@ -352,13 +363,13 @@ val launcherPackage = (project in file("."))
|
||||||
)
|
)
|
||||||
|
|
||||||
if (FileSystems.getDefault.supportedFileAttributeViews.contains("posix")) {
|
if (FileSystems.getDefault.supportedFileAttributeViews.contains("posix")) {
|
||||||
val perms = Files.getPosixFilePermissions(k.toPath)
|
val perms = Files.getPosixFilePermissions(fileConverter.value.toPath(k))
|
||||||
Files.setPosixFilePermissions((t / "sbt").toPath, perms)
|
Files.setPosixFilePermissions((t / "sbt").toPath, perms)
|
||||||
}
|
}
|
||||||
|
|
||||||
(t / "sbt", BinSbt)
|
(fileConverter.value.toVirtualFile((t / "sbt").toPath), BinSbt)
|
||||||
case (k, BinBat) =>
|
case (k, BinBat) =>
|
||||||
val x = IO.read(k)
|
val x = IO.read(fileConverter.value.toPath(k).toFile)
|
||||||
IO.write(
|
IO.write(
|
||||||
t / "sbt.bat",
|
t / "sbt.bat",
|
||||||
x.replace(
|
x.replace(
|
||||||
|
|
@ -366,7 +377,7 @@ val launcherPackage = (project in file("."))
|
||||||
s"set init_sbt_version=$sbtVersionToRelease"
|
s"set init_sbt_version=$sbtVersionToRelease"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
(t / "sbt.bat", BinBat)
|
(fileConverter.value.toVirtualFile((t / "sbt.bat").toPath), BinBat)
|
||||||
case (k, v) => (k, v)
|
case (k, v) => (k, v)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -377,29 +388,34 @@ val launcherPackage = (project in file("."))
|
||||||
sbtLaunchJar.value -> "bin/sbt-launch.jar"
|
sbtLaunchJar.value -> "bin/sbt-launch.jar"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
else Def.task { Seq[(File, String)]() }
|
else Def.task { Seq[(HashedVirtualFileRef, String)]() }
|
||||||
}).value,
|
}).value,
|
||||||
Universal / mappings ++= sbtnJarsMappings.value,
|
Universal / mappings ++= sbtnJarsMappings.value,
|
||||||
Universal / mappings ++= (Def.taskDyn {
|
Universal / mappings ++= (Def.taskDyn {
|
||||||
if (sbtOfflineInstall && sbtVersionToRelease.startsWith("1."))
|
if (sbtOfflineInstall && sbtVersionToRelease.startsWith("1."))
|
||||||
Def.task {
|
Def.task {
|
||||||
val _ = ((dist / exportRepoUsingCoursier)).value
|
val _ = ((dist / exportRepoUsingCoursier)).value
|
||||||
directory(((dist / target)).value / "lib")
|
directory(((dist / target)).value / "lib").map { (k, v) =>
|
||||||
|
fileConverter.value.toVirtualFile(k.toPath) -> v
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (sbtOfflineInstall)
|
else if (sbtOfflineInstall)
|
||||||
Def.task {
|
Def.task {
|
||||||
val _ = ((dist / exportRepo)).value
|
val _ = ((dist / exportRepo)).value
|
||||||
directory(((dist / target)).value / "lib")
|
directory(((dist / target)).value / "lib").map { (k, v) =>
|
||||||
|
fileConverter.value.toVirtualFile(k.toPath) -> v
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else Def.task { Seq[(File, String)]() }
|
else Def.task { Seq[(HashedVirtualFileRef, String)]() }
|
||||||
}).value,
|
}).value,
|
||||||
Universal / mappings ++= {
|
Universal / mappings ++= {
|
||||||
val base = baseDirectory.value
|
val base = baseDirectory.value
|
||||||
|
val converter = fileConverter.value
|
||||||
if (sbtVersionToRelease.startsWith("0.13.")) Nil
|
if (sbtVersionToRelease.startsWith("0.13.")) Nil
|
||||||
else
|
else
|
||||||
Seq[(File, String)](
|
Seq[(HashedVirtualFileRef, String)](
|
||||||
base.getParentFile / "LICENSE" -> "LICENSE",
|
converter.toVirtualFile((base.getParentFile / "LICENSE").toPath) -> "LICENSE",
|
||||||
base / "NOTICE" -> "NOTICE"
|
converter.toVirtualFile((base / "NOTICE").toPath) -> "NOTICE"
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -458,7 +474,7 @@ def makePublishToForConfig(config: Configuration) = {
|
||||||
},
|
},
|
||||||
publishTo := {
|
publishTo := {
|
||||||
val (id, url, pattern) = bintrayTripple.value
|
val (id, url, pattern) = bintrayTripple.value
|
||||||
val resolver = Resolver.url(id, new URI(url).toURL)(Patterns(pattern))
|
val resolver = Resolver.url(id, new URI(url).toURL)(using Patterns(pattern))
|
||||||
Some(resolver)
|
Some(resolver)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -92,11 +92,11 @@ object ExtendedRunnerTest extends BasicTestSuite:
|
||||||
"compile",
|
"compile",
|
||||||
"-v",
|
"-v",
|
||||||
"--sbt-jar",
|
"--sbt-jar",
|
||||||
"../target/universal/stage/bin/sbt-launch.jar"
|
"../../target/out/jvm/u/sbt-launcher-packaging/universal/stage/bin/sbt-launcher.jar"
|
||||||
).!!.linesIterator.toList
|
).!!.linesIterator.toList
|
||||||
assert(
|
assert(
|
||||||
out.contains[String]("../target/universal/stage/bin/sbt-launch.jar") ||
|
out.contains[String]("../../target/out/jvm/u/sbt-launcher-packaging/universal/stage/bin/sbt-launcher.jar") ||
|
||||||
out.contains[String]("\"../target/universal/stage/bin/sbt-launch.jar\"")
|
out.contains[String]("\"../../target/out/jvm/u/sbt-launcher-packaging/universal/stage/bin/sbt-launcher.jar\"")
|
||||||
)
|
)
|
||||||
()
|
()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,11 @@ object IntegrationTestPaths {
|
||||||
baseDir match {
|
baseDir match {
|
||||||
case Some(b) =>
|
case Some(b) =>
|
||||||
val name = if (isWindows) "sbt.bat" else "sbt"
|
val name = if (isWindows) "sbt.bat" else "sbt"
|
||||||
new File(b.getParentFile, s"target/universal/stage/bin/$name").getAbsoluteFile
|
new File(b.getParentFile.getParentFile, s"target/out/jvm/u/sbt-launcher-packaging/universal/stage/bin/$name").getAbsoluteFile
|
||||||
case None =>
|
case None =>
|
||||||
val rel =
|
val rel =
|
||||||
if (isWindows) "../target/universal/stage/bin/sbt.bat"
|
if (isWindows) "../../target/out/jvm/u/sbt-launcher-packaging/universal/stage/bin/sbt.bat"
|
||||||
else "../target/universal/stage/bin/sbt"
|
else "../../target/out/jvm/u/sbt-launcher-packaging/universal/stage/bin/sbt"
|
||||||
new File(rel).getAbsoluteFile
|
new File(rel).getAbsoluteFile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import sbt.*
|
import sbt.*
|
||||||
import Keys.*
|
import Keys.*
|
||||||
|
import sbt.util.CacheImplicits.given
|
||||||
|
|
||||||
object HouseRulesPlugin extends AutoPlugin {
|
object HouseRulesPlugin extends AutoPlugin {
|
||||||
override def requires = plugins.JvmPlugin
|
override def requires = plugins.JvmPlugin
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import sbt.*
|
import sbt.*
|
||||||
import Keys.*
|
import Keys.*
|
||||||
|
import sbt.util.CacheImplicits.given
|
||||||
import sbt.internal.librarymanagement.IvyActions
|
import sbt.internal.librarymanagement.IvyActions
|
||||||
import com.jsuereth.sbtpgp.SbtPgp
|
import com.jsuereth.sbtpgp.SbtPgp
|
||||||
import com.typesafe.sbt.packager.universal.{ UniversalPlugin, UniversalDeployPlugin }
|
import com.typesafe.sbt.packager.universal.{ UniversalPlugin, UniversalDeployPlugin }
|
||||||
|
|
@ -25,28 +26,34 @@ object PackageSignerPlugin extends sbt.AutoPlugin {
|
||||||
art.withExtension(ext)
|
art.withExtension(ext)
|
||||||
|
|
||||||
def packageSignerSettings: Seq[Setting[?]] = Seq(
|
def packageSignerSettings: Seq[Setting[?]] = Seq(
|
||||||
signedArtifacts := {
|
signedArtifacts := Def.uncached {
|
||||||
val artifacts = packagedArtifacts.value
|
val artifacts = packagedArtifacts.value
|
||||||
val r = pgpSigner.value
|
val r = pgpSigner.value
|
||||||
val skipZ = (pgpSigner / skip).value
|
val skipZ = (pgpSigner / skip).value
|
||||||
val s = streams.value
|
val s = streams.value
|
||||||
|
val converter = fileConverter.value
|
||||||
if (!skipZ) {
|
if (!skipZ) {
|
||||||
artifacts flatMap { case (art, f) =>
|
artifacts flatMap { case (art, virtualFile) =>
|
||||||
|
val f = converter.toPath(virtualFile).toFile
|
||||||
Seq(
|
Seq(
|
||||||
art -> f,
|
art -> virtualFile,
|
||||||
subExtension(art, art.extension + gpgExtension) ->
|
subExtension(art, art.extension + gpgExtension) ->
|
||||||
r.sign(f, file(f.getAbsolutePath + gpgExtension), s)
|
converter.toVirtualFile(r.sign(f, file(f.getAbsolutePath + gpgExtension), s).toPath)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else artifacts
|
} else artifacts
|
||||||
},
|
},
|
||||||
publishSignedConfiguration := Classpaths.publishConfig(
|
publishSignedConfiguration := Classpaths.publishConfig(
|
||||||
publishMavenStyle = publishMavenStyle.value,
|
publishMavenStyle = publishMavenStyle.value,
|
||||||
deliverIvyPattern =
|
deliverIvyPattern = fileConverter.value
|
||||||
(Compile / packageBin / artifactPath).value.getParent + "/[artifact]-[revision](-[classifier]).[ext]",
|
.toPath((Compile / packageBin / artifactPath).value)
|
||||||
|
.toFile
|
||||||
|
.getParent + "/[artifact]-[revision](-[classifier]).[ext]",
|
||||||
status = if (isSnapshot.value) "integration" else "release",
|
status = if (isSnapshot.value) "integration" else "release",
|
||||||
configurations = Vector.empty,
|
configurations = Vector.empty,
|
||||||
artifacts = signedArtifacts.value.toVector,
|
artifacts = signedArtifacts.value.map { (k, v) =>
|
||||||
|
k -> fileConverter.value.toPath(v).toFile
|
||||||
|
}.toVector,
|
||||||
checksums = (publish / checksums).value.toVector,
|
checksums = (publish / checksums).value.toVector,
|
||||||
resolverName = Classpaths.getPublishTo(publishTo.value).name,
|
resolverName = Classpaths.getPublishTo(publishTo.value).name,
|
||||||
logging = ivyLoggingLevel.value,
|
logging = ivyLoggingLevel.value,
|
||||||
|
|
@ -54,11 +61,15 @@ object PackageSignerPlugin extends sbt.AutoPlugin {
|
||||||
),
|
),
|
||||||
publishLocalSignedConfiguration := Classpaths.publishConfig(
|
publishLocalSignedConfiguration := Classpaths.publishConfig(
|
||||||
publishMavenStyle = publishMavenStyle.value,
|
publishMavenStyle = publishMavenStyle.value,
|
||||||
deliverIvyPattern =
|
deliverIvyPattern = fileConverter.value
|
||||||
(Compile / packageBin / artifactPath).value.getParent + "/[artifact]-[revision](-[classifier]).[ext]",
|
.toPath((Compile / packageBin / artifactPath).value)
|
||||||
|
.toFile
|
||||||
|
.getParent + "/[artifact]-[revision](-[classifier]).[ext]",
|
||||||
status = if (isSnapshot.value) "integration" else "release",
|
status = if (isSnapshot.value) "integration" else "release",
|
||||||
configurations = Vector.empty,
|
configurations = Vector.empty,
|
||||||
artifacts = signedArtifacts.value.toVector,
|
artifacts = signedArtifacts.value.map { (k, v) =>
|
||||||
|
k -> fileConverter.value.toPath(v).toFile
|
||||||
|
}.toVector,
|
||||||
checksums = (publish / checksums).value.toVector,
|
checksums = (publish / checksums).value.toVector,
|
||||||
resolverName = "local",
|
resolverName = "local",
|
||||||
logging = ivyLoggingLevel.value,
|
logging = ivyLoggingLevel.value,
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package sbt
|
||||||
import java.nio.file.{ FileAlreadyExistsException, Files }
|
import java.nio.file.{ FileAlreadyExistsException, Files }
|
||||||
|
|
||||||
import sbt.Keys.*
|
import sbt.Keys.*
|
||||||
|
import sbt.util.CacheImplicits.given
|
||||||
import sbt.internal.librarymanagement.IvyXml
|
import sbt.internal.librarymanagement.IvyXml
|
||||||
|
|
||||||
/** This local plugin provides ways of publishing just the binary jar. */
|
/** This local plugin provides ways of publishing just the binary jar. */
|
||||||
|
|
@ -15,48 +16,57 @@ object PublishBinPlugin extends AutoPlugin {
|
||||||
}
|
}
|
||||||
import autoImport.*
|
import autoImport.*
|
||||||
|
|
||||||
private val dummyDoc = taskKey[File]("").withRank(Int.MaxValue)
|
private val dummyDoc = taskKey[HashedVirtualFileRef]("").withRank(Int.MaxValue)
|
||||||
override val globalSettings = Seq(publishLocalBin := (()))
|
override val globalSettings = Seq(publishLocalBin := (()))
|
||||||
|
|
||||||
override val projectSettings: Seq[Def.Setting[?]] = Def.settings(
|
override val projectSettings: Seq[Def.Setting[?]] = Def.settings(
|
||||||
publishLocalBin := Classpaths
|
publishLocalBin := Classpaths
|
||||||
.publishOrSkip(publishLocalBinConfig, publishLocalBin / skip)
|
.publishOrSkip(publishLocalBinConfig, publishLocalBin / skip)
|
||||||
.value,
|
.value,
|
||||||
publishLocalBinConfig := Classpaths.publishConfig(
|
publishLocalBinConfig := Def.uncached(
|
||||||
false, // publishMavenStyle.value,
|
Classpaths.publishConfig(
|
||||||
Classpaths.deliverPattern(crossTarget.value),
|
false, // publishMavenStyle.value,
|
||||||
if (isSnapshot.value) "integration" else "release",
|
Classpaths.deliverPattern(crossTarget.value),
|
||||||
ivyConfigurations.value.map(c => ConfigRef(c.name)).toVector,
|
if (isSnapshot.value) "integration" else "release",
|
||||||
(publishLocalBin / packagedArtifacts).value.toVector,
|
ivyConfigurations.value.map(c => ConfigRef(c.name)).toVector,
|
||||||
(publishLocalBin / checksums).value.toVector,
|
(publishLocalBin / packagedArtifacts).value.map { (k, v) =>
|
||||||
logging = ivyLoggingLevel.value,
|
k -> fileConverter.value.toPath(v).toFile
|
||||||
overwrite = isSnapshot.value
|
}.toVector,
|
||||||
),
|
(publishLocalBin / checksums).value.toVector,
|
||||||
publishLocalBinConfig := publishLocalBinConfig
|
logging = ivyLoggingLevel.value,
|
||||||
.dependsOn(
|
overwrite = isSnapshot.value
|
||||||
// Copied from sbt.internal.
|
|
||||||
Def.task {
|
|
||||||
val currentProject = {
|
|
||||||
val proj = csrProject.value
|
|
||||||
val publications = csrPublications.value
|
|
||||||
proj.withPublications(publications)
|
|
||||||
}
|
|
||||||
IvyXml.writeFiles(currentProject, None, ivySbt.value, streams.value.log)
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.value,
|
),
|
||||||
|
publishLocalBinConfig := Def.uncached(
|
||||||
|
publishLocalBinConfig
|
||||||
|
.dependsOn(
|
||||||
|
// Copied from sbt.internal.
|
||||||
|
Def.task {
|
||||||
|
val currentProject = {
|
||||||
|
val proj = csrProject.value
|
||||||
|
val publications = csrPublications.value
|
||||||
|
proj.withPublications(publications)
|
||||||
|
}
|
||||||
|
IvyXml.writeFiles(currentProject, None, ivySbt.value, streams.value.log, Nil)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.value
|
||||||
|
),
|
||||||
dummyDoc := {
|
dummyDoc := {
|
||||||
val dummyFile = streams.value.cacheDirectory / "doc.jar"
|
val dummyFile = streams.value.cacheDirectory / "doc.jar"
|
||||||
try {
|
try {
|
||||||
Files.createDirectories(dummyFile.toPath.getParent)
|
Files.createDirectories(dummyFile.toPath.getParent)
|
||||||
Files.createFile(dummyFile.toPath)
|
Files.createFile(dummyFile.toPath)
|
||||||
} catch { case _: FileAlreadyExistsException => }
|
} catch { case _: FileAlreadyExistsException => }
|
||||||
dummyFile
|
fileConverter.value.toVirtualFile(dummyFile.toPath)
|
||||||
},
|
},
|
||||||
dummyDoc / packagedArtifact := (Compile / packageDoc / artifact).value -> dummyDoc.value,
|
dummyDoc / packagedArtifact := Def.uncached(
|
||||||
publishLocalBin / packagedArtifacts :=
|
(Compile / packageDoc / artifact).value -> dummyDoc.value
|
||||||
|
),
|
||||||
|
publishLocalBin / packagedArtifacts := Def.uncached(
|
||||||
Classpaths
|
Classpaths
|
||||||
.packaged(Seq(Compile / packageBin, Compile / packageSrc, makePom, dummyDoc))
|
.packaged(Seq(Compile / packageBin, Compile / packageSrc, makePom, dummyDoc))
|
||||||
.value
|
.value
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,30 @@
|
||||||
import sbt.Keys.*
|
import sbt.Keys.*
|
||||||
import sbt.*
|
import sbt.*
|
||||||
import sbt.io.CopyOptions
|
import sbt.io.CopyOptions
|
||||||
|
import sbt.util.CacheImplicits.given
|
||||||
|
|
||||||
object SbtLauncherPlugin extends AutoPlugin {
|
object SbtLauncherPlugin extends AutoPlugin {
|
||||||
override def requires = plugins.IvyPlugin
|
override def requires = plugins.IvyPlugin
|
||||||
|
|
||||||
object autoImport {
|
object autoImport {
|
||||||
val SbtLaunchConfiguration = config("sbt-launch")
|
val SbtLaunchConfiguration = config("sbt-launch")
|
||||||
val sbtLaunchJar = taskKey[File]("constructs an sbt-launch.jar for this version of sbt.")
|
val sbtLaunchJar =
|
||||||
|
taskKey[HashedVirtualFileRef]("constructs an sbt-launch.jar for this version of sbt.")
|
||||||
val rawSbtLaunchJar =
|
val rawSbtLaunchJar =
|
||||||
taskKey[File]("The released version of the sbt-launcher we use to bundle this application.")
|
taskKey[HashedVirtualFileRef](
|
||||||
|
"The released version of the sbt-launcher we use to bundle this application."
|
||||||
|
)
|
||||||
}
|
}
|
||||||
import autoImport.*
|
import autoImport.*
|
||||||
|
|
||||||
override def projectConfigurations: Seq[Configuration] = Seq(SbtLaunchConfiguration)
|
override def projectConfigurations: Seq[Configuration] = Seq(SbtLaunchConfiguration)
|
||||||
override def projectSettings: Seq[Setting[?]] = Seq(
|
override def projectSettings: Seq[Setting[?]] = Seq(
|
||||||
libraryDependencies += Dependencies.rawLauncher % SbtLaunchConfiguration.name,
|
libraryDependencies += Dependencies.rawLauncher % SbtLaunchConfiguration.name,
|
||||||
rawSbtLaunchJar := {
|
rawSbtLaunchJar := Def.uncached {
|
||||||
Classpaths.managedJars(SbtLaunchConfiguration, Set("jar"), update.value).headOption match {
|
val converter = fileConverter.value
|
||||||
|
Classpaths
|
||||||
|
.managedJars(SbtLaunchConfiguration, Set("jar"), update.value, converter)
|
||||||
|
.headOption match {
|
||||||
case Some(jar) => jar.data
|
case Some(jar) => jar.data
|
||||||
case None =>
|
case None =>
|
||||||
sys.error(
|
sys.error(
|
||||||
|
|
@ -25,7 +32,7 @@ object SbtLauncherPlugin extends AutoPlugin {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sbtLaunchJar := {
|
sbtLaunchJar := Def.uncached {
|
||||||
val propFiles = (Compile / resources).value
|
val propFiles = (Compile / resources).value
|
||||||
val propFileLocations =
|
val propFileLocations =
|
||||||
for (file <- propFiles; if file.getName != "resources") yield {
|
for (file <- propFiles; if file.getName != "resources") yield {
|
||||||
|
|
@ -33,7 +40,13 @@ object SbtLauncherPlugin extends AutoPlugin {
|
||||||
else file.getName -> file
|
else file.getName -> file
|
||||||
}
|
}
|
||||||
// TODO - We need to inject the appropriate boot.properties file for this version of sbt.
|
// TODO - We need to inject the appropriate boot.properties file for this version of sbt.
|
||||||
rebundle(rawSbtLaunchJar.value, propFileLocations.toMap, target.value / "sbt-launch.jar")
|
fileConverter.value.toVirtualFile(
|
||||||
|
rebundle(
|
||||||
|
fileConverter.value.toPath(rawSbtLaunchJar.value).toFile,
|
||||||
|
propFileLocations.toMap,
|
||||||
|
target.value / "sbt-launch.jar"
|
||||||
|
).toPath
|
||||||
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import sbt.*
|
||||||
import sbt.internal.inc.ScalaInstance
|
import sbt.internal.inc.ScalaInstance
|
||||||
import sbt.internal.inc.classpath.{ ClasspathUtilities, FilteredLoader }
|
import sbt.internal.inc.classpath.{ ClasspathUtilities, FilteredLoader }
|
||||||
import scala.annotation.nowarn
|
import scala.annotation.nowarn
|
||||||
import scala.collection.JavaConverters.*
|
import scala.jdk.CollectionConverters.*
|
||||||
|
|
||||||
object LocalScriptedPlugin extends AutoPlugin {
|
object LocalScriptedPlugin extends AutoPlugin {
|
||||||
override def requires = plugins.JvmPlugin
|
override def requires = plugins.JvmPlugin
|
||||||
|
|
@ -21,6 +21,7 @@ trait ScriptedKeys {
|
||||||
"Saves you some time when only your test has changed"
|
"Saves you some time when only your test has changed"
|
||||||
)
|
)
|
||||||
val scriptedSource = settingKey[File]("")
|
val scriptedSource = settingKey[File]("")
|
||||||
|
@transient
|
||||||
val scriptedPrescripted = taskKey[File => Unit]("")
|
val scriptedPrescripted = taskKey[File => Unit]("")
|
||||||
val scriptedKeepTempDirectory = settingKey[Boolean](
|
val scriptedKeepTempDirectory = settingKey[Boolean](
|
||||||
"If true, keeps the temporary directory after scripted tests complete for debugging."
|
"If true, keeps the temporary directory after scripted tests complete for debugging."
|
||||||
|
|
@ -65,10 +66,10 @@ object Scripted {
|
||||||
val p = f.getParentFile
|
val p = f.getParentFile
|
||||||
(p.getParentFile.getName, p.getName)
|
(p.getParentFile.getName, p.getName)
|
||||||
}
|
}
|
||||||
val pairMap = pairs.groupBy(_._1).mapValues(_.map(_._2).toSet)
|
val pairMap = pairs.groupBy(_._1).view.mapValues(_.map(_._2).toSet).toMap
|
||||||
|
|
||||||
val id = charClass(c => !c.isWhitespace && c != '/').+.string
|
val id = charClass(c => !c.isWhitespace && c != '/').+.string
|
||||||
val groupP = token(id.examples(pairMap.keySet)) <~ token('/')
|
val groupP = token(id.examples(pairMap.keySet.toSet)) <~ token('/')
|
||||||
|
|
||||||
// A parser for page definitions
|
// A parser for page definitions
|
||||||
val pageNumber = (NatBasic & not('0', "zero page number")).flatMap { i =>
|
val pageNumber = (NatBasic & not('0', "zero page number")).flatMap { i =>
|
||||||
|
|
@ -130,9 +131,6 @@ object Scripted {
|
||||||
logger.info(s"Tests selected: ${args.mkString("\n * ", "\n * ", "\n")}")
|
logger.info(s"Tests selected: ${args.mkString("\n * ", "\n * ", "\n")}")
|
||||||
logger.info("")
|
logger.info("")
|
||||||
|
|
||||||
// Force Log4J to not use a thread context classloader otherwise it throws a CCE
|
|
||||||
sys.props(org.apache.logging.log4j.util.LoaderUtil.IGNORE_TCCL_PROPERTY) = "true"
|
|
||||||
|
|
||||||
val noJLine = new FilteredLoader(scriptedSbtInstance.loader, "jline." :: Nil)
|
val noJLine = new FilteredLoader(scriptedSbtInstance.loader, "jline." :: Nil)
|
||||||
val loader = ClasspathUtilities.toLoader(classpath, noJLine)
|
val loader = ClasspathUtilities.toLoader(classpath, noJLine)
|
||||||
val bridgeClass = Class.forName("sbt.scriptedtest.ScriptedRunner", true, loader)
|
val bridgeClass = Class.forName("sbt.scriptedtest.ScriptedRunner", true, loader)
|
||||||
|
|
@ -173,7 +171,7 @@ object Scripted {
|
||||||
case i if i > 0 => i
|
case i if i > 0 => i
|
||||||
case _ => 1
|
case _ => 1
|
||||||
}
|
}
|
||||||
import scala.language.reflectiveCalls
|
import scala.reflect.Selectable.reflectiveSelectable
|
||||||
|
|
||||||
bridge.runInParallel(
|
bridge.runInParallel(
|
||||||
sourcePath,
|
sourcePath,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import scala.util.control.NonFatal
|
import scala.util.control.NonFatal
|
||||||
import sbt.*
|
import sbt.*
|
||||||
|
import sbt.given
|
||||||
|
import sbt.util.CacheImplicits.given
|
||||||
import Keys.*
|
import Keys.*
|
||||||
import scalafix.sbt.ScalafixPlugin.autoImport.scalafix
|
import scalafix.sbt.ScalafixPlugin.autoImport.scalafix
|
||||||
|
|
||||||
|
|
@ -9,7 +11,9 @@ object Utils {
|
||||||
val ExclusiveTest: Tags.Tag = Tags.Tag("exclusive-test")
|
val ExclusiveTest: Tags.Tag = Tags.Tag("exclusive-test")
|
||||||
|
|
||||||
val componentID: SettingKey[Option[String]] = settingKey[Option[String]]("")
|
val componentID: SettingKey[Option[String]] = settingKey[Option[String]]("")
|
||||||
|
@transient
|
||||||
val scalaKeywords: TaskKey[Set[String]] = taskKey[Set[String]]("")
|
val scalaKeywords: TaskKey[Set[String]] = taskKey[Set[String]]("")
|
||||||
|
@transient
|
||||||
val generateKeywords: TaskKey[File] = taskKey[File]("")
|
val generateKeywords: TaskKey[File] = taskKey[File]("")
|
||||||
val sbtnVersion = SettingKey[String]("sbtn-version")
|
val sbtnVersion = SettingKey[String]("sbtn-version")
|
||||||
|
|
||||||
|
|
@ -66,7 +70,7 @@ object Utils {
|
||||||
IO.read(propFile).contains(versionLine(version))
|
IO.read(propFile).contains(versionLine(version))
|
||||||
|
|
||||||
def publishPomSettings: Seq[Setting[?]] = Seq(
|
def publishPomSettings: Seq[Setting[?]] = Seq(
|
||||||
pomPostProcess := cleanPom _
|
pomPostProcess := cleanPom
|
||||||
)
|
)
|
||||||
|
|
||||||
def cleanPom(pomNode: scala.xml.Node) = {
|
def cleanPom(pomNode: scala.xml.Node) = {
|
||||||
|
|
@ -100,12 +104,11 @@ object Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
def getScalaKeywords: Set[String] = {
|
def getScalaKeywords: Set[String] = {
|
||||||
val g = new scala.tools.nsc.Global(new scala.tools.nsc.Settings)
|
dotty.tools.dotc.core.StdNames.nme.keywords.map(_.toString).toSet
|
||||||
g.nme.keywords.map(_.toString)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def writeScalaKeywords(base: File, keywords: Set[String]): File = {
|
def writeScalaKeywords(base: File, keywords: Set[String]): File = {
|
||||||
val init = keywords.map(tn => '"' + tn + '"').mkString("Set(", ", ", ")")
|
val init = keywords.map(tn => "\"" + tn + "\"").mkString("Set(", ", ", ")")
|
||||||
val ObjectName = "ScalaKeywords"
|
val ObjectName = "ScalaKeywords"
|
||||||
val PackageName = "sbt.internal.util"
|
val PackageName = "sbt.internal.util"
|
||||||
val keywordsSrc = s"""
|
val keywordsSrc = s"""
|
||||||
|
|
@ -123,7 +126,9 @@ object Utils {
|
||||||
inConfig(Compile)(
|
inConfig(Compile)(
|
||||||
Seq(
|
Seq(
|
||||||
scalaKeywords := getScalaKeywords,
|
scalaKeywords := getScalaKeywords,
|
||||||
generateKeywords := writeScalaKeywords(sourceManaged.value, scalaKeywords.value),
|
generateKeywords := Def.uncached(
|
||||||
|
writeScalaKeywords(sourceManaged.value, scalaKeywords.value)
|
||||||
|
),
|
||||||
sourceGenerators += Def.task(Seq(generateKeywords.value)).taskValue
|
sourceGenerators += Def.task(Seq(generateKeywords.value)).taskValue
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -145,6 +150,7 @@ object Utils {
|
||||||
|
|
||||||
object Licensed {
|
object Licensed {
|
||||||
lazy val notice = SettingKey[Option[File]]("notice")
|
lazy val notice = SettingKey[Option[File]]("notice")
|
||||||
|
@transient
|
||||||
lazy val extractLicenses = TaskKey[Seq[File]]("extract-licenses")
|
lazy val extractLicenses = TaskKey[Seq[File]]("extract-licenses")
|
||||||
|
|
||||||
lazy val seeRegex = """\(see (.*?)\)""".r
|
lazy val seeRegex = """\(see (.*?)\)""".r
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=1.12.10
|
sbt.version=2.0.0-RC16
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
Global / semanticdbVersion := "4.15.2"
|
Global / semanticdbVersion := "4.15.2"
|
||||||
scalacOptions ++= Seq("-feature", "-Ywarn-unused:_,-imports")
|
scalacOptions ++= Seq("-feature", "-language:implicitConversions")
|
||||||
|
|
||||||
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.1.1")
|
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.1.1")
|
||||||
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")
|
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# publishing locally to ensure shading runs fine
|
# publishing locally to ensure shading runs fine
|
||||||
./lm-coursier/metadata/scripts/with-test-repo.sh $SBT \
|
./lm-coursier/metadata/scripts/with-test-repo.sh $SBT --server \
|
||||||
lmCoursierShadedPublishing/publishLocal \
|
lmCoursierShadedPublishing/publishLocal \
|
||||||
lmCoursier/test \
|
lmCoursier/test \
|
||||||
'scripted lm-coursier/*'
|
'scripted lm-coursier/*'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue