diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-11-10 01:40:14 -0500 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2017-02-13 10:10:02 -0500 |
commit | 8ebada86b1fc58465751864acba8aafd387ccb4b (patch) | |
tree | 3c0cf15a408350511652dd0f0872a8eba6de7a9e /stage2/Lib.scala | |
parent | 0a295c21d3379117e661fdbf586ecb6222c3602b (diff) | |
download | cbt-8ebada86b1fc58465751864acba8aafd387ccb4b.tar.gz cbt-8ebada86b1fc58465751864acba8aafd387ccb4b.tar.bz2 cbt-8ebada86b1fc58465751864acba8aafd387ccb4b.zip |
Add support for nested builds and use it to replace cross compilation
command which was previously hard-coded
This will allow multi-project builds, too but we should first fix
caching across instances and GitDependencies on sub-builds within
other repositories.
Diffstat (limited to 'stage2/Lib.scala')
-rw-r--r-- | stage2/Lib.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/stage2/Lib.scala b/stage2/Lib.scala index 47e1635..dfb7ef3 100644 --- a/stage2/Lib.scala +++ b/stage2/Lib.scala @@ -181,6 +181,20 @@ final class Lib(val logger: Logger) extends Stage1Lib(logger) with Scaffold{ case code if code.getClass.getSimpleName == "ExitCode" => // FIXME: ExitCode needs to be part of the compatibility interfaces ExitCode(Stage0Lib.get(code,"integer").asInstanceOf[Int]) + case Seq(b:BaseBuild) => + val context = b.context.copy(args=b.context.args.drop(1)) + val task = b.context.args.lift(0) + new ReflectBuild( b.copy(context=context) ).callNullary( task ) + case Seq(b: BaseBuild, bs @ _*) if bs.forall(_.isInstanceOf[BaseBuild]) => + (b +: bs) + .map( _.asInstanceOf[BaseBuild] ) + .map{ b => + val task = b.context.args.lift(0) + new ReflectBuild( + b.copy( context = b.context.copy(args=b.context.args.drop(1)) ) + ).callNullary( task ) + } + .head case other => println( other.toString ) // no method .toConsole, using to String ExitCode.Success |