aboutsummaryrefslogblamecommitdiff
path: root/stage2/SbtDependencyDsl.scala
blob: 05cb709359687401aa37cf9ce83f9123860bca5a (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
           
                                          











                                                                                                       
 
package cbt
trait SbtDependencyDsl{ self: BaseBuild =>
  /** SBT-like dependency builder DSL for syntax compatibility */
  class DependencyBuilder2( groupId: String, artifactId: String, scalaVersion: Option[String] ){
    def %(version: String) = scalaVersion.map(
      v => ScalaDependency(groupId, artifactId, version, scalaVersion = v)
    ).getOrElse(
      MavenDependency(groupId, artifactId, version)
    )
  }
  implicit class DependencyBuilder(groupId: String){
    def %%(artifactId: String) = new DependencyBuilder2( groupId, artifactId, Some(scalaMajorVersion) )
    def  %(artifactId: String) = new DependencyBuilder2( groupId, artifactId, None )
  }
}