diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2017-02-18 01:09:36 +0000 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2017-02-18 01:09:36 +0000 |
commit | 3c135b40c2d2aac017ac12edc6924e3c369296fd (patch) | |
tree | 4d8812320f75339d398679da0221fb31e77e523c /stage2/BuildBuild.scala | |
parent | 632f3d0340f66977fd59bb8d0a601a430dd3d0f5 (diff) | |
download | cbt-3c135b40c2d2aac017ac12edc6924e3c369296fd.tar.gz cbt-3c135b40c2d2aac017ac12edc6924e3c369296fd.tar.bz2 cbt-3c135b40c2d2aac017ac12edc6924e3c369296fd.zip |
allow DirectoryDependencies on BuildBuilds
this fixes a bug where finalBuild would over eagerly go down all the way
down to the outermost build instead of stopping at the one requested.
Now it checks the new argument and stops there.
This is necessary to allow having one build depend on another build in
order to embed it in a type-safe way and have access to it’s tasks.
Diffstat (limited to 'stage2/BuildBuild.scala')
-rw-r--r-- | stage2/BuildBuild.scala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/stage2/BuildBuild.scala b/stage2/BuildBuild.scala index 2eebcbc..9ac631f 100644 --- a/stage2/BuildBuild.scala +++ b/stage2/BuildBuild.scala @@ -1,5 +1,6 @@ package cbt import java.nio.file._ +import java.io.File trait BuildBuild extends BuildBuildWithoutEssentials{ override def dependencies = @@ -97,5 +98,11 @@ trait BuildBuildWithoutEssentials extends BaseBuild{ } } override def triggerLoopFiles = super.triggerLoopFiles ++ managedBuild.triggerLoopFiles - override def finalBuild: BuildInterface = if( projectDirectory == context.cwd ) this else managedBuild.finalBuild + @deprecated("use finalbuild(File)","") + override def finalBuild: BuildInterface = finalBuild( context.cwd ) + override def finalBuild( current: File ): BuildInterface = { + val p = projectDirectory.getCanonicalFile + val c = current.getCanonicalFile + if( c == p ) this else managedBuild.finalBuild( current ) + } } |