aboutsummaryrefslogtreecommitdiff
path: root/stage2/BuildBuild.scala
blob: 71a229c351767732695d5b1d33d80f586737e257 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package cbt
import java.nio.file._
import java.io.File

class ConcreteBuildBuild(val context: Context) extends BuildBuild
class plugins(implicit context: Context){
  // TODO: move this out of the OO
  private def plugin(dir: String) = cbt.DirectoryDependency(context.cbtHome / "plugins" / dir)
  final lazy val googleJavaFormat = plugin( "google-java-format" )
  final lazy val proguard = plugin( "proguard" )
  final lazy val sbtLayout = plugin( "sbt_layout" )
  final lazy val scalafmt = plugin( "scalafmt" )
  final lazy val scalaJs   = plugin( "scalajs" )
  final lazy val scalariform = plugin( "scalariform" )
  final lazy val scalaTest = plugin( "scalatest" )
  final lazy val sonatypeRelease = plugin( "sonatype-release" )
  final lazy val uberJar = plugin( "uber-jar" )
  final lazy val wartremover = plugin( "wartremover" )
  final lazy val scalafix = plugin( "scalafix" )
}

trait BuildBuild extends BaseBuild{
  override def dependencies = super.dependencies :+ context.cbtDependency

  object plugins extends plugins

  assert(
    projectDirectory.getName === lib.buildDirectoryName,
    s"You can't extend ${lib.buildBuildClassName} in: " + projectDirectory + "/" + lib.buildDirectoryName
  )
}

trait CbtInternal extends BuildBuild{
  protected object cbtInternal{
    def shared = DirectoryDependency(context.cbtHome / "/internal/plugins/shared")
    def library = DirectoryDependency(context.cbtHome / "/internal/plugins/library")
  }
}