aboutsummaryrefslogtreecommitdiff
path: root/stage2/BasicBuild.scala
diff options
context:
space:
mode:
authorJan Christopher Vogt <oss.nsp@cvogt.org>2017-02-13 09:15:39 -0500
committerGitHub <noreply@github.com>2017-02-13 09:15:39 -0500
commit0a295c21d3379117e661fdbf586ecb6222c3602b (patch)
treeab56ced74d28cd6ae954d24af70c1a05445c8eee /stage2/BasicBuild.scala
parentae435591ce164a8bb4c836fec446adebc7f14a4a (diff)
parentdd3ebe49c9d7dfc1c0a087c8e2a2679e466b5908 (diff)
downloadcbt-0a295c21d3379117e661fdbf586ecb6222c3602b.tar.gz
cbt-0a295c21d3379117e661fdbf586ecb6222c3602b.tar.bz2
cbt-0a295c21d3379117e661fdbf586ecb6222c3602b.zip
Merge pull request #340 from cvogt/fix-jar-packaging
make sure jar, tests and main classes use the right directories
Diffstat (limited to 'stage2/BasicBuild.scala')
-rw-r--r--stage2/BasicBuild.scala9
1 files changed, 5 insertions, 4 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 )