diff options
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() + ) + ) +} |