Skip to content
This repository was archived by the owner on Jun 23, 2020. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f33a886

Browse files
committedApr 20, 2017
Clean up the build
- Update the sbt version - Update scala-module-plugin - Remove the explicit sbt-mima-plugin dependency, as it's provided via scala-module-plugin. - Apply `commonSettings` before custom project settings to allow overrides - Set `mimaPreviousVersion`, the rest of the mima config is done by the scala-module-plugin - Define `scalaVersionsByJvm` - Remove `snapshotScalaBinaryVersion`, there are no more Scala snapshots
1 parent c9aedd8 commit f33a886

File tree

3 files changed

+58
-53
lines changed

3 files changed

+58
-53
lines changed
 

‎build.sbt

Lines changed: 56 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
import com.typesafe.tools.mima.plugin.{MimaPlugin, MimaKeys}
21
import Keys.{`package` => packageTask }
32
import com.typesafe.sbt.osgi.{OsgiKeys, SbtOsgi}
43

54
// plugin logic of build based on https://github.com/retronym/boxer
65

76
lazy val commonSettings = scalaModuleSettings ++ Seq(
8-
repoName := "scala-continuations",
9-
organization := "org.scala-lang.plugins",
10-
version := "1.0.3-SNAPSHOT",
11-
scalaVersion := crossScalaVersions.value.head,
12-
crossScalaVersions := {
13-
val java = System.getProperty("java.version")
14-
if (java.startsWith("1.6.") || java.startsWith("1.7."))
15-
Seq("2.11.8")
16-
else if (java.startsWith("1.8.") || java.startsWith("1.9."))
17-
Seq("2.12.0", "2.12.1")
18-
else
19-
sys.error(s"don't know what Scala versions to build on $java")
7+
repoName := "scala-continuations",
8+
organization := "org.scala-lang.plugins",
9+
version := "1.0.3-SNAPSHOT",
10+
11+
scalaVersionsByJvm := {
12+
val j67 = List("2.11.11", "2.11.8")
13+
val j89 = List("2.12.2", "2.12.1", "2.12.0", "2.13.0-M1")
14+
// Map[JvmVersion, List[(ScalaVersion, UseForPublishing)]]
15+
Map(
16+
6 -> j67.map(_ -> true),
17+
7 -> j67.map(_ -> false),
18+
8 -> j89.map(_ -> true),
19+
9 -> j89.map(_ -> false)
20+
)
2021
},
21-
snapshotScalaBinaryVersion := "2.11.8",
22+
2223
scalacOptions ++= Seq(
2324
"-deprecation",
2425
"-feature")
@@ -36,43 +37,49 @@ lazy val crossVersionSharedSources: Seq[Setting[_]] =
3637
}
3738
}
3839

39-
lazy val root = project.in( file(".") ).settings( publishArtifact := false ).aggregate(plugin, library).settings(commonSettings : _*)
40+
lazy val root = project.in(file("."))
41+
.settings(commonSettings: _*)
42+
.settings(publishArtifact := false)
43+
.aggregate(plugin, library)
4044

41-
lazy val plugin = project settings (scalaModuleOsgiSettings: _*) settings (
42-
name := "scala-continuations-plugin",
43-
crossVersion := CrossVersion.full, // because compiler api is not binary compatible
44-
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value,
45-
OsgiKeys.exportPackage := Seq(s"scala.tools.selectivecps;version=${version.value}")
46-
) settings (commonSettings : _*)
45+
lazy val plugin = project
46+
.settings(scalaModuleOsgiSettings: _*)
47+
.settings(commonSettings: _*)
48+
.settings(
49+
name := "scala-continuations-plugin",
50+
crossVersion := CrossVersion.full, // because compiler api is not binary compatible
51+
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value,
52+
OsgiKeys.exportPackage := Seq(s"scala.tools.selectivecps;version=${version.value}")
53+
)
4754

4855
val pluginJar = packageTask in (plugin, Compile)
4956

5057
// TODO: the library project's test are really plugin tests, but we first need that jar
51-
lazy val library = project settings (scalaModuleOsgiSettings: _*) settings (MimaPlugin.mimaDefaultSettings: _*) settings (
52-
name := "scala-continuations-library",
53-
MimaKeys.mimaPreviousArtifacts := Set(
54-
organization.value % s"${name.value}_2.11" % "1.0.2"
55-
),
56-
scalacOptions ++= Seq(
57-
// add the plugin to the compiler
58-
s"-Xplugin:${pluginJar.value.getAbsolutePath}",
59-
// enable the plugin
60-
"-P:continuations:enable",
61-
// add plugin timestamp to compiler options to trigger recompile of
62-
// the library after editing the plugin. (Otherwise a 'clean' is needed.)
63-
s"-Jdummy=${pluginJar.value.lastModified}"),
64-
libraryDependencies ++= Seq(
65-
"org.scala-lang" % "scala-compiler" % scalaVersion.value % "test",
66-
"junit" % "junit" % "4.12" % "test",
67-
"com.novocode" % "junit-interface" % "0.11" % "test"),
68-
testOptions += Tests.Argument(
69-
TestFrameworks.JUnit,
70-
s"-Dscala-continuations-plugin.jar=${pluginJar.value.getAbsolutePath}"
71-
),
72-
// run mima during tests
73-
test in Test := {
74-
MimaKeys.mimaReportBinaryIssues.value
75-
(test in Test).value
76-
},
77-
OsgiKeys.exportPackage := Seq(s"scala.util.continuations;version=${version.value}")
78-
) settings (commonSettings : _*)
58+
lazy val library = project
59+
.settings(scalaModuleOsgiSettings: _*)
60+
.settings(commonSettings: _*)
61+
.settings(
62+
name := "scala-continuations-library",
63+
mimaPreviousVersion := Some("1.0.3"),
64+
65+
scalacOptions ++= Seq(
66+
// add the plugin to the compiler
67+
s"-Xplugin:${pluginJar.value.getAbsolutePath}",
68+
// enable the plugin
69+
"-P:continuations:enable",
70+
// add plugin timestamp to compiler options to trigger recompile of
71+
// the library after editing the plugin. (Otherwise a 'clean' is needed.)
72+
s"-Jdummy=${pluginJar.value.lastModified}"),
73+
74+
libraryDependencies ++= Seq(
75+
"org.scala-lang" % "scala-compiler" % scalaVersion.value % "test",
76+
"junit" % "junit" % "4.12" % "test",
77+
"com.novocode" % "junit-interface" % "0.11" % "test"),
78+
79+
testOptions += Tests.Argument(
80+
TestFrameworks.JUnit,
81+
s"-Dscala-continuations-plugin.jar=${pluginJar.value.getAbsolutePath}"
82+
),
83+
84+
OsgiKeys.exportPackage := Seq(s"scala.util.continuations;version=${version.value}")
85+
)

‎project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.12
1+
sbt.version=0.13.15

‎project/plugins.sbt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
addSbtPlugin("org.scala-lang.modules" % "scala-module-plugin" % "1.0.2")
2-
3-
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.9")
1+
addSbtPlugin("org.scala-lang.modules" % "scala-module-plugin" % "1.0.6")

0 commit comments

Comments
 (0)
This repository has been archived.