@@ -6,48 +6,11 @@ import scalafix.util._
66import scalafix .util .TreePatch ._
77import scalafix .util .TokenPatch ._
88
9-
10- /*
11- object DayDreaming {
12- val imaginaryBaseBuild = BaseBuild(
13- context = Context,
14- defaultScalaVersion = "2.12.1"
15- )
16- .map(addPlugin(Scalameta))
17- .map(addPlugin(Scalatest)) //I would expect to normally use the default test directory config
18- .map(addPlugin(CrossBuild))
19- .map(addPlugin(CrossRewriter))
20- .map { build => //I would expect that here I would have Build with MetaBuild with ScalaTestBuild with CrossBuild with CrossRewriter
21- build.copy(
22- crossBuilds = Seq( //This would be a sequence of build transforms. If I had many I would create a function to build a matrix of transforms
23- setVersion("2.11.8") andThen
24- addDependency(MavenDependency("org.scalaz", "scalaz-core", "7.2.10")) andThen
25- transformSources( //transformSources would be in CrossRewriter plugin and would apply rewrites to all sources
26- AddGlobalImport(importer"scalaz._"),
27- Replace(Symbol("_root_.scala.package.Either."), q"\/"),
28- Replace(Symbol("_root_.scala.util.Right."), q"\/-"),
29- RemoveGlobalImport(importer"cats.implicits._")
30- ),
31- setVersion("2.11.8") andThen
32- addDependency(MavenDependency("org.typelevel", "cats", "0.9.0")) andThen
33- transformSources(AddGlobalImport(importer"cats.implicits._"))
34- )
35- )
36- }
37-
38- def setVersion(version: String): Build => Build = _.copy(scalaVersion = version)
39- def addDependency(dep: MavenDependency): Build => Build = _.copy(dependencies = dependencies :+ dep)
40- def removeDependency(dep: MavenDependency): Build => Build = _.copy(dependencies = dependencies :- dep)
41-
42- //Over time I would hope to build up a community libraryof rewrites so many of the transforms would be pulled from
43- //a library instead of declared in the build
44- }
45- */
469class Build (val context : Context ) extends BaseBuild with Scalameta { defaultMainBuild =>
4710 override def defaultScalaVersion : String = " 2.12.1"
4811
4912 override def test : BasicBuild = {
50- new BasicBuild (context) with ScalaTest {
13+ new BasicBuild (context) with ScalaTest with Scalameta {
5114 override def dependencies = defaultMainBuild +: super .dependencies
5215 override def defaultScalaVersion = defaultMainBuild.scalaVersion
5316 override def projectDirectory = {
@@ -58,11 +21,6 @@ class Build(val context: Context) extends BaseBuild with Scalameta { defaultMain
5821 }
5922 }
6023
61- // case class CrossRewrite(name: String, patches: Seq[Patch], scalaVersion: Option[ScalaVersion], lib: Option[String])
62- //
63- // case class AddDependency(dep: MavenDependency)
64- // case class RemoveDependency(dep: MavenDependency)
65-
6624 def versions = Seq [(String , Seq [Patch ])](
6725 " 2.12.1" -> Seq (),
6826 " 2.11.8" -> Seq (
0 commit comments