1
- import sbtcrossproject .{crossProject , CrossType }
2
1
import ScalaModulePlugin ._
2
+ import sbtcrossproject .{crossProject , CrossType }
3
+ import _root_ .scalafix .Versions .{version => scalafixVersion , scala212 => scalafixScala212 }
4
+
5
+ lazy val scala212 = " 2.12.6"
6
+ lazy val scala213 = " 2.13.0-M4"
3
7
4
8
inThisBuild(Seq (
5
- crossScalaVersions := Seq (" 2.12.6 " , " 2.13.0-M4 " , " 2.11.12" )
9
+ crossScalaVersions := Seq (scala212, scala213 , " 2.11.12" )
6
10
))
7
11
8
- disablePlugins(JvmPlugin )
12
+ lazy val root = project
13
+ .in(file(" ." ))
14
+ .aggregate(rules, input, output, tests, compatJVM, compatJS)
15
+ .disablePlugins(ScalafixPlugin )
9
16
10
- lazy val `scala-collection- compat` = crossProject(JSPlatform , JVMPlatform )
17
+ lazy val compat = crossProject(JSPlatform , JVMPlatform )
11
18
.withoutSuffixFor(JVMPlatform )
12
19
.crossType(CrossType .Pure )
13
20
.in(file(" ." ))
14
- .settings(scalaModuleSettings)
15
- .jvmSettings(scalaModuleSettingsJVM)
16
21
.settings(
17
- name := " scala-collection-compat" ,
22
+ moduleName := " scala-collection-compat" ,
18
23
version := " 0.1-SNAPSHOT" ,
19
24
scalacOptions ++= Seq (" -feature" , " -language:higherKinds" , " -language:implicitConversions" ),
20
25
unmanagedSourceDirectories in Compile += {
21
26
val sharedSourceDir = baseDirectory.value.getParentFile / " src/main"
22
27
if (scalaVersion.value.startsWith(" 2.13." )) sharedSourceDir / " scala-2.13"
23
28
else sharedSourceDir / " scala-2.11_2.12"
24
- }
29
+ },
30
+ scalaVersion := scala212
25
31
)
32
+ .settings(scalaModuleSettings)
33
+ .jvmSettings(scalaModuleSettingsJVM)
26
34
.jvmSettings(
27
35
OsgiKeys .exportPackage := Seq (s " scala.collection.compat.*;version= ${version.value}" ),
28
36
libraryDependencies += " com.novocode" % " junit-interface" % " 0.11" % " test"
@@ -36,6 +44,56 @@ lazy val `scala-collection-compat` = crossProject(JSPlatform, JVMPlatform)
36
44
fork in Test := false // Scala.js cannot run forked tests
37
45
)
38
46
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin ))
47
+ .disablePlugins(ScalafixPlugin )
48
+
49
+ lazy val compatJVM = compat.jvm
50
+ lazy val compatJS = compat.js
51
+
52
+ lazy val rules = project
53
+ .in(file(" scalafix/rules" ))
54
+ .settings(
55
+ scalaVersion := scalafixScala212,
56
+ libraryDependencies += " ch.epfl.scala" %% " scalafix-core" % scalafixVersion
57
+ )
58
+
59
+ lazy val input = project
60
+ .in(file(" scalafix/input" ))
61
+ .settings(
62
+ scalaVersion := scalafixScala212,
63
+ scalafixSourceroot := sourceDirectory.in(Compile ).value
64
+ )
65
+
66
+ lazy val output = project
67
+ .in(file(" scalafix/output" ))
68
+ .settings(
69
+ resolvers += " scala-pr" at " https://scala-ci.typesafe.com/artifactory/scala-integration/" ,
70
+ scalaVersion := scala213
71
+ )
72
+
73
+ lazy val outputFailure = project
74
+ .in(file(" scalafix/output-failure" ))
75
+ .settings(
76
+ resolvers += " scala-pr" at " https://scala-ci.typesafe.com/artifactory/scala-integration/" ,
77
+ scalaVersion := scala213
78
+ )
39
79
40
- lazy val `scala-collection-compatJVM` = `scala-collection-compat`.jvm
41
- lazy val `scala-collection-compatJS` = `scala-collection-compat`.js
80
+ lazy val tests = project
81
+ .in(file(" scalafix/tests" ))
82
+ .settings(
83
+ scalaVersion := scalafixScala212,
84
+ libraryDependencies += " ch.epfl.scala" % " scalafix-testkit" % scalafixVersion % Test cross CrossVersion .full,
85
+ buildInfoPackage := " fix" ,
86
+ buildInfoKeys := Seq [BuildInfoKey ](
87
+ " inputSourceroot" ->
88
+ sourceDirectory.in(input, Compile ).value,
89
+ " outputSourceroot" ->
90
+ sourceDirectory.in(output, Compile ).value,
91
+ " outputFailureSourceroot" ->
92
+ sourceDirectory.in(outputFailure, Compile ).value,
93
+ " inputClassdirectory" ->
94
+ classDirectory.in(input, Compile ).value
95
+ ),
96
+ test in Test := (test in Test ).dependsOn(compile in (output, Compile )).value
97
+ )
98
+ .dependsOn(input, rules)
99
+ .enablePlugins(BuildInfoPlugin )
0 commit comments