diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala index 1643412d8..dd9f5a177 100644 --- a/main/src/main/scala/sbt/Defaults.scala +++ b/main/src/main/scala/sbt/Defaults.scala @@ -3038,8 +3038,12 @@ object Classpaths { outputPath := { val p = platform.value val m = moduleName.value + val c = crossPaths.value val sv = scalaVersion.value - s"$p/scala-$sv/$m" + val sv1 = + if c then s"scala-$sv" + else "u" + s"$p/$sv1/$m" }, ivyPaths := IvyPaths( baseDirectory.value.toString, diff --git a/sbt-app/src/sbt-test/actions/doc/test b/sbt-app/src/sbt-test/actions/doc/test index bed324217..0485cd45d 100644 --- a/sbt-app/src/sbt-test/actions/doc/test +++ b/sbt-app/src/sbt-test/actions/doc/test @@ -5,10 +5,10 @@ # hybrid project, only scaladoc run > doc > packageBin -$ exists target/out/jvm/scala-2.12.20/root/api/index.js -$ exists target/out/jvm/scala-2.12.20/root/api/A$.html -$ absent target/out/jvm/scala-2.12.20/root/api/scala -$ absent target/out/jvm/scala-2.12.20/root/api/java +$ exists target/out/jvm/u/root/api/index.js +$ exists target/out/jvm/u/root/api/A$.html +$ absent target/out/jvm/u/root/api/scala +$ absent target/out/jvm/u/root/api/java > setDocExtension scala @@ -19,12 +19,12 @@ $ copy-file changes/B.scala B.scala > clean ; compile ; doc # pure scala project, only scaladoc at top level -$ exists target/out/jvm/scala-2.12.20/root/api/index.js -$ exists target/out/jvm/scala-2.12.20/root/api/A$.html -$ exists target/out/jvm/scala-2.12.20/root/api/B$.html -$ absent target/out/jvm/scala-2.12.20/root/api/package-list -$ absent target/out/jvm/scala-2.12.20/root/api/scala -$ absent target/out/jvm/scala-2.12.20/root/api/java +$ exists target/out/jvm/u/root/api/index.js +$ exists target/out/jvm/u/root/api/A$.html +$ exists target/out/jvm/u/root/api/B$.html +$ absent target/out/jvm/u/root/api/package-list +$ absent target/out/jvm/u/root/api/scala +$ absent target/out/jvm/u/root/api/java > setDocExtension java @@ -34,14 +34,14 @@ $ absent target/out/jvm/scala-2.12.20/root/api/java > doc # pure java project, only javadoc at top level -$ exists target/out/jvm/scala-2.12.20/root/api/index.html -$ exists target/out/jvm/scala-2.12.20/root/api/pkg/J.html -$ absent target/out/jvm/scala-2.12.20/root/api/index.js +$ exists target/out/jvm/u/root/api/index.html +$ exists target/out/jvm/u/root/api/pkg/J.html +$ absent target/out/jvm/u/root/api/index.js > setDocExtension scala > ++2.13.x > clean -$ absent target/out/jvm/scala-2.12.20/root/api/A$.html +$ absent target/out/jvm/u/root/api/A$.html > doc -$ exists target/out/jvm/scala-2.13.12/root/api/A$.html -$ exists target/out/jvm/scala-2.13.12/root/api/B$.html +$ exists target/out/jvm/u/root/api/A$.html +$ exists target/out/jvm/u/root/api/B$.html diff --git a/sbt-app/src/sbt-test/package/lazy-name/test b/sbt-app/src/sbt-test/package/lazy-name/test index f68ea1858..356e1d0a9 100644 --- a/sbt-app/src/sbt-test/package/lazy-name/test +++ b/sbt-app/src/sbt-test/package/lazy-name/test @@ -10,14 +10,14 @@ > set version := "0.1.1" > package -$ exists target/out/jvm/scala-3.3.1/lazy-package-name/lazy-package-name-0.1.1.jar +$ exists target/out/jvm/u/lazy-package-name/lazy-package-name-0.1.1.jar > clean > set version := "0.1.2" > package -$ exists target/out/jvm/scala-3.3.1/lazy-package-name/lazy-package-name-0.1.2.jar +$ exists target/out/jvm/u/lazy-package-name/lazy-package-name-0.1.2.jar > clean > set version := "0.1.3" > package -$ exists target/out/jvm/scala-3.3.1/lazy-package-name/lazy-package-name-0.1.3.jar +$ exists target/out/jvm/u/lazy-package-name/lazy-package-name-0.1.3.jar diff --git a/sbt-app/src/sbt-test/package/manifest/test b/sbt-app/src/sbt-test/package/manifest/test index 1c162e9df..b4f26105b 100644 --- a/sbt-app/src/sbt-test/package/manifest/test +++ b/sbt-app/src/sbt-test/package/manifest/test @@ -1,4 +1,4 @@ > package -$ exists target/out/jvm/scala-2.12.18/jar-manifest-test/jar-manifest-test-0.2.jar -$ exec java -jar ./target/out/jvm/scala-2.12.18/jar-manifest-test/jar-manifest-test-0.2.jar +$ exists target/out/jvm/u/jar-manifest-test/jar-manifest-test-0.2.jar +$ exec java -jar ./target/out/jvm/u/jar-manifest-test/jar-manifest-test-0.2.jar > run diff --git a/sbt-app/src/sbt-test/package/resources/test b/sbt-app/src/sbt-test/package/resources/test index 27ee7a65d..d31c184e9 100644 --- a/sbt-app/src/sbt-test/package/resources/test +++ b/sbt-app/src/sbt-test/package/resources/test @@ -10,7 +10,7 @@ # This should fail because sbt should include the resource in the jar but it won't have the right # directory structure --$ exec java -jar ./target/out/jvm/scala-3.3.1/main-resources-test/main-resources-test-0.1.jar +-$ exec java -jar ./target/out/jvm/u/main-resources-test/main-resources-test-0.1.jar # Give the resource the right directory structure $ mkdir src/main/resources/jartest @@ -27,4 +27,4 @@ $ delete src/main/resources/main_resource_test > package # This should succeed because sbt should include the resource in the jar with the right directory structure -$ exec java -jar ./target/out/jvm/scala-3.3.1/main-resources-test/main-resources-test-0.1.jar +$ exec java -jar ./target/out/jvm/u/main-resources-test/main-resources-test-0.1.jar diff --git a/sbt-app/src/sbt-test/project1/lib/build.sbt b/sbt-app/src/sbt-test/project/lib/build.sbt similarity index 71% rename from sbt-app/src/sbt-test/project1/lib/build.sbt rename to sbt-app/src/sbt-test/project/lib/build.sbt index 440c8dbd8..cd7c60f18 100644 --- a/sbt-app/src/sbt-test/project1/lib/build.sbt +++ b/sbt-app/src/sbt-test/project/lib/build.sbt @@ -1,5 +1,3 @@ crossPaths := false - name := "definition-lib-test" - -version := "1.0" \ No newline at end of file +version := "1.0" diff --git a/sbt-app/src/sbt-test/project1/lib/changes/build2.sbt b/sbt-app/src/sbt-test/project/lib/changes/build2.sbt similarity index 100% rename from sbt-app/src/sbt-test/project1/lib/changes/build2.sbt rename to sbt-app/src/sbt-test/project/lib/changes/build2.sbt diff --git a/sbt-app/src/sbt-test/project/lib/src/main/scala/Test.scala b/sbt-app/src/sbt-test/project/lib/src/main/scala/Test.scala new file mode 100644 index 000000000..b9c6b0a49 --- /dev/null +++ b/sbt-app/src/sbt-test/project/lib/src/main/scala/Test.scala @@ -0,0 +1,4 @@ +package injar + +object Test: + def foo: Option[String] = None diff --git a/sbt-app/src/sbt-test/project1/lib/test b/sbt-app/src/sbt-test/project/lib/test similarity index 80% rename from sbt-app/src/sbt-test/project1/lib/test rename to sbt-app/src/sbt-test/project/lib/test index 2f46e6eae..6de060b02 100644 --- a/sbt-app/src/sbt-test/project1/lib/test +++ b/sbt-app/src/sbt-test/project/lib/test @@ -1,8 +1,8 @@ # this step builds a test jar for use by the project definition -> package +> packageBin $ delete build.sbt -$ copy-file target/definition-lib-test-1.0.jar project/lib/test.jar +$ copy-file target/out/jvm/u/definition-lib-test/definition-lib-test-1.0.jar project/lib/test.jar $ copy-file changes/build2.sbt build.sbt # the copied project definition depends on the Test module in test.jar and will diff --git a/sbt-app/src/sbt-test/project1/lib/src/main/scala/Test.scala b/sbt-app/src/sbt-test/project1/lib/src/main/scala/Test.scala deleted file mode 100644 index bfa832aec..000000000 --- a/sbt-app/src/sbt-test/project1/lib/src/main/scala/Test.scala +++ /dev/null @@ -1,6 +0,0 @@ -package injar - -object Test -{ - def foo: Option[String] = None -} \ No newline at end of file