diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-03-30 21:21:05 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-03-30 21:21:05 -0400 |
commit | 8a4578311e4d11c06bfb4fe04e5bf414b94d24e8 (patch) | |
tree | 249122a1a85ca0e86001fb6cc51e8278cf9fe2a3 /stage2/Stage2.scala | |
parent | 8abb5c3ca85abc4d206afe39a2c4a98bc17560ba (diff) | |
download | cbt-8a4578311e4d11c06bfb4fe04e5bf414b94d24e8.tar.gz cbt-8a4578311e4d11c06bfb4fe04e5bf414b94d24e8.tar.bz2 cbt-8a4578311e4d11c06bfb4fe04e5bf414b94d24e8.zip |
Typed passing of values from Stage1 to Stage2
(thing can still be cleaned up)
Diffstat (limited to 'stage2/Stage2.scala')
-rw-r--r-- | stage2/Stage2.scala | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/stage2/Stage2.scala b/stage2/Stage2.scala index 75be3c7..e893a06 100644 --- a/stage2/Stage2.scala +++ b/stage2/Stage2.scala @@ -8,26 +8,24 @@ import scala.collection.immutable.Seq import cbt.paths._ +object Stage2 extends Stage2Base{ + def run( args: Stage2Args ): Unit = { + import args.logger -object Stage2{ - def main(args: Array[String]): Unit = { - val init = new Init(args) - import init._ + val lib = new Lib(args.logger) - val lib = new Lib(init.logger) - - init.logger.stage2(s"[$now] Stage2 start") - val loop = argsV.lift(1) == Some("loop") - val direct = argsV.lift(1) == Some("direct") + logger.stage2(s"[$now] Stage2 start") + val loop = args.args.lift(0) == Some("loop") + val direct = args.args.lift(0) == Some("direct") val taskIndex = if (loop || direct) { - 2 - } else { 1 + } else { + 0 } - val task = argsV.lift( taskIndex ) + val task = args.args.lift( taskIndex ) - val context = Context( new File(argsV(0)), argsV.drop( taskIndex + 1 ), logger, new ClassLoaderCache(logger) ) + val context = Context( args.cwd, args.args.drop( taskIndex ), logger, /*args.cbtHasChanged,*/ new ClassLoaderCache(logger) ) val first = lib.loadRoot( context ) val build = first.finalBuild @@ -56,6 +54,6 @@ object Stage2{ new lib.ReflectBuild(build).callNullary(task) } - init.logger.stage2(s"[$now] Stage2 end") + logger.stage2(s"[$now] Stage2 end") } } |