diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2017-03-20 22:09:38 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2017-03-27 19:56:13 -0400 |
commit | bba2abe7ee38b8903822a07578c46466923d13ed (patch) | |
tree | a357fb8def6f58a9ea9a37411f3f5640dcb525fe /stage2/BasicBuild.scala | |
parent | d2f8cade709b7d55a93e18592b6e38247d648ca9 (diff) | |
download | cbt-bba2abe7ee38b8903822a07578c46466923d13ed.tar.gz cbt-bba2abe7ee38b8903822a07578c46466923d13ed.tar.bz2 cbt-bba2abe7ee38b8903822a07578c46466923d13ed.zip |
start modularizing cbt into libraries
this extracts certain parts of cbt into stand-alone libraries, which can
be published to maven and used outside of cbt.
This also adds scalariform for these parts of the code.
This slows down cbt’s own build a lot because of the number of projects
involved! So we’ll follow this by a bunch of performance tweak commits.
Diffstat (limited to 'stage2/BasicBuild.scala')
-rw-r--r-- | stage2/BasicBuild.scala | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/stage2/BasicBuild.scala b/stage2/BasicBuild.scala index 4158040..ebb6a40 100644 --- a/stage2/BasicBuild.scala +++ b/stage2/BasicBuild.scala @@ -13,12 +13,7 @@ trait BaseBuild extends BuildInterface with DependencyImplementation with SbtDep def moduleKey: String = "BaseBuild("+target.string+")" implicit def transientCache: java.util.Map[AnyRef,AnyRef] = context.transientCache - object libraries{ - private def dep(name: String) = DirectoryDependency( context.cbtHome / "libraries" / name ) - def captureArgs = dep( "capture_args" ) - def eval = dep( "eval" ) - def proguard = dep( "proguard" ) - } + implicit def libraries(implicit context: Context): libraries = new libraries(context) // library available to builds implicit protected final val logger: Logger = context.logger @@ -211,7 +206,8 @@ trait BaseBuild extends BuildInterface with DependencyImplementation with SbtDep ) } - def run: ExitCode = run( context.args: _* ) + def run: ExitCode = runMain( context.args ) + def test: Dependency = { val testDirectory = projectDirectory / "test" if( (testDirectory / lib.buildDirectoryName / lib.buildFileName).exists ){ @@ -225,6 +221,7 @@ trait BaseBuild extends BuildInterface with DependencyImplementation with SbtDep } } } + def t: Any = lib.callReflective( test, Some("run"), context ) def rt = recursiveUnsafe(Some("test.run")) |