aboutsummaryrefslogtreecommitdiff
path: root/stage2/BuildBuild.scala
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2016-04-06 22:16:46 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2016-04-06 22:51:51 -0400
commita63b6d3ea52d0badb07c2c003f98e77bee7cbdda (patch)
tree517b43916adfc3a0e4ac6a1f52176b135d052d43 /stage2/BuildBuild.scala
parent0195249ebf44bf0f797a976d884350f963982ec1 (diff)
downloadcbt-a63b6d3ea52d0badb07c2c003f98e77bee7cbdda.tar.gz
cbt-a63b6d3ea52d0badb07c2c003f98e77bee7cbdda.tar.bz2
cbt-a63b6d3ea52d0badb07c2c003f98e77bee7cbdda.zip
Correctly interact with build in cwd instead of loading it's managed build in case of a BuildBuild.
Diffstat (limited to 'stage2/BuildBuild.scala')
-rw-r--r--stage2/BuildBuild.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/stage2/BuildBuild.scala b/stage2/BuildBuild.scala
index 813b44b..6435bcd 100644
--- a/stage2/BuildBuild.scala
+++ b/stage2/BuildBuild.scala
@@ -6,11 +6,11 @@ class BuildBuild(context: Context) extends Build(context){
override def dependencies = Seq( CbtDependency()(context.logger) ) ++ super.dependencies
def managedBuildDirectory: File = lib.realpath( projectDirectory.parent )
val managedBuild = try{
- val managedContext = context.copy( cwd = managedBuildDirectory )
val cl = new cbt.URLClassLoader(
exportedClasspath,
classOf[BuildBuild].getClassLoader // FIXME: this looks wrong. Should be ClassLoader.getSystemClassLoader but that crashes
)
+ val managedContext = context.copy( projectDirectory = managedBuildDirectory )
cl
.loadClass(lib.buildClassName)
.getConstructor(classOf[Context])
@@ -18,10 +18,10 @@ class BuildBuild(context: Context) extends Build(context){
.asInstanceOf[Build]
} catch {
case e: ClassNotFoundException if e.getMessage == lib.buildClassName =>
- throw new Exception("You need to remove the directory or define a class Build in: "+context.cwd)
+ throw new Exception("You need to remove the directory or define a class Build in: "+context.projectDirectory)
case e: Exception =>
- throw new Exception("during build: "+context.cwd, e)
+ throw new Exception("during build: "+context.projectDirectory, e)
}
override def triggerLoopFiles = super.triggerLoopFiles ++ managedBuild.triggerLoopFiles
- override def finalBuild = managedBuild.finalBuild
+ override def finalBuild = if( context.projectDirectory == context.cwd ) this else managedBuild.finalBuild
}