diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2017-02-18 00:59:36 +0000 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2017-02-18 00:59:36 +0000 |
commit | 632f3d0340f66977fd59bb8d0a601a430dd3d0f5 (patch) | |
tree | 8d36a536f0a28fb31534e6fab514fcd4d50054cf /stage2/BasicBuild.scala | |
parent | 86552d373be1b2fbf3e11d1ed223ebc4bdb6b280 (diff) | |
download | cbt-632f3d0340f66977fd59bb8d0a601a430dd3d0f5.tar.gz cbt-632f3d0340f66977fd59bb8d0a601a430dd3d0f5.tar.bz2 cbt-632f3d0340f66977fd59bb8d0a601a430dd3d0f5.zip |
simplify and add features to reflective task lookup code
Code is much simpler now.
Now cbt sub-tasks are separated by . instead of spaces to
unify the syntax with method calls Scala. Also the reflective
code now works not only on builds but any kind of values,
so zero argument members of any types of return values can
simply be called.
This is also a large step towards detangling the reflective
lookup from cbt and turning it into a fully fletched
shell to Scala "native" call solution.
Diffstat (limited to 'stage2/BasicBuild.scala')
-rw-r--r-- | stage2/BasicBuild.scala | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/stage2/BasicBuild.scala b/stage2/BasicBuild.scala index f32d4d9..4ca39a7 100644 --- a/stage2/BasicBuild.scala +++ b/stage2/BasicBuild.scala @@ -186,9 +186,10 @@ trait BaseBuild extends BuildInterface with DependencyImplementation with Trigge def run: ExitCode = run( context.args: _* ) def test: Any = - Some(new lib.ReflectBuild( - DirectoryDependency(projectDirectory++"/test").build - ).callNullary(Some("run"))) + lib.callReflective( + DirectoryDependency(projectDirectory++"/test").build, + Some("run") + ) def t = test def rt = recursiveUnsafe(Some("test")) @@ -221,13 +222,13 @@ trait BaseBuild extends BuildInterface with DependencyImplementation with Trigge recursiveUnsafe(context.args.lift(1)) } - def recursiveUnsafe(taskName: Option[String]): ExitCode = { + def recursiveUnsafe(code: Option[String]): ExitCode = { recursiveSafe{ b => System.err.println(b.show) lib.trapExitCode{ // FIXME: trapExitCode does not seem to work here try{ - new lib.ReflectBuild(b).callNullary(taskName) + lib.callReflective(b,code) ExitCode.Success } catch { case e: Throwable => println(e.getClass); throw e |