diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-07 01:50:26 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-07 02:01:03 -0400 |
commit | d915335f32f89a18cec097159f39334fe2bcde0d (patch) | |
tree | 57934fe60308864fd247c24d74ab7bf55e638cc8 /stage2/Lib.scala | |
parent | 0ef27a7d8cabd0dfe4009b09481566d3d02a76c6 (diff) | |
download | cbt-d915335f32f89a18cec097159f39334fe2bcde0d.tar.gz cbt-d915335f32f89a18cec097159f39334fe2bcde0d.tar.bz2 cbt-d915335f32f89a18cec097159f39334fe2bcde0d.zip |
cross building and automatic snaphot ids
Adds support for cross building for multiple scala versions
And for automatically appending -SNAPSHOT to the id, when publishing a snapshot.
Diffstat (limited to 'stage2/Lib.scala')
-rw-r--r-- | stage2/Lib.scala | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/stage2/Lib.scala b/stage2/Lib.scala index dbd6108..cebdb92 100644 --- a/stage2/Lib.scala +++ b/stage2/Lib.scala @@ -24,6 +24,11 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ val buildClassName = "Build" val buildBuildClassName = "BuildBuild" + def copy(cls: Class[_], context: Context) = + cls + .getConstructor(classOf[Context]) + .newInstance(context) + /** Loads Build for given Context */ def loadDynamic(context: Context, default: Context => Build = new Build(_)): Build = { context.logger.composition( context.logger.showInvocation("Build.loadDynamic",context) ) @@ -53,16 +58,16 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ } } - def srcJar(sourceFiles: Seq[File], artifactId: String, version: String, jarTarget: File): Option[File] = { + def srcJar(sourceFiles: Seq[File], artifactId: String, scalaMajorVersion: String, version: String, jarTarget: File): Option[File] = { lib.jarFile( - jarTarget ++ ("/"++artifactId++"-"++version++"-sources.jar"), + jarTarget ++ ("/"++artifactId++"_"++scalaMajorVersion++"-"++version++"-sources.jar"), sourceFiles ) } - def jar(artifactId: String, version: String, compileTarget: File, jarTarget: File): Option[File] = { + def jar(artifactId: String, scalaMajorVersion: String, version: String, compileTarget: File, jarTarget: File): Option[File] = { lib.jarFile( - jarTarget ++ ("/"++artifactId++"-"++version++".jar"), + jarTarget ++ ("/"++artifactId++"_"++scalaMajorVersion++"-"++version++".jar"), Seq(compileTarget) ) } @@ -74,6 +79,7 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ apiTarget: File, jarTarget: File, artifactId: String, + scalaMajorVersion: String, version: String, compileArgs: Seq[String], classLoaderCache: ClassLoaderCache @@ -96,7 +102,7 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ ) } lib.jarFile( - jarTarget ++ ("/"++artifactId++"-"++version++"-javadoc.jar"), + jarTarget ++ ("/"++artifactId++"_"++scalaMajorVersion++"-"++version++"-javadoc.jar"), Vector(apiTarget) ) } |