diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 90e05c40..95c2d176 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,7 +5,14 @@ version: 2 updates: - - package-ecosystem: "github-actions" # See documentation for possible values - directory: "/" # Location of package manifests + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + + # Also track GitHub Actions updates on the sbt-1 maintenance branch. + - package-ecosystem: "github-actions" + directory: "/" + target-branch: "sbt-1" schedule: interval: "weekly" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0a5c64fb..29a5944d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,9 +24,10 @@ jobs: steps: - uses: actions/checkout@v6 - name: scalafmt test - run: ./sbt "+ scalafmtCheckAll" - test_sbt1_plugin: - name: plugin test (sbt 1.x) + run: ./sbt scalafmtCheckAll + + test_sbt2_plugin: + name: plugin test (sbt 2.x) strategy: fail-fast: false matrix: @@ -44,27 +45,5 @@ jobs: with: distribution: "${{ matrix.distribution }}" java-version: "${{ matrix.java }}" - - name: scripted tests (sbt 1.x) - run: ./sbt "++ 2.12 test" "++ 2.12 scripted" - - # test_sbt2_plugin: - # name: plugin test (sbt 2.x) - # strategy: - # fail-fast: false - # matrix: - # include: - # - os: ubuntu-latest - # distribution: temurin - # java: 21 - # - os: ubuntu-latest - # distribution: temurin - # java: 24 - # runs-on: ${{ matrix.os }} - # steps: - # - uses: actions/checkout@v6 - # - uses: actions/setup-java@v5 - # with: - # distribution: "${{ matrix.distribution }}" - # java-version: "${{ matrix.java }}" - # - name: scripted tests (sbt 2.x) - # run: ./sbt "++ 3 test" "++ 3 scripted" + - name: scripted tests (sbt 2.x) + run: ./sbt test scripted diff --git a/.scala-steward.conf b/.scala-steward.conf index 9d5ef698..ff61099d 100644 --- a/.scala-steward.conf +++ b/.scala-steward.conf @@ -1,2 +1,2 @@ -# sbt plugins must use Scala 2.12.x -updates.pin = [ { groupId = "org.scala-lang", artifactId="scala-library", version = "2.12." } ] +# sbt 2 plugins use Scala 3; no Scala version pin needed here. + diff --git a/.scalafmt.conf b/.scalafmt.conf index 04379247..cc3e92a7 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,6 +1,6 @@ version = 3.9.4 project.layout = StandardConvention -runner.dialect = scala212 +runner.dialect = scala3 maxColumn = 120 style = defaultWithAlign optIn.breaksInsideChains = true diff --git a/build.sbt b/build.sbt index ee747570..f6a59632 100644 --- a/build.sbt +++ b/build.sbt @@ -3,18 +3,10 @@ Global / onChangedBuildSource := ReloadOnSourceChanges enablePlugins(SbtTwirl) enablePlugins(SbtPlugin) -val SCALA_3 = "3.7.4" -val SCALA_2 = "2.12.21" -ThisBuild / crossScalaVersions := List(SCALA_3, SCALA_2) +val SCALA_3 = "3.8.4" +ThisBuild / scalaVersion := SCALA_3 -pluginCrossBuild / sbtVersion := { - scalaBinaryVersion.value match { - case "2.12" => - (pluginCrossBuild / sbtVersion).value - case _ => - "2.0.0-M4" - } -} +pluginCrossBuild / sbtVersion := "2.0.0" organization := "org.xerial.sbt" organizationName := "Xerial project" diff --git a/src/main/scala-2/xerial/sbt/pack/PluginCompat.scala b/src/main/scala-2/xerial/sbt/pack/PluginCompat.scala deleted file mode 100644 index 2f541585..00000000 --- a/src/main/scala-2/xerial/sbt/pack/PluginCompat.scala +++ /dev/null @@ -1,21 +0,0 @@ -package xerial.sbt.pack - -import java.nio.file.{Path => NioPath} -import sbt.* -import xsbti.FileConverter - -private[pack] object PluginCompat { - type FileRef = java.io.File - type Out = java.io.File - - implicit def toFile(a: FileRef): Out = a - - def toNioPath(a: Attributed[File])(implicit conv: FileConverter): NioPath = - a.data.toPath() - def toFile(a: Attributed[File])(implicit conv: FileConverter): File = - a.data - def toNioPaths(cp: Seq[Attributed[File]])(implicit conv: FileConverter): Vector[NioPath] = - cp.map(_.data.toPath()).toVector - def toFiles(cp: Seq[Attributed[File]])(implicit conv: FileConverter): Vector[File] = - cp.map(_.data).toVector -} diff --git a/src/main/scala/xerial/sbt/pack/PackArchive.scala b/src/main/scala/xerial/sbt/pack/PackArchive.scala index 12e182f5..58fa9881 100644 --- a/src/main/scala/xerial/sbt/pack/PackArchive.scala +++ b/src/main/scala/xerial/sbt/pack/PackArchive.scala @@ -10,6 +10,7 @@ import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream import org.apache.commons.io.IOUtils import sbt.Keys.* import sbt.* +import xsbti.FileConverter import PluginCompat.* import PluginCompat.toFile @@ -89,31 +90,42 @@ trait PackArchive { packArchiveTbzArtifact := Artifact(packArchivePrefix.value, "arch", "tar.bz2"), packArchiveTxzArtifact := Artifact(packArchivePrefix.value, "arch", "tar.xz"), packArchiveZipArtifact := Artifact(packArchivePrefix.value, "arch", "zip"), - Def.derive( - packArchiveTgz := createArchive[TarArchiveEntry]( + packArchiveTgz := Def.uncached { + given conv: FileConverter = fileConverter.value + val file = createArchive[TarArchiveEntry]( "tar.gz", (fos) => createTarArchiveOutputStream(new GzipCompressorOutputStream(fos)), createTarEntry ).value - ), - Def.derive( - packArchiveTbz := createArchive[TarArchiveEntry]( + toFileRef(file) + }, + packArchiveTbz := Def.uncached { + given conv: FileConverter = fileConverter.value + val file = createArchive[TarArchiveEntry]( "tar.bz2", (fos) => createTarArchiveOutputStream(new BZip2CompressorOutputStream(fos)), createTarEntry ).value - ), - Def.derive( - packArchiveTxz := createArchive[TarArchiveEntry]( + toFileRef(file) + }, + packArchiveTxz := Def.uncached { + given conv: FileConverter = fileConverter.value + val file = createArchive[TarArchiveEntry]( "tar.xz", (fos) => createTarArchiveOutputStream(new XZCompressorOutputStream(fos)), createTarEntry ).value - ), - Def.derive( - packArchiveZip := createArchive[ZipArchiveEntry]("zip", new ZipArchiveOutputStream(_), createZipEntry).value - ), - Def.derive(packArchive := Seq(packArchiveTgz.value, packArchiveZip.value)) + toFileRef(file) + }, + packArchiveZip := Def.uncached { + given conv: FileConverter = fileConverter.value + val file = createArchive[ZipArchiveEntry]("zip", new ZipArchiveOutputStream(_), createZipEntry).value + toFileRef(file) + }, + packArchive := Def.uncached { + given conv: FileConverter = fileConverter.value + Seq(toFile(packArchiveTgz.value), toFile(packArchiveZip.value)) + } ) def publishPackArchiveTgz: SettingsDefinition = diff --git a/src/main/scala/xerial/sbt/pack/PackPlugin.scala b/src/main/scala/xerial/sbt/pack/PackPlugin.scala index 972518eb..1681a373 100755 --- a/src/main/scala/xerial/sbt/pack/PackPlugin.scala +++ b/src/main/scala/xerial/sbt/pack/PackPlugin.scala @@ -15,6 +15,7 @@ import java.time.{Instant, ZoneId, ZonedDateTime} import java.util.{Date, Locale} import sbt.Keys.* import sbt.{io, *} +import xsbti.FileConverter import scala.util.Try import scala.util.matching.Regex @@ -131,12 +132,12 @@ object PackPlugin extends AutoPlugin with PackArchive { import autoImport._ lazy val packSettings = Seq[Def.Setting[?]]( - packTargetDir := target.value, + packTargetDir := baseDirectory.value / "target", packDir := "pack", // packBashTemplate := "/xerial/sbt/template/launch.mustache", // packBatTemplate := "/xerial/sbt/template/launch-bat.mustache", // packMakeTemplate := "/xerial/sbt/template/Makefile.mustache", - packMain := packMainDiscovered.value, + packMain := Def.uncached(packMainDiscovered.value), packExclude := Seq.empty, packExcludeLibJars := Seq.empty, packExcludeJars := Seq.empty, @@ -152,7 +153,7 @@ object PackPlugin extends AutoPlugin with PackArchive { packDuplicateJarStrategy := "latest", packGenerateWindowsBatFile := true, packGenerateMakefile := true, - packMainDiscovered := Def.taskDyn { + packMainDiscovered := Def.uncached(Def.taskDyn { val mainClasses = getFromSelectedProjects( thisProjectRef.value, @@ -166,8 +167,8 @@ object PackPlugin extends AutoPlugin with PackArchive { mainClasses.value .flatMap(_._1.map(mainClass => hyphenize(mainClass.split('.').last) -> mainClass).toMap).toMap } - }.value, - packAllUnmanagedJars := Def.taskDyn { + }.value), + packAllUnmanagedJars := Def.uncached(Def.taskDyn { val allUnmanagedJars = getFromSelectedProjects( thisProjectRef.value, @@ -178,117 +179,114 @@ object PackPlugin extends AutoPlugin with PackArchive { packIncludedProjectScopes.value ) Def.task { allUnmanagedJars.value } - }.value, - Def.derive( - packLibJars := Def.taskDyn { - def libJarsFromConfiguration(c: Configuration): Seq[Task[Seq[(FileRef, ProjectRef)]]] = - Seq( - getFromSelectedProjects[FileRef]( - thisProjectRef.value, - c, - packageBin, - state.value, - packExcludeLibJars.value, - packIncludedProjectScopes.value - ) - ) ++ c.extendsConfigs.flatMap(libJarsFromConfiguration) - - val libJars = libJarsFromConfiguration(configuration.value).join - Def.task { - libJars.value.flatten.distinct - } - }.value - ), + }.value), + packLibJars := Def.uncached(Def.taskDyn { + def libJarsFromConfiguration(c: Configuration): Seq[Task[Seq[(FileRef, ProjectRef)]]] = + Seq( + getFromSelectedProjects[FileRef]( + thisProjectRef.value, + c, + packageBin, + state.value, + packExcludeLibJars.value, + packIncludedProjectScopes.value + ) + ) ++ c.extendsConfigs.flatMap(libJarsFromConfiguration) + + val libJars = libJarsFromConfiguration(Runtime).join + Def.task { + libJars.value.flatten.distinct + } + }.value), mappings := Seq.empty, - Def.derive( - packModuleEntries := { - val out = streams.value - val jarExcludeFilter: Seq[Regex] = packExcludeJars.value.map(_.r) - def isExcludeJar(name: String): Boolean = { - val toExclude = jarExcludeFilter.exists(pattern => pattern.findFirstIn(name).isDefined) - if (toExclude) { - out.log.info(s"Exclude $name from the package") - } - toExclude + packModuleEntries := Def.uncached { + val out = streams.value + val jarExcludeFilter: Seq[Regex] = packExcludeJars.value.map(_.r) + def isExcludeJar(name: String): Boolean = { + val toExclude = jarExcludeFilter.exists(pattern => pattern.findFirstIn(name).isDefined) + if (toExclude) { + out.log.info(s"Exclude $name from the package") } + toExclude + } - val df = configurationFilter(name = configuration.value.name) // && - - val dependentJars = - for { - c <- update.value.filter(df).configurations - m <- c.modules if !m.evicted - (artifact, file) <- m.artifacts - if !packExcludeArtifactTypes.value.contains(artifact.`type`) && !isExcludeJar(file.getName()) - } yield { - val mid = m.module - ModuleEntry( - mid.organization, - mid.name, - VersionString(mid.revision), - artifact.name, - artifact.classifier, - file - ) - } + val df = configurationFilter(name = Runtime.name) // && + + val dependentJars = + for { + c <- update.value.filter(df).configurations + m <- c.modules if !m.evicted + (artifact, file) <- m.artifacts + if !packExcludeArtifactTypes.value.contains(artifact.`type`) && !isExcludeJar(file.getName()) + } yield { + val mid = m.module + ModuleEntry( + mid.organization, + mid.name, + VersionString(mid.revision), + artifact.name, + artifact.classifier, + file + ) + } - implicit val versionStringOrdering = DefaultVersionStringOrdering - val distinctDpJars = dependentJars - .groupBy(_.noVersionModuleName) - .flatMap { - case (key, entries) if entries.groupBy(_.revision).size == 1 => entries - case (key, entries) => - val revisions = entries.groupBy(_.revision).map(_._1).toList.sorted - val latestRevision = revisions.last - packDuplicateJarStrategy.value match { - case "latest" => - out.log - .debug(s"Version conflict on $key. Using ${latestRevision} (found ${revisions.mkString(", ")})") - entries.filter(_.revision == latestRevision) - case "exit" => - sys.error(s"Version conflict on $key (found ${revisions.mkString(", ")})") - case x => - sys.error("Unknown duplicate JAR strategy '%s'".format(x)) - } - } - distinctDpJars.toSeq.distinct.sortBy(_.noVersionModuleName) - } - ), + implicit val versionStringOrdering = DefaultVersionStringOrdering + val distinctDpJars = dependentJars + .groupBy(_.noVersionModuleName) + .flatMap { + case (key, entries) if entries.groupBy(_.revision).size == 1 => entries + case (key, entries) => + val revisions = entries.groupBy(_.revision).map(_._1).toList.sorted + val latestRevision = revisions.last + packDuplicateJarStrategy.value match { + case "latest" => + out.log + .debug(s"Version conflict on $key. Using ${latestRevision} (found ${revisions.mkString(", ")})") + entries.filter(_.revision == latestRevision) + case "exit" => + sys.error(s"Version conflict on $key (found ${revisions.mkString(", ")})") + case x => + sys.error("Unknown duplicate JAR strategy '%s'".format(x)) + } + } + distinctDpJars.toSeq.distinct.sortBy(_.noVersionModuleName) + }, packCopyDependenciesUseSymbolicLinks := true, packIncludedProjectScopes := Seq("compile->"), packCopyDependenciesTarget := target.value / "lib", - Def.derive( - packCopyDependencies := { - val log = streams.value.log - - val distinctDpJars = packModuleEntries.value.map(_.file) - val unmanaged = packAllUnmanagedJars.value.flatMap(_._1).map(x => toFile(x.data)) - val copyDepTargetDir = packCopyDependenciesTarget.value - val useSymlink = packCopyDependenciesUseSymbolicLinks.value - - copyDepTargetDir.mkdirs() - IO.delete((copyDepTargetDir * "*.jar").get()) - (distinctDpJars ++ unmanaged).foreach { d => - log.debug(s"Copying ${d.getName()}") - val dest = copyDepTargetDir / d.getName() - if (useSymlink) { - Files.createSymbolicLink(dest.toPath, d.toPath()) - } else { - IO.copyFile(d, dest) - } + packCopyDependencies := Def.uncached { + val log = streams.value.log + given conv: FileConverter = fileConverter.value + + val distinctDpJars = packModuleEntries.value.map(_.file) + val unmanaged = packAllUnmanagedJars.value.flatMap(_._1).map(x => toFile(x.data)) + val copyDepTargetDir = packCopyDependenciesTarget.value + val useSymlink = packCopyDependenciesUseSymbolicLinks.value + + copyDepTargetDir.mkdirs() + IO.delete((copyDepTargetDir * "*.jar").get()) + (distinctDpJars ++ unmanaged).foreach { d => + log.debug(s"Copying ${d.getName()}") + val dest = copyDepTargetDir / d.getName() + if (useSymlink) { + Files.createSymbolicLink(dest.toPath, d.toPath()) + } else { + IO.copyFile(d, dest) } - val libs = packLibJars.value.map(_._1) - libs.foreach(l => IO.copyFile(l, copyDepTargetDir / l.getName())) - - log.info(s"Copied ${distinctDpJars.size + libs.size} jars to ${copyDepTargetDir}") } - ), - packEnvVars := Map.empty, - Def.derive(pack := { + val libs = packLibJars.value.map(_._1).map(toFile) + libs.foreach(l => IO.copyFile(l, copyDepTargetDir / l.getName())) + + log.info(s"Copied ${distinctDpJars.size + libs.size} jars to ${copyDepTargetDir}") + }, + packEnvVars := Def.uncached(Map.empty), + pack := Def.uncached { val out = streams.value val logPrefix = "[" + name.value + "] " val base: File = new File(".") // Using the working directory as base for readability + given conv: FileConverter = fileConverter.value + val distDir: File = packTargetDir.value / packDir.value out.log.info(logPrefix + "Creating a distributable package in " + rpath(base, distDir)) IO.delete(distDir) @@ -300,8 +298,8 @@ object PackPlugin extends AutoPlugin with PackArchive { // Copy project jars out.log.info(logPrefix + "Copying libraries to " + rpath(base, libDir)) - val libs: Seq[FileRef] = packLibJars.value.map(_._1) - out.log.info(logPrefix + "project jars:\n" + libs.map(path => rpath(base, new io.RichFile(path))).mkString("\n")) + val libs: Seq[File] = packLibJars.value.map(_._1).map(toFile) + out.log.info(logPrefix + "project jars:\n" + libs.map(path => rpath(base, path)).mkString("\n")) val projectJars = libs.map(l => { val dest = libDir / l.getName() IO.copyFile(l, dest) @@ -323,7 +321,7 @@ object PackPlugin extends AutoPlugin with PackArchive { // Copy unmanaged jars in ${baseDir}/lib folder out.log.info(logPrefix + "Copying unmanaged dependencies:") - val unmanagedDepsJars = for ((m, projectRef) <- packAllUnmanagedJars.value; um <- m; f = um.data) yield { + val unmanagedDepsJars = for ((m, projectRef) <- packAllUnmanagedJars.value; um <- m; f = toFile(um.data)) yield { out.log.info(f.getPath) val dest = libDir / f.getName() sbt.IO.copyFile(f, dest, true) @@ -331,7 +329,7 @@ object PackPlugin extends AutoPlugin with PackArchive { } // Copy explicitly added dependencies - val mapped: Seq[(FileRef, String)] = mappings.value + val mapped: Seq[(File, String)] = mappings.value.map { case (ref, p) => (toFile(ref), p) } out.log.info(logPrefix + "Copying explicit dependencies:") val explicitDepsJars = for ((file, path) <- mapped) yield { out.log.info(file.getPath) @@ -398,7 +396,7 @@ object PackPlugin extends AutoPlugin with PackArchive { def expandedClasspath(sep: String): String = { val projJars = libs.map(l => "${PROG_HOME}/lib/" + l.getName()) val depJars = distinctDpJars.map(m => "${PROG_HOME}/lib/" + resolveJarName(m, jarNameConvention)) - val unmanagedJars = for ((m, projectRef) <- packAllUnmanagedJars.value; um <- m; f = um.data) yield { + val unmanagedJars = for ((m, projectRef) <- packAllUnmanagedJars.value; um <- m; f = toFile(um.data)) yield { "${PROG_HOME}/lib/" + f.getName() } (projJars ++ depJars ++ unmanagedJars).mkString("", sep, sep) @@ -505,8 +503,8 @@ object PackPlugin extends AutoPlugin with PackArchive { out.log.info(logPrefix + "done.") distDir - }), - Def.derive(packInstall := { + }, + packInstall := { val arg: Option[String] = targetFolderParser.parsed val packDir = pack.value val cmd = arg match { @@ -516,7 +514,7 @@ object PackPlugin extends AutoPlugin with PackArchive { s"make install" } sys.process.Process(cmd, Some(packDir)).! - }) + } ) private def getFromSelectedProjects[T]( diff --git a/src/main/scala-3/xerial/sbt/pack/PluginCompat.scala b/src/main/scala/xerial/sbt/pack/PluginCompat.scala similarity index 56% rename from src/main/scala-3/xerial/sbt/pack/PluginCompat.scala rename to src/main/scala/xerial/sbt/pack/PluginCompat.scala index d2235f9c..af1379f1 100644 --- a/src/main/scala-3/xerial/sbt/pack/PluginCompat.scala +++ b/src/main/scala/xerial/sbt/pack/PluginCompat.scala @@ -2,7 +2,6 @@ package xerial.sbt.pack import java.nio.file.Path as NioPath import sbt.* -import sbt.internal.inc.PlainVirtualFileConverter import xsbti.{FileConverter, HashedVirtualFileRef, VirtualFile} // See https://www.eed3si9n.com/sbt-assembly-2.3.0 @@ -10,16 +9,14 @@ private[pack] object PluginCompat: type FileRef = HashedVirtualFileRef type Out = VirtualFile - given conv: FileConverter = PlainVirtualFileConverter.converter - - implicit def toFile(a: HashedVirtualFileRef): File = conv.toPath(a).toFile - implicit def toFileRef(a: File): FileRef = conv.toVirtualFile(a.toPath) + def toFile(a: HashedVirtualFileRef)(using conv: FileConverter): File = conv.toPath(a).toFile + def toFileRef(a: File)(using conv: FileConverter): FileRef = conv.toVirtualFile(a.toPath) def toNioPath(a: Attributed[HashedVirtualFileRef])(using conv: FileConverter): NioPath = conv.toPath(a.data) - inline def toFile(a: Attributed[HashedVirtualFileRef])(using conv: FileConverter): File = + def toFile(a: Attributed[HashedVirtualFileRef])(using conv: FileConverter): File = toNioPath(a).toFile() def toNioPaths(cp: Seq[Attributed[HashedVirtualFileRef]])(using conv: FileConverter): Vector[NioPath] = cp.map(toNioPath).toVector - inline def toFiles(cp: Seq[Attributed[HashedVirtualFileRef]])(using conv: FileConverter): Vector[File] = + def toFiles(cp: Seq[Attributed[HashedVirtualFileRef]])(using conv: FileConverter): Vector[File] = toNioPaths(cp).map(_.toFile()) diff --git a/src/sbt-test/sbt-pack/copy-dependencies/build.sbt b/src/sbt-test/sbt-pack/copy-dependencies/build.sbt index 5f96eff4..1edc1cc1 100644 --- a/src/sbt-test/sbt-pack/copy-dependencies/build.sbt +++ b/src/sbt-test/sbt-pack/copy-dependencies/build.sbt @@ -4,7 +4,7 @@ val commonSettings = Seq( scalaVersion := "2.12.21", version := "0.1", crossPaths := false, - packCopyDependenciesTarget := target.value / "WEB-INF/lib" + packCopyDependenciesTarget := baseDirectory.value / "target" / "WEB-INF/lib" ) lazy val root = @@ -19,7 +19,7 @@ lazy val module1 = .settings( libraryDependencies ++= Seq( "org.xerial" % "xerial-core" % "3.3.6", - "org.slf4j" % "slf4j-api" % "1.7.2" force (), + ("org.slf4j" % "slf4j-api" % "1.7.2").force(), "jakarta-regexp" % "jakarta-regexp" % "1.4", "xalan" % "xalan" % "2.7.1" ), diff --git a/src/sbt-test/sbt-pack/duplicate-jars/build.sbt b/src/sbt-test/sbt-pack/duplicate-jars/build.sbt index 36dff6e0..4d7ad809 100644 --- a/src/sbt-test/sbt-pack/duplicate-jars/build.sbt +++ b/src/sbt-test/sbt-pack/duplicate-jars/build.sbt @@ -18,7 +18,7 @@ lazy val module1 = Project( .settings( libraryDependencies ++= Seq( "org.xerial" % "xerial-core" % "3.3.6", - "org.slf4j" % "slf4j-api" % "1.7.2" force () + ("org.slf4j" % "slf4j-api" % "1.7.2").force() ) ) diff --git a/src/sbt-test/sbt-pack/exclude-test-config/project/build.properties b/src/sbt-test/sbt-pack/exclude-test-config/project/build.properties deleted file mode 100644 index 01a16ed1..00000000 --- a/src/sbt-test/sbt-pack/exclude-test-config/project/build.properties +++ /dev/null @@ -1 +0,0 @@ -sbt.version=1.11.7 diff --git a/src/sbt-test/sbt-pack/jvm-version-opts/project/build.properties b/src/sbt-test/sbt-pack/jvm-version-opts/project/build.properties deleted file mode 100644 index cc68b53f..00000000 --- a/src/sbt-test/sbt-pack/jvm-version-opts/project/build.properties +++ /dev/null @@ -1 +0,0 @@ -sbt.version=1.10.11 diff --git a/src/sbt-test/sbt-pack/nested-project/build.sbt b/src/sbt-test/sbt-pack/nested-project/build.sbt index 228f5280..2a6d1770 100644 --- a/src/sbt-test/sbt-pack/nested-project/build.sbt +++ b/src/sbt-test/sbt-pack/nested-project/build.sbt @@ -1,17 +1,20 @@ -name := "nested" - -ThisBuild / version := "0.1" - +ThisBuild / version := "0.1" ThisBuild / scalaVersion := "2.13.16" - -enablePlugins(PackPlugin) +ThisBuild / crossPaths := false lazy val root = (project in file(".")) .dependsOn(module1, module2) .enablePlugins(PackPlugin) + .settings(name := "nested-root") + +lazy val module1 = (project in file("modules/module1")) + .dependsOn(lib1) + .enablePlugins(PackPlugin) + .settings(name := "module1") -lazy val module1 = (project in file("modules/module1")).dependsOn(lib1).enablePlugins(PackPlugin) -lazy val module2 = (project in file("modules/module2")).dependsOn(lib2) +lazy val module2 = (project in file("modules/module2")) + .dependsOn(lib2) + .settings(name := "module2") -lazy val lib1 = project in file("libs/lib1") -lazy val lib2 = project in file("libs/lib2") +lazy val lib1 = (project in file("libs/lib1")).settings(name := "lib1") +lazy val lib2 = (project in file("libs/lib2")).settings(name := "lib2") diff --git a/src/sbt-test/sbt-pack/nested-project/test b/src/sbt-test/sbt-pack/nested-project/test index 26db501f..c17ad812 100644 --- a/src/sbt-test/sbt-pack/nested-project/test +++ b/src/sbt-test/sbt-pack/nested-project/test @@ -1,16 +1,16 @@ > 'set version := "0.1"' > pack -$ exists target/pack/lib/module1_2.13-0.1.jar -$ exists target/pack/lib/module2_2.13-0.1.jar -$ exists target/pack/lib/lib1_2.13-0.1.jar -$ exists target/pack/lib/lib2_2.13-0.1.jar -$ absent modules/module1/target/pack/lib/module1_2.13-0.1.jar -$ absent modules/module1/target/pack/lib/module2_2.13-0.1.jar -$ absent modules/module1/target/pack/lib/lib1_2.13-0.1.jar -$ absent modules/module1/target/pack/lib/lib2_2.13-0.1.jar +$ exists target/pack/lib/module1-0.1.jar +$ exists target/pack/lib/module2-0.1.jar +$ exists target/pack/lib/lib1-0.1.jar +$ exists target/pack/lib/lib2-0.1.jar +$ absent modules/module1/target/pack/lib/module1-0.1.jar +$ absent modules/module1/target/pack/lib/module2-0.1.jar +$ absent modules/module1/target/pack/lib/lib1-0.1.jar +$ absent modules/module1/target/pack/lib/lib2-0.1.jar > module1 / pack -$ exists modules/module1/target/pack/lib/module1_2.13-0.1.jar -$ absent modules/module1/target/pack/lib/module2_2.13-0.1.jar -$ exists modules/module1/target/pack/lib/lib1_2.13-0.1.jar -$ absent modules/module1/target/pack/lib/lib2_2.13-0.1.jar +$ exists modules/module1/target/pack/lib/module1-0.1.jar +$ absent modules/module1/target/pack/lib/module2-0.1.jar +$ exists modules/module1/target/pack/lib/lib1-0.1.jar +$ absent modules/module1/target/pack/lib/lib2-0.1.jar