From 3c135b40c2d2aac017ac12edc6924e3c369296fd Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Sat, 18 Feb 2017 01:09:36 +0000 Subject: allow DirectoryDependencies on BuildBuilds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- stage2/BuildBuild.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'stage2/BuildBuild.scala') 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 ) + } } -- cgit v1.2.3