diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-06-19 16:15:21 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-06-19 16:15:21 -0400 |
commit | 0f5300349539bfa9642dca7ac7800614a57f316f (patch) | |
tree | b4e281ccc3f0cc190f19bb8f256f3b228fb2f02d /stage2/plugins | |
parent | 1531ea1c1383368f8a8048a079397f08e25ecd11 (diff) | |
download | cbt-0f5300349539bfa9642dca7ac7800614a57f316f.tar.gz cbt-0f5300349539bfa9642dca7ac7800614a57f316f.tar.bz2 cbt-0f5300349539bfa9642dca7ac7800614a57f316f.zip |
built-in plugin structure improvements
- move plugins into cbt namespace
- enable scalac warnings in builds by default
- merged language flags into AdvancedScala trait
Diffstat (limited to 'stage2/plugins')
-rw-r--r-- | stage2/plugins/AdvancedFlags.scala | 10 | ||||
-rw-r--r-- | stage2/plugins/GithubPom.scala | 11 | ||||
-rw-r--r-- | stage2/plugins/ScalaParadise.scala | 29 |
3 files changed, 50 insertions, 0 deletions
diff --git a/stage2/plugins/AdvancedFlags.scala b/stage2/plugins/AdvancedFlags.scala new file mode 100644 index 0000000..4ff701d --- /dev/null +++ b/stage2/plugins/AdvancedFlags.scala @@ -0,0 +1,10 @@ +package cbt +trait AdvancedScala extends BaseBuild{ + override def scalacOptions = super.scalacOptions ++ Seq( + "-language:postfixOps", + "-language:implicitConversions", + "-language:higherKinds", + "-language:existentials", + "-language:experimental.macros" + ) +} diff --git a/stage2/plugins/GithubPom.scala b/stage2/plugins/GithubPom.scala new file mode 100644 index 0000000..8b11385 --- /dev/null +++ b/stage2/plugins/GithubPom.scala @@ -0,0 +1,11 @@ +package cbt +import java.net.URL +trait GithubPom extends Publish{ + def user: String + def githubProject = name + def githubUser = user + final def githubUserProject = githubUser ++ "/" ++ githubProject + override def url = new URL(s"http://github.com/$githubUserProject") + override def scmUrl = s"git@github.com:$githubUserProject.git" + override def scmConnection = s"scm:git:$scmUrl" +} diff --git a/stage2/plugins/ScalaParadise.scala b/stage2/plugins/ScalaParadise.scala new file mode 100644 index 0000000..28ee934 --- /dev/null +++ b/stage2/plugins/ScalaParadise.scala @@ -0,0 +1,29 @@ +package cbt +trait ScalaParadise extends BaseBuild{ + def scalaParadiseVersion = "2.1.0" + + private def scalaParadiseDependency = + Resolver( mavenCentral ).bindOne( + "org.scalamacros" % ("paradise_" ++ scalaVersion) % scalaParadiseVersion + ) + + override def dependencies = ( + super.dependencies // don't forget super.dependencies here + ++ ( + if(scalaVersion.startsWith("2.10.")) + Seq(scalaParadiseDependency) + else + Seq() + ) + ) + + override def scalacOptions = ( + super.scalacOptions + ++ ( + if(scalaVersion.startsWith("2.10.")) + Seq("-Xplugin:"++scalaParadiseDependency.jar.string) + else + Seq() + ) + ) +} |