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 /plugins | |
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 'plugins')
-rw-r--r-- | plugins/essentials/CommandLineOverrides.scala | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/essentials/CommandLineOverrides.scala b/plugins/essentials/CommandLineOverrides.scala index 32b8403..ce68aa9 100644 --- a/plugins/essentials/CommandLineOverrides.scala +++ b/plugins/essentials/CommandLineOverrides.scala @@ -1,25 +1,25 @@ package cbt trait CommandLineOverrides extends DynamicOverrides{ def `with`: Any = { - new lib.ReflectObject( + lib.callReflective( newBuild[DynamicOverrides]( context.copy( args = context.args.drop(2) ) )( s""" ${context.args.lift(0).getOrElse("")} - """ ) - ){ - def usage = "" - }.callNullary(context.args.lift(1) orElse Some("void")) + """ ), + context.args.lift(1) orElse Some("void") + ) } def eval = { - new lib.ReflectObject( + lib.callReflective( newBuild[CommandLineOverrides]( context.copy( args = ( context.args.lift(0).map("println{ "+_+" }") ).toSeq ) - ){""} - ){def usage = ""}.callNullary(Some("with")) + ){""}, + Some("with") + ) } } |