aboutsummaryrefslogtreecommitdiff
path: root/stage2/BasicBuild.scala
diff options
context:
space:
mode:
authorJan Christopher Vogt <oss.nsp@cvogt.org>2016-06-19 16:31:47 -0400
committerGitHub <noreply@github.com>2016-06-19 16:31:47 -0400
commitbb856040475cc15fe0754a52428375bd36f8b782 (patch)
tree3fe563f8596b49a136e12dfd693f7b21c0afc90d /stage2/BasicBuild.scala
parent9596983505f1e0d2e4c582e1c23f04e35b42fde1 (diff)
parent32691b7908150970344a5c3a5c58fef9dec0a6ac (diff)
downloadcbt-bb856040475cc15fe0754a52428375bd36f8b782.tar.gz
cbt-bb856040475cc15fe0754a52428375bd36f8b782.tar.bz2
cbt-bb856040475cc15fe0754a52428375bd36f8b782.zip
Merge pull request #150 from cvogt/chris2
various changes
Diffstat (limited to 'stage2/BasicBuild.scala')
-rw-r--r--stage2/BasicBuild.scala30
1 files changed, 12 insertions, 18 deletions
diff --git a/stage2/BasicBuild.scala b/stage2/BasicBuild.scala
index 4be0e58..42384db 100644
--- a/stage2/BasicBuild.scala
+++ b/stage2/BasicBuild.scala
@@ -9,17 +9,6 @@ import java.util.jar._
import scala.util._
-trait Recommended extends BaseBuild{
- override def scalacOptions = super.scalacOptions ++ Seq(
- "-feature",
- "-deprecation",
- "-unchecked",
- "-language:postfixOps",
- "-language:implicitConversions",
- "-language:higherKinds",
- "-language:existentials"
- )
-}
class BasicBuild(val context: Context) extends BaseBuild
trait BaseBuild extends DependencyImplementation with BuildInterface with TriggerLoop with SbtDependencyDsl{
def context: Context
@@ -98,7 +87,7 @@ trait BaseBuild extends DependencyImplementation with BuildInterface with Trigge
scalaVersion: String = scalaMajorVersion
) = lib.ScalaDependency( groupId, artifactId, version, classifier, scalaVersion )
- final def BuildDependency(path: File) = cbt.BuildDependency(
+ final def DirectoryDependency(path: File) = cbt.DirectoryDependency(
context.copy( projectDirectory = path, args = Seq() )
)
@@ -120,7 +109,11 @@ trait BaseBuild extends DependencyImplementation with BuildInterface with Trigge
// ========== compile, run, test ==========
/** scalac options used for zinc and scaladoc */
- def scalacOptions: Seq[String] = Seq()
+ def scalacOptions: Seq[String] = Seq(
+ "-feature",
+ "-deprecation",
+ "-unchecked"
+ )
private object needsUpdateCache extends Cache[Boolean]
def needsUpdate: Boolean = needsUpdateCache(
@@ -143,9 +136,12 @@ trait BaseBuild extends DependencyImplementation with BuildInterface with Trigge
def runClass: String = "Main"
def run: ExitCode = lib.runMainIfFound( runClass, context.args, classLoader(context.classLoaderCache) )
- def test: Option[ExitCode] = {
- lib.test(context)
- }
+ def test: Option[ExitCode] =
+ Some(new lib.ReflectBuild(
+ DirectoryDependency(projectDirectory++"/test").build
+ ).callNullary(Some("run")))
+ def t = test
+ def rt = recursiveUnsafe(Some("test"))
def recursiveSafe(_run: BuildInterface => Any): ExitCode = {
val builds = (this +: transitiveDependencies).collect{
@@ -192,9 +188,7 @@ trait BaseBuild extends DependencyImplementation with BuildInterface with Trigge
}
def c = compile
- def t = test
def r = run
- def rt = recursiveUnsafe(Some("test"))
/*
context.logger.composition(">"*80)