mirror of https://github.com/sbt/sbt.git
Add support for unmanagedBase (lib) (#91)
* Fix #90 --------- Co-authored-by: Kizuki Yasue <kizuki-yasue@m3.com>
This commit is contained in:
parent
458a172b8f
commit
7a9088ae71
|
|
@ -277,6 +277,7 @@ object ProjectMatrix {
|
|||
target := base.getAbsoluteFile / "target" / svDirSuffix.dropWhile(_ == '-'),
|
||||
crossTarget := Keys.target.value,
|
||||
sourceDirectory := base.getAbsoluteFile / "src",
|
||||
unmanagedBase := base.getAbsoluteFile / "lib",
|
||||
inConfig(Compile)(makeSources(nonScalaDirSuffix, svDirSuffix)),
|
||||
inConfig(Test)(makeSources(nonScalaDirSuffix, svDirSuffix)),
|
||||
projectDependencies := projectDependenciesTask.value,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
ThisBuild / version := "0.1.0-SNAPSHOT"
|
||||
|
||||
lazy val util = projectMatrix
|
||||
.jvmPlatform(scalaVersions = Seq("2.12.19", "2.13.13"))
|
||||
|
||||
lazy val root = (projectMatrix in file("."))
|
||||
.dependsOn(util)
|
||||
.jvmPlatform(scalaVersions = Seq("2.12.19"))
|
||||
|
||||
// ss is second system
|
||||
lazy val ss = projectMatrix
|
||||
.dependsOn(util)
|
||||
.jvmPlatform(scalaVersions = Seq("2.13.13"))
|
||||
|
||||
lazy val strayJar = project
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
sys.props.get("plugin.version") match {
|
||||
case Some(x) => addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % x)
|
||||
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|
||||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
object Main extends App {
|
||||
println(com.example.Lib.getMessage)
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
object Main extends App {
|
||||
println(com.example.Lib.getMessage)
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.example;
|
||||
|
||||
public class Lib {
|
||||
public static String getMessage() {
|
||||
return "Hello, World!";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
# debug
|
||||
#> unmanagedBase
|
||||
|
||||
# make jar
|
||||
> strayJar/package
|
||||
|
||||
# check root
|
||||
$ mkdir lib
|
||||
$ copy-file strayJar/target/scala-2.12/strayJar_2.12-0.1.0-SNAPSHOT.jar lib/strayJar.jar
|
||||
> root2_12/compile
|
||||
|
||||
# check ss
|
||||
$ mkdir ss/lib
|
||||
$ copy-file strayJar/target/scala-2.12/strayJar_2.12-0.1.0-SNAPSHOT.jar ss/lib/strayJar.jar
|
||||
> ss/compile
|
||||
Loading…
Reference in New Issue