aboutsummaryrefslogtreecommitdiff
path: root/stage2
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2017-02-12 19:31:47 -0500
committerChristopher Vogt <oss.nsp@cvogt.org>2017-02-13 08:56:45 -0500
commitdd3ebe49c9d7dfc1c0a087c8e2a2679e466b5908 (patch)
treeab56ced74d28cd6ae954d24af70c1a05445c8eee /stage2
parent2cc6249da16a6b0ab8a7d7620ebd9738c9b366c5 (diff)
downloadcbt-dd3ebe49c9d7dfc1c0a087c8e2a2679e466b5908.tar.gz
cbt-dd3ebe49c9d7dfc1c0a087c8e2a2679e466b5908.tar.bz2
cbt-dd3ebe49c9d7dfc1c0a087c8e2a2679e466b5908.zip
make sure jar, tests and main classes use the right directories
Diffstat (limited to 'stage2')
-rw-r--r--stage2/BasicBuild.scala9
-rw-r--r--stage2/Lib.scala4
-rw-r--r--stage2/PackageJars.scala2
3 files changed, 8 insertions, 7 deletions
diff --git a/stage2/BasicBuild.scala b/stage2/BasicBuild.scala
index 9db4632..ed03de2 100644
--- a/stage2/BasicBuild.scala
+++ b/stage2/BasicBuild.scala
@@ -129,7 +129,10 @@ trait BaseBuild extends BuildInterface with DependencyImplementation with Trigge
val resourcesDirectory = projectDirectory ++ "/resources"
ClassPath( if(resourcesDirectory.exists) Seq(resourcesDirectory) else Nil )
}
- def exportedClasspath : ClassPath = ClassPath(compileFile.toSeq) ++ resourceClasspath
+ def exportedClasspath : ClassPath = {
+ compile
+ ClassPath(Seq(compileTarget).filter(_.exists)) ++ resourceClasspath
+ }
def targetClasspath = ClassPath(Seq(compileTarget))
// ========== compile, run, test ==========
@@ -142,8 +145,6 @@ trait BaseBuild extends BuildInterface with DependencyImplementation with Trigge
final def lastModified: Long = compile.getOrElse(0L)
- final def compileFile: Option[File] = compile.map(_ => compileTarget)
-
def compile: Option[Long] = taskCache[BaseBuild]("_compile").memoize{
lib.compile(
context.cbtLastModified,
@@ -153,7 +154,7 @@ trait BaseBuild extends BuildInterface with DependencyImplementation with Trigge
)
}
- def mainClasses: Seq[Class[_]] = compileFile.toSeq.flatMap( lib.mainClasses( _, classLoader(classLoaderCache) ) )
+ def mainClasses: Seq[Class[_]] = exportedClasspath.files.flatMap( lib.mainClasses( _, classLoader(classLoaderCache) ) )
def runClass: Option[String] = lib.runClass( mainClasses ).map( _.getName )
diff --git a/stage2/Lib.scala b/stage2/Lib.scala
index 45803b4..47e1635 100644
--- a/stage2/Lib.scala
+++ b/stage2/Lib.scala
@@ -66,10 +66,10 @@ final class Lib(val logger: Logger) extends Stage1Lib(logger) with Scaffold{
)
}
- def jar(artifactId: String, scalaMajorVersion: String, version: String, compileTarget: File, jarTarget: File): Option[File] = {
+ def jar(artifactId: String, scalaMajorVersion: String, version: String, files: Seq[File], jarTarget: File): Option[File] = {
lib.jarFile(
jarTarget ++ ("/"++artifactId++"_"++scalaMajorVersion++"-"++version++".jar"),
- Seq(compileTarget)
+ files
)
}
diff --git a/stage2/PackageJars.scala b/stage2/PackageJars.scala
index 7079786..fddbfc6 100644
--- a/stage2/PackageJars.scala
+++ b/stage2/PackageJars.scala
@@ -11,7 +11,7 @@ trait PackageJars extends BaseBuild with ArtifactInfo{
)( _() ).flatten
def jar: Option[File] = taskCache[PackageJars]("jar").memoize{
- compileFile.flatMap( lib.jar( artifactId, scalaMajorVersion, version, _, jarTarget ) )
+ lib.jar( artifactId, scalaMajorVersion, version, exportedClasspath.files, jarTarget )
}
def srcJar: Option[File] = taskCache[PackageJars]("srcJar").memoize{