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)
9
15
10
- lazy val `scala-collection-compat` = crossProject(JSPlatform , JVMPlatform )
16
+
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"
@@ -37,5 +45,54 @@ lazy val `scala-collection-compat` = crossProject(JSPlatform, JVMPlatform)
37
45
)
38
46
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin ))
39
47
40
- lazy val `scala-collection-compatJVM` = `scala-collection-compat`.jvm
41
- lazy val `scala-collection-compatJS` = `scala-collection-compat`.js
48
+ lazy val compatJVM = compat.jvm
49
+ lazy val compatJS = compat.js
50
+
51
+ lazy val rules = project
52
+ .in(file(" scalafix/rules" ))
53
+ .settings(
54
+ scalaVersion := scalafixScala212,
55
+ libraryDependencies += " ch.epfl.scala" %% " scalafix-core" % scalafixVersion
56
+ )
57
+
58
+ lazy val input = project
59
+ .in(file(" scalafix/input" ))
60
+ .settings(
61
+ scalaVersion := scalafixScala212,
62
+ scalafixSourceroot := sourceDirectory.in(Compile ).value
63
+ )
64
+
65
+ lazy val output = project
66
+ .in(file(" scalafix/output" ))
67
+ .settings(
68
+ resolvers += " scala-pr" at " https://scala-ci.typesafe.com/artifactory/scala-integration/" ,
69
+ scalaVersion := scala213
70
+ )
71
+
72
+ lazy val outputFailure = project
73
+ .in(file(" scalafix/output-failure" ))
74
+ .settings(
75
+ resolvers += " scala-pr" at " https://scala-ci.typesafe.com/artifactory/scala-integration/" ,
76
+ scalaVersion := scala213
77
+ )
78
+
79
+ lazy val tests = project
80
+ .in(file(" scalafix/tests" ))
81
+ .settings(
82
+ scalaVersion := scalafixScala212,
83
+ libraryDependencies += " ch.epfl.scala" % " scalafix-testkit" % scalafixVersion % Test cross CrossVersion .full,
84
+ buildInfoPackage := " fix" ,
85
+ buildInfoKeys := Seq [BuildInfoKey ](
86
+ " inputSourceroot" ->
87
+ sourceDirectory.in(input, Compile ).value,
88
+ " outputSourceroot" ->
89
+ sourceDirectory.in(output, Compile ).value,
90
+ " outputFailureSourceroot" ->
91
+ sourceDirectory.in(outputFailure, Compile ).value,
92
+ " inputClassdirectory" ->
93
+ classDirectory.in(input, Compile ).value
94
+ ),
95
+ test in Test := (test in Test ).dependsOn(compile in (output, Compile )).value
96
+ )
97
+ .dependsOn(input, rules)
98
+ .enablePlugins(BuildInfoPlugin )
0 commit comments