aboutsummaryrefslogtreecommitdiff
path: root/stage2
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2017-04-02 00:18:37 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2017-04-02 00:25:43 -0400
commit56c49924f4016b922801d0ab28c787240044e886 (patch)
tree0de314955ec3be08801be7ee87aae96b8bc87145 /stage2
parent5553c92eec89fa06c6eaa61645b2c9cb8332f404 (diff)
downloadcbt-56c49924f4016b922801d0ab28c787240044e886.tar.gz
cbt-56c49924f4016b922801d0ab28c787240044e886.tar.bz2
cbt-56c49924f4016b922801d0ab28c787240044e886.zip
propagate scala versions into aliased dependencies
not necessary for plugins yet, but will be when we allow choosing your scala version for build files
Diffstat (limited to 'stage2')
-rw-r--r--stage2/BasicBuild.scala4
-rw-r--r--stage2/BuildBuild.scala2
-rw-r--r--stage2/Plugin.scala2
-rw-r--r--stage2/libraries.scala2
-rw-r--r--stage2/plugins.scala11
-rw-r--r--stage2/ports.scala7
6 files changed, 18 insertions, 10 deletions
diff --git a/stage2/BasicBuild.scala b/stage2/BasicBuild.scala
index 02c3057..05e3c41 100644
--- a/stage2/BasicBuild.scala
+++ b/stage2/BasicBuild.scala
@@ -20,8 +20,8 @@ trait BaseBuild extends BuildInterface with DependencyImplementation with SbtDep
override lazy val moduleKey: String = "BaseBuild("+target.string+")"
implicit def transientCache: java.util.Map[AnyRef,AnyRef] = context.transientCache
- object libraries extends libraries( context, scalaVersion )
- object ports extends ports(context)
+ object libraries extends libraries( context, scalaVersion, scalaMajorVersion )
+ object ports extends ports( context, scalaVersion )
// library available to builds
implicit protected final val logger: Logger = context.logger
diff --git a/stage2/BuildBuild.scala b/stage2/BuildBuild.scala
index cc69905..8430f49 100644
--- a/stage2/BuildBuild.scala
+++ b/stage2/BuildBuild.scala
@@ -7,7 +7,7 @@ class ConcreteBuildBuild(val context: Context) extends BuildBuild
trait BuildBuild extends BaseBuild{
override def dependencies = super.dependencies :+ context.cbtDependency
- object plugins extends plugins
+ object plugins extends plugins( context, scalaVersion )
assert(
projectDirectory.getName === lib.buildDirectoryName,
diff --git a/stage2/Plugin.scala b/stage2/Plugin.scala
index 43e26fa..2cc242d 100644
--- a/stage2/Plugin.scala
+++ b/stage2/Plugin.scala
@@ -1,5 +1,5 @@
package cbt
trait Plugin extends BaseBuild{
override def dependencies = super.dependencies :+ context.cbtDependency
- object plugins extends plugins
+ object plugins extends plugins( context, scalaVersion )
}
diff --git a/stage2/libraries.scala b/stage2/libraries.scala
index f0e4ecc..ebc748d 100644
--- a/stage2/libraries.scala
+++ b/stage2/libraries.scala
@@ -1,5 +1,5 @@
package cbt
-class libraries( context: Context, scalaVersion: String ) {
+class libraries( context: Context, scalaVersion: String, scalaMajorVersion: String ) {
private def dep( name: String ) = DirectoryDependency(
context.copy(
scalaVersion = Some( scalaVersion ),
diff --git a/stage2/plugins.scala b/stage2/plugins.scala
index 6c5ee29..ec01d86 100644
--- a/stage2/plugins.scala
+++ b/stage2/plugins.scala
@@ -1,7 +1,12 @@
package cbt
-class plugins( implicit context: Context ) {
- // TODO: move this out of the OO
- private def plugin( dir: String ) = DirectoryDependency( context.cbtHome / "plugins" / dir )
+class plugins( context: Context, scalaVersion: String ) {
+ private def plugin( name: String ) = DirectoryDependency(
+ context.copy(
+ scalaVersion = Some( scalaVersion ),
+ workingDirectory = context.cbtHome / "plugins" / name
+ ),
+ None
+ )
final lazy val googleJavaFormat = plugin( "google-java-format" )
final lazy val proguard = plugin( "proguard" )
final lazy val sbtLayout = plugin( "sbt_layout" )
diff --git a/stage2/ports.scala b/stage2/ports.scala
index 51ae4f0..e7e3863 100644
--- a/stage2/ports.scala
+++ b/stage2/ports.scala
@@ -1,7 +1,10 @@
package cbt
-class ports( context: Context ) {
+class ports( context: Context, scalaVersion: String ) {
private def dep( name: String ) = DirectoryDependency(
- context.copy( workingDirectory = context.cbtHome / "ports" / name ),
+ context.copy(
+ scalaVersion = Some( scalaVersion ),
+ workingDirectory = context.cbtHome / "ports" / name
+ ),
None
)
def mima = dep( "migration-manager" )