-
Notifications
You must be signed in to change notification settings - Fork 87
Move scalafix build to the main build #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,36 @@ | ||
import sbtcrossproject.{crossProject, CrossType} | ||
import ScalaModulePlugin._ | ||
import sbtcrossproject.{crossProject, CrossType} | ||
import _root_.scalafix.Versions.{version => scalafixVersion, scala212 => scalafixScala212} | ||
|
||
lazy val scala212 = "2.12.6" | ||
lazy val scala213 = "2.13.0-M4" | ||
|
||
inThisBuild(Seq( | ||
crossScalaVersions := Seq("2.12.6", "2.13.0-M4", "2.11.12") | ||
crossScalaVersions := Seq(scala212, scala213, "2.11.12") | ||
)) | ||
|
||
disablePlugins(JvmPlugin) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this prevents sbt from giving command history / autocompletion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For reference, this was added in #41 |
||
lazy val root = project | ||
.in(file(".")) | ||
.aggregate(rules, input, output, tests, compatJVM, compatJS) | ||
.disablePlugins(ScalafixPlugin) | ||
|
||
lazy val `scala-collection-compat` = crossProject(JSPlatform, JVMPlatform) | ||
lazy val compat = crossProject(JSPlatform, JVMPlatform) | ||
.withoutSuffixFor(JVMPlatform) | ||
.crossType(CrossType.Pure) | ||
.in(file(".")) | ||
.settings(scalaModuleSettings) | ||
.jvmSettings(scalaModuleSettingsJVM) | ||
.settings( | ||
name := "scala-collection-compat", | ||
moduleName := "scala-collection-compat", | ||
version := "0.1-SNAPSHOT", | ||
scalacOptions ++= Seq("-feature", "-language:higherKinds", "-language:implicitConversions"), | ||
unmanagedSourceDirectories in Compile += { | ||
val sharedSourceDir = baseDirectory.value.getParentFile / "src/main" | ||
if (scalaVersion.value.startsWith("2.13.")) sharedSourceDir / "scala-2.13" | ||
else sharedSourceDir / "scala-2.11_2.12" | ||
} | ||
}, | ||
scalaVersion := scala212 | ||
) | ||
.settings(scalaModuleSettings) | ||
.jvmSettings(scalaModuleSettingsJVM) | ||
.jvmSettings( | ||
OsgiKeys.exportPackage := Seq(s"scala.collection.compat.*;version=${version.value}"), | ||
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test" | ||
|
@@ -36,6 +44,56 @@ lazy val `scala-collection-compat` = crossProject(JSPlatform, JVMPlatform) | |
fork in Test := false // Scala.js cannot run forked tests | ||
) | ||
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin)) | ||
.disablePlugins(ScalafixPlugin) | ||
|
||
lazy val compatJVM = compat.jvm | ||
lazy val compatJS = compat.js | ||
|
||
lazy val rules = project | ||
.in(file("scalafix/rules")) | ||
.settings( | ||
scalaVersion := scalafixScala212, | ||
libraryDependencies += "ch.epfl.scala" %% "scalafix-core" % scalafixVersion | ||
) | ||
|
||
lazy val input = project | ||
.in(file("scalafix/input")) | ||
.settings( | ||
scalaVersion := scalafixScala212, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. semanticdb plugin required by scalafix is not available for 2.12.6 |
||
scalafixSourceroot := sourceDirectory.in(Compile).value | ||
) | ||
|
||
lazy val output = project | ||
.in(file("scalafix/output")) | ||
.settings( | ||
resolvers += "scala-pr" at "https://scala-ci.typesafe.com/artifactory/scala-integration/", | ||
scalaVersion := scala213 | ||
) | ||
|
||
lazy val outputFailure = project | ||
.in(file("scalafix/output-failure")) | ||
.settings( | ||
resolvers += "scala-pr" at "https://scala-ci.typesafe.com/artifactory/scala-integration/", | ||
scalaVersion := scala213 | ||
) | ||
|
||
lazy val `scala-collection-compatJVM` = `scala-collection-compat`.jvm | ||
lazy val `scala-collection-compatJS` = `scala-collection-compat`.js | ||
lazy val tests = project | ||
.in(file("scalafix/tests")) | ||
.settings( | ||
scalaVersion := scalafixScala212, | ||
libraryDependencies += "ch.epfl.scala" % "scalafix-testkit" % scalafixVersion % Test cross CrossVersion.full, | ||
buildInfoPackage := "fix", | ||
buildInfoKeys := Seq[BuildInfoKey]( | ||
"inputSourceroot" -> | ||
sourceDirectory.in(input, Compile).value, | ||
"outputSourceroot" -> | ||
sourceDirectory.in(output, Compile).value, | ||
"outputFailureSourceroot" -> | ||
sourceDirectory.in(outputFailure, Compile).value, | ||
"inputClassdirectory" -> | ||
classDirectory.in(input, Compile).value | ||
), | ||
test in Test := (test in Test).dependsOn(compile in (output, Compile)).value | ||
) | ||
.dependsOn(input, rules) | ||
.enablePlugins(BuildInfoPlugin) |
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RELEASE_COMBO
does not seem to be used.