Skip to content

Commit

Permalink
Bump to sbt 1.0.0-M6
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n committed Jun 28, 2017
1 parent 866d9fd commit 76d4412
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 149 deletions.
69 changes: 30 additions & 39 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// import Project.Initialize
import Util._
import Dependencies._
import Scripted._
// import StringUtilities.normalize
import com.typesafe.tools.mima.core._, ProblemFilters._
// import com.typesafe.tools.mima.core._, ProblemFilters._

def baseVersion = "1.0.0-X16-SNAPSHOT"
def internalPath = file("internal")

lazy val compilerBridgeScalaVersions = Seq(scala212, scala211, scala210)
lazy val compilerBridgeScalaVersions = List(scala212, scala211, scala210)

val scalafmtCheck = Command.command("scalafmtCheck") { state =>
sys.process.Process("git diff --name-only --exit-code").! match {
Expand All @@ -30,9 +28,8 @@ def commonSettings: Seq[Setting[_]] = Seq(
// concurrentRestrictions in Global += Util.testExclusiveRestriction,
testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"),
javacOptions in compile ++= Seq("-Xlint", "-Xlint:-serial"),
incOptions := incOptions.value.withNameHashing(true),
crossScalaVersions := Seq(scala211, scala212),
mimaPreviousArtifacts := Set(), // Some(organization.value %% moduleName.value % "1.0.0"),
// mimaPreviousArtifacts := Set(), // Some(organization.value %% moduleName.value % "1.0.0"),
publishArtifact in Test := false,
commands ++= Seq(publishBridgesAndTest, publishBridgesAndSet, crossTestBridges, scalafmtCheck),
scalacOptions += "-YdisableFlatCpCaching"
Expand Down Expand Up @@ -77,6 +74,8 @@ def altPublishSettings: Seq[Setting[_]] =
Seq(
resolvers += altLocalResolver,
altLocalPublish := {
import sbt.librarymanagement._
import sbt.internal.librarymanagement._
val config = (Keys.publishLocalConfiguration).value
val moduleSettings = (Keys.moduleSettings).value
val ivy = new IvySbt((ivyConfiguration.value))
Expand All @@ -95,10 +94,8 @@ def altPublishSettings: Seq[Setting[_]] =
)

lazy val zincRoot: Project = (project in file("."))
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.
// configs(Sxr.sxrConf).
aggregate(
.aggregate(
zinc,
zincTesting,
zincPersist,
Expand Down Expand Up @@ -159,7 +156,6 @@ lazy val zincRoot: Project = (project in file("."))
)

lazy val zinc = (project in file("zinc"))
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.dependsOn(zincCore,
zincPersist,
zincCompileCore,
Expand All @@ -172,7 +168,6 @@ lazy val zinc = (project in file("zinc"))
)

lazy val zincTesting = (project in internalPath / "zinc-testing")
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.settings(
minimalSettings,
name := "zinc Testing",
Expand All @@ -185,7 +180,6 @@ lazy val zincTesting = (project in internalPath / "zinc-testing")
.configure(addSbtLm, addSbtUtilTesting)

lazy val zincCompile = (project in file("zinc-compile"))
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.dependsOn(zincCompileCore, zincCompileCore % "test->test")
.configure(addBaseSettingsAndTestDeps)
.settings(
Expand All @@ -195,7 +189,6 @@ lazy val zincCompile = (project in file("zinc-compile"))

// Persists the incremental data structures using SBinary
lazy val zincPersist = (project in internalPath / "zinc-persist")
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.dependsOn(zincCore, zincCore % "test->test")
.configure(addBaseSettingsAndTestDeps)
.settings(
Expand All @@ -206,7 +199,6 @@ lazy val zincPersist = (project in internalPath / "zinc-persist")
// Implements the core functionality of detecting and propagating changes incrementally.
// Defines the data structures for representing file fingerprints and relationships and the overall source analysis
lazy val zincCore = (project in internalPath / "zinc-core")
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.dependsOn(zincApiInfo, zincClasspath, compilerInterface, compilerBridge % Test)
.configure(addBaseSettingsAndTestDeps)
.settings(
Expand All @@ -223,7 +215,6 @@ lazy val zincCore = (project in internalPath / "zinc-core")
.configure(addSbtIO, addSbtUtilLogging, addSbtUtilRelation)

lazy val zincBenchmarks = (project in internalPath / "zinc-benchmarks")
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.dependsOn(compilerInterface % "compile->compile;compile->test")
.dependsOn(compilerBridge, zincCore, zincTesting % Test)
.enablePlugins(JmhPlugin)
Expand All @@ -241,7 +232,6 @@ lazy val zincBenchmarks = (project in internalPath / "zinc-benchmarks")
)

lazy val zincIvyIntegration = (project in internalPath / "zinc-ivy-integration")
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.dependsOn(zincCompileCore, zincTesting % Test)
.settings(
baseSettings,
Expand All @@ -252,7 +242,6 @@ lazy val zincIvyIntegration = (project in internalPath / "zinc-ivy-integration")

// sbt-side interface to compiler. Calls compiler-side interface reflectively
lazy val zincCompileCore = (project in internalPath / "zinc-compile-core")
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.dependsOn(compilerInterface % "compile;test->test",
zincClasspath,
zincApiInfo,
Expand All @@ -271,12 +260,13 @@ lazy val zincCompileCore = (project in internalPath / "zinc-compile-core")
// format from which Java sources are generated by the sbt-contraband plugin.
lazy val compilerInterface = (project in internalPath / "compiler-interface")
.enablePlugins(ContrabandPlugin)
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.settings(
minimalSettings,
// javaOnlySettings,
name := "Compiler Interface",
crossScalaVersions := Seq(scala212),
// Use the smallest Scala version in the compilerBridgeScalaVersions
crossScalaVersions := Seq(scala210),
scalaVersion := scala210,
relaxNon212,
libraryDependencies ++= Seq(scalaLibrary.value % Test),
exportJars := true,
Expand All @@ -300,7 +290,6 @@ lazy val compilerInterface = (project in internalPath / "compiler-interface")
// Compiler-side interface to compiler that is compiled against the compiler being used either in advance or on the fly.
// Includes API and Analyzer phases that extract source API and relationships.
lazy val compilerBridge: Project = (project in internalPath / "compiler-bridge")
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.dependsOn(compilerInterface % "compile;test->test",
/*launchProj % "test->test",*/ zincApiInfo % "test->test")
.settings(
Expand Down Expand Up @@ -334,7 +323,6 @@ def inBoth(ss: Setting[_]*): Seq[Setting[_]] = Seq(Compile, Test) flatMap (inCon
// defines operations on the API of a source, including determining whether it has changed and converting it to a string
// and discovery of Projclasses and annotations
lazy val zincApiInfo = (project in internalPath / "zinc-apiinfo")
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.dependsOn(compilerInterface, zincClassfile % "compile;test->test")
.configure(addBaseSettingsAndTestDeps)
.settings(
Expand All @@ -345,7 +333,6 @@ lazy val zincApiInfo = (project in internalPath / "zinc-apiinfo")

// Utilities related to reflection, managing Scala versions, and custom class loaders
lazy val zincClasspath = (project in internalPath / "zinc-classpath")
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.dependsOn(compilerInterface)
.configure(addBaseSettingsAndTestDeps)
.settings(
Expand All @@ -358,7 +345,6 @@ lazy val zincClasspath = (project in internalPath / "zinc-classpath")

// class file reader and analyzer
lazy val zincClassfile = (project in internalPath / "zinc-classfile")
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.dependsOn(compilerInterface % "compile;test->test")
.configure(addBaseSettingsAndTestDeps)
.settings(
Expand All @@ -371,22 +357,26 @@ lazy val zincClassfile = (project in internalPath / "zinc-classfile")
// re-implementation of scripted engine
lazy val zincScripted = (project in internalPath / "zinc-scripted")
.enablePlugins(ContrabandPlugin, JsonCodecPlugin)
.disablePlugins(com.typesafe.sbt.SbtScalariform)
.dependsOn(zinc, zincIvyIntegration % "test->test")
.settings(
minimalSettings,
name := "zinc Scripted",
publish := (),
publishLocal := (),
publish := {},
publishLocal := {},
skip in publish := true,
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala"
)
.configure(addSbtUtilScripted)

lazy val crossTestBridges = {
Command.command("crossTestBridges") { state =>
compilerBridgeScalaVersions.map { (bridgeVersion: String) =>
s"plz $bridgeVersion ${compilerBridge.id}/test"
} ::: state
(compilerBridgeScalaVersions.flatMap { (bridgeVersion: String) =>
s"++ $bridgeVersion" ::
s"${compilerBridge.id}/test" ::
Nil
}) :::
(s"++ $scala212" ::
state)
}
}

Expand All @@ -396,11 +386,11 @@ lazy val publishBridgesAndSet = {
val userScalaVersion = args.mkString("")
s"${compilerInterface.id}/publishLocal" ::
compilerBridgeScalaVersions.flatMap { (bridgeVersion: String) =>
s"wow $bridgeVersion" ::
s"++ $bridgeVersion" ::
s"${zincApiInfo.id}/publishLocal" ::
s"${compilerBridge.id}/publishLocal" :: Nil
} :::
s"wow $userScalaVersion" ::
s"++ $userScalaVersion" ::
state
}
}
Expand All @@ -411,14 +401,15 @@ lazy val publishBridgesAndTest = Command.args("publishBridgesAndTest", "<version
"Missing arguments to publishBridgesAndTest. Maybe quotes are missing around command?")
val version = args mkString ""
s"${compilerInterface.id}/publishLocal" ::
// using plz here causes: java.lang.OutOfMemoryError: GC overhead limit exceeded
(compilerBridgeScalaVersions flatMap { v =>
s"wow $v" ::
s";${zincApiInfo.id}/publishLocal;${compilerBridge.id}/test;${compilerBridge.id}/publishLocal" ::
Nil
}) :::
s"plz $version zincRoot/test" ::
s"plz $version zincRoot/scripted" ::
(compilerBridgeScalaVersions.flatMap { (bridgeVersion: String) =>
s"++ $bridgeVersion" ::
s"${zincApiInfo.id}/publishLocal" ::
s"${compilerBridge.id}/publishLocal" :: Nil
}) :::
s"++ $version" ::
s"zincRoot/scalaVersion" ::
s"zincRoot/test" ::
s"zincRoot/scripted" ::
state
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class Build private (
case _ => false
}
override def hashCode: Int = {
37 * (17 + projects.##)
37 * (37 * (17 + "Build".##) + projects.##)
}
override def toString: String = {
"Build(" + projects + ")"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// DO NOT EDIT MANUALLY
package sbt.internal.inctest
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder }
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait BuildFormats { self: sbt.internal.inctest.ProjectFormats with sjsonnew.BasicJsonProtocol =>
implicit lazy val BuildFormat: JsonFormat[sbt.internal.inctest.Build] = new JsonFormat[sbt.internal.inctest.Build] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.internal.inctest.Build = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class Project private (
case _ => false
}
override def hashCode: Int = {
37 * (37 * (37 * (37 * (17 + name.##) + dependsOn.##) + in.##) + scalaVersion.##)
37 * (37 * (37 * (37 * (37 * (17 + "Project".##) + name.##) + dependsOn.##) + in.##) + scalaVersion.##)
}
override def toString: String = {
"Project(" + name + ", " + dependsOn + ", " + in + ", " + scalaVersion + ")"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// DO NOT EDIT MANUALLY
package sbt.internal.inctest
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder }
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait ProjectFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val ProjectFormat: JsonFormat[sbt.internal.inctest.Project] = new JsonFormat[sbt.internal.inctest.Project] {
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.internal.inctest.Project = {
Expand Down
66 changes: 0 additions & 66 deletions project/AutomateScalafmtPlugin.scala

This file was deleted.

12 changes: 6 additions & 6 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ object Dependencies {
path foreach (f => println(s"Using $name from $f"))
path
}

lazy val sbtIoPath = getSbtModulePath("sbtio.path", "sbt/io")
lazy val sbtUtilPath = getSbtModulePath("sbtutil.path", "sbt/util")
lazy val sbtLmPath = getSbtModulePath("sbtlm.path", "sbt/lm")


def addSbtModule(p: Project,
path: Option[String],
projectName: String,
m: ModuleID,
c: Option[Configuration] = None) =
path match {
case Some(f) =>
p dependsOn c.fold[ClasspathDependency](ProjectRef(file(f), projectName))(
p dependsOn c.fold[ClasspathDep[ProjectReference]](ProjectRef(file(f), projectName))(
ProjectRef(file(f), projectName) % _)
case None => p settings (libraryDependencies += c.fold(m)(m % _))
}

lazy val sbtIoPath = getSbtModulePath("sbtio.path", "sbt/io")
lazy val sbtUtilPath = getSbtModulePath("sbtutil.path", "sbt/util")
lazy val sbtLmPath = getSbtModulePath("sbtlm.path", "sbt/lm")

def addSbtIO(p: Project): Project = addSbtModule(p, sbtIoPath, "io", sbtIO)

def addSbtUtilControl(p: Project): Project =
Expand Down
Loading

0 comments on commit 76d4412

Please sign in to comment.