mirror of https://github.com/sbt/sbt.git
Merge pull request #8422 from eed3si9n/wip/crosspath
[2.x] fix: Replace Scala version with u when crossPaths is false
This commit is contained in:
commit
5b92e34dbd
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
crossPaths := false
|
||||
|
||||
name := "definition-lib-test"
|
||||
|
||||
version := "1.0"
|
||||
version := "1.0"
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package injar
|
||||
|
||||
object Test:
|
||||
def foo: Option[String] = None
|
||||
|
|
@ -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
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
package injar
|
||||
|
||||
object Test
|
||||
{
|
||||
def foo: Option[String] = None
|
||||
}
|
||||
Loading…
Reference in New Issue