aboutsummaryrefslogtreecommitdiff
path: root/stage2/Lib.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/Lib.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/Lib.scala')
-rw-r--r--stage2/Lib.scala18
1 files changed, 9 insertions, 9 deletions
diff --git a/stage2/Lib.scala b/stage2/Lib.scala
index 6b6263c..dbd6108 100644
--- a/stage2/Lib.scala
+++ b/stage2/Lib.scala
@@ -34,19 +34,19 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{
This can either the Build itself, of if exists a BuildBuild or a BuildBuild for a BuildBuild and so on.
*/
def loadRoot(context: Context, default: Context => Build = new Build(_)): Build = {
- context.logger.composition( context.logger.showInvocation("Build.loadRoot",context) )
- def findStartDir(cwd: File): File = {
- val buildDir = realpath( cwd ++ "/build" )
- if(buildDir.exists) findStartDir(buildDir) else cwd
+ context.logger.composition( context.logger.showInvocation("Build.loadRoot",context.projectDirectory) )
+ def findStartDir(projectDirectory: File): File = {
+ val buildDir = realpath( projectDirectory ++ "/build" )
+ if(buildDir.exists) findStartDir(buildDir) else projectDirectory
}
- val start = findStartDir(context.cwd)
+ val start = findStartDir(context.projectDirectory)
- val useBasicBuildBuild = context.cwd == start
+ val useBasicBuildBuild = context.projectDirectory == start
val rootBuildClassName = if( useBasicBuildBuild ) buildBuildClassName else buildClassName
try{
- if(useBasicBuildBuild) default( context ) else new cbt.BuildBuild( context.copy( cwd = start ) )
+ if(useBasicBuildBuild) default( context ) else new cbt.BuildBuild( context.copy( projectDirectory = start ) )
} catch {
case e:ClassNotFoundException if e.getMessage == rootBuildClassName =>
throw new Exception(s"no class $rootBuildClassName found in " ++ start.string)
@@ -110,7 +110,7 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{
logger.lib(s"invoke testDefault( $context )")
val exitCode: ExitCode = loadDynamic(
- context.copy( cwd = context.cwd ++ "/test", args = loggerArg.toVector ++ context.args ),
+ context.copy( projectDirectory = context.projectDirectory ++ "/test", args = loggerArg.toVector ++ context.args ),
new Build(_) with mixins.Test
).run
logger.lib(s"return testDefault( $context )")
@@ -145,7 +145,7 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{
(
(
if( thisTasks.nonEmpty ){
- s"""Methods provided by Build ${context.cwd}
+ s"""Methods provided by Build ${context.projectDirectory}
${thisTasks.mkString(" ")}