diff options
author | ChavXO <mchavinda@colgate.edu> | 2016-08-14 21:25:20 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-09-29 17:35:38 -0400 |
commit | de16fc43f39b86679135aec2ae33e498100ca457 (patch) | |
tree | c44d84beeb8ba856bda185fb1ca1dd797487000e /stage2 | |
parent | 8515ca06ae5ae2501467f5af91bec2f5a80251c1 (diff) | |
download | cbt-de16fc43f39b86679135aec2ae33e498100ca457.tar.gz cbt-de16fc43f39b86679135aec2ae33e498100ca457.tar.bz2 cbt-de16fc43f39b86679135aec2ae33e498100ca457.zip |
Added run with package discovery
Diffstat (limited to 'stage2')
-rw-r--r-- | stage2/BasicBuild.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/stage2/BasicBuild.scala b/stage2/BasicBuild.scala index bcc3646..baa6d26 100644 --- a/stage2/BasicBuild.scala +++ b/stage2/BasicBuild.scala @@ -136,7 +136,12 @@ trait BaseBuild extends DependencyImplementation with BuildInterface with Trigge ) } - def runClass: String = "Main" + def runClass: String = lib.mainClasses ( compileTarget, classLoader(context.classLoaderCache) ) match { + case f if f.length == 1 => f.head + case f if f.length > 2 => System.err.println( " Multiple main classes defined in project." ); "None" + case _ => "Main" + } + def run: ExitCode = lib.runMainIfFound( runClass, context.args, classLoader(context.classLoaderCache) ) def clean = { |