Rewire to new modules

This commit is contained in:
Eugene Yokota 2015-09-14 03:27:22 -04:00
parent 58f5ceb6f2
commit 7132491f6c
2 changed files with 69 additions and 286 deletions

325
build.sbt
View File

@ -22,6 +22,7 @@ def commonSettings: Seq[Setting[_]] = Seq(
crossPaths := false,
resolvers += Resolver.typesafeIvyRepo("releases"),
resolvers += Resolver.sonatypeRepo("snapshots"),
resolvers += Resolver.bintrayRepo("sbt", "maven-releases"),
concurrentRestrictions in Global += Util.testExclusiveRestriction,
testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"),
javacOptions in compile ++= Seq("-target", "6", "-source", "6", "-Xlint", "-Xlint:-serial"),
@ -74,171 +75,15 @@ lazy val bundledLauncherProj =
/* ** subproject declarations ** */
// defines Java structures used across Scala versions, such as the API structures and relationships extracted by
// the analysis compiler phases and passed back to sbt. The API structures are defined in a simple
// format from which Java sources are generated by the datatype generator Projproject
lazy val interfaceProj = (project in file("interface")).
settings(
minimalSettings,
javaOnlySettings,
name := "Interface",
projectComponent,
exportJars := true,
componentID := Some("xsbti"),
watchSources <++= apiDefinitions,
resourceGenerators in Compile <+= (version, resourceManaged, streams, compile in Compile) map generateVersionFile,
apiDefinitions <<= baseDirectory map { base => (base / "definition") :: (base / "other") :: (base / "type") :: Nil },
sourceGenerators in Compile <+= (apiDefinitions,
fullClasspath in Compile in datatypeProj,
sourceManaged in Compile,
mainClass in datatypeProj in Compile,
runner,
streams) map generateAPICached
)
// 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 apiProj = (project in compilePath / "api").
dependsOn(interfaceProj, classfileProj).
settings(
testedBaseSettings,
name := "API"
)
/* **** Utilities **** */
lazy val controlProj = (project in utilPath / "control").
settings(
baseSettings,
Util.crossBuild,
name := "Control",
crossScalaVersions := Seq(scala210, scala211)
)
lazy val collectionProj = (project in utilPath / "collection").
settings(
testedBaseSettings,
Util.keywordsSettings,
Util.crossBuild,
name := "Collections",
crossScalaVersions := Seq(scala210, scala211)
)
lazy val applyMacroProj = (project in utilPath / "appmacro").
dependsOn(collectionProj).
settings(
testedBaseSettings,
name := "Apply Macro",
libraryDependencies += scalaCompiler.value
)
// The API for forking, combining, and doing I/O with system processes
lazy val processProj = (project in utilPath / "process").
dependsOn(ioProj % "test->test").
settings(
baseSettings,
name := "Process",
libraryDependencies ++= scalaXml.value
)
// Path, IO (formerly FileUtilities), NameFilter and other I/O utility classes
lazy val ioProj = (project in utilPath / "io").
dependsOn(controlProj).
settings(
testedBaseSettings,
Util.crossBuild,
name := "IO",
libraryDependencies += scalaCompiler.value % Test,
crossScalaVersions := Seq(scala210, scala211)
)
// Utilities related to reflection, managing Scala versions, and custom class loaders
lazy val classpathProj = (project in utilPath / "classpath").
dependsOn(interfaceProj, ioProj).
settings(
testedBaseSettings,
name := "Classpath",
libraryDependencies ++= Seq(scalaCompiler.value,Dependencies.launcherInterface)
)
// Command line-related utilities.
lazy val completeProj = (project in utilPath / "complete").
dependsOn(collectionProj, controlProj, ioProj).
settings(
testedBaseSettings,
Util.crossBuild,
name := "Completion",
libraryDependencies += jline,
crossScalaVersions := Seq(scala210, scala211)
)
// logging
lazy val logProj = (project in utilPath / "log").
dependsOn(interfaceProj, processProj).
settings(
testedBaseSettings,
name := "Logging",
libraryDependencies += jline
)
// Relation
lazy val relationProj = (project in utilPath / "relation").
dependsOn(interfaceProj, processProj).
settings(
testedBaseSettings,
name := "Relation"
)
// class file reader and analyzer
lazy val classfileProj = (project in utilPath / "classfile").
dependsOn(ioProj, interfaceProj, logProj).
settings(
testedBaseSettings,
name := "Classfile"
)
// generates immutable or mutable Java data types according to a simple input format
lazy val datatypeProj = (project in utilPath / "datatype").
dependsOn(ioProj).
settings(
baseSettings,
name := "Datatype Generator"
)
// cross versioning
lazy val crossProj = (project in utilPath / "cross").
settings(
baseSettings,
inConfig(Compile)(Transform.crossGenSettings),
name := "Cross"
)
// A logic with restricted negation as failure for a unique, stable model
lazy val logicProj = (project in utilPath / "logic").
dependsOn(collectionProj, relationProj).
settings(
testedBaseSettings,
name := "Logic"
)
/* **** Intermediate-level Modules **** */
// Apache Ivy integration
lazy val ivyProj = (project in file("ivy")).
dependsOn(interfaceProj, crossProj, logProj % "compile;test->test", ioProj % "compile;test->test", /*launchProj % "test->test",*/ collectionProj).
settings(
baseSettings,
name := "Ivy",
libraryDependencies ++= Seq(ivy, jsch, sbtSerialization, scalaReflect.value, launcherInterface),
testExclusive)
// Runner for uniform test interface
lazy val testingProj = (project in file("testing")).
dependsOn(ioProj, classpathProj, logProj, testAgentProj).
dependsOn(testAgentProj).
settings(
baseSettings,
name := "Testing",
libraryDependencies ++= Seq(testInterface,launcherInterface)
libraryDependencies ++= Seq(sbtIO, testInterface,launcherInterface, compilerClasspath, utilLogging)
)
// Testing agent for running tests in a separate process.
@ -251,186 +96,113 @@ lazy val testAgentProj = (project in file("testing") / "agent").
// Basic task engine
lazy val taskProj = (project in tasksPath).
dependsOn(controlProj, collectionProj).
settings(
testedBaseSettings,
name := "Tasks"
name := "Tasks",
libraryDependencies ++= Seq(utilControl, utilCollection)
)
// Standard task system. This provides map, flatMap, join, and more on top of the basic task model.
lazy val stdTaskProj = (project in tasksPath / "standard").
dependsOn (taskProj % "compile;test->test", collectionProj, logProj, ioProj, processProj).
dependsOn (taskProj % "compile;test->test").
settings(
testedBaseSettings,
name := "Task System",
testExclusive
)
// Persisted caching based on SBinary
lazy val cacheProj = (project in cachePath).
dependsOn (ioProj, collectionProj).
settings(
baseSettings,
name := "Cache",
libraryDependencies ++= Seq(sbinary, sbtSerialization, scalaReflect.value) ++ scalaXml.value
)
// Builds on cache to provide caching for filesystem-related operations
lazy val trackingProj = (project in cachePath / "tracking").
dependsOn(cacheProj, ioProj).
settings(
baseSettings,
name := "Tracking"
testExclusive,
libraryDependencies ++= Seq(utilCollection, utilLogging, sbtIO)
)
// Embedded Scala code runner
lazy val runProj = (project in file("run")).
dependsOn (ioProj, logProj % "compile;test->test", classpathProj, processProj % "compile;test->test").
settings(
testedBaseSettings,
name := "Run"
)
// 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 compileInterfaceProj = (project in compilePath / "interface").
dependsOn(interfaceProj % "compile;test->test", ioProj % "test->test", logProj % "test->test", /*launchProj % "test->test",*/ apiProj % "test->test").
settings(
baseSettings,
libraryDependencies += scalaCompiler.value % "provided",
name := "Compiler Interface",
exportJars := true,
// we need to fork because in unit tests we set usejavacp = true which means
// we are expecting all of our dependencies to be on classpath so Scala compiler
// can use them while constructing its own classpath for compilation
fork in Test := true,
// needed because we fork tests and tests are ran in parallel so we have multiple Scala
// compiler instances that are memory hungry
javaOptions in Test += "-Xmx1G",
publishArtifact in (Compile, packageSrc) := true
)
// 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 compileIncrementalProj = (project in compilePath / "inc").
dependsOn (apiProj, ioProj, logProj, classpathProj, relationProj).
settings(
testedBaseSettings,
name := "Incremental Compiler"
)
// Persists the incremental data structures using SBinary
lazy val compilePersistProj = (project in compilePath / "persist").
dependsOn(compileIncrementalProj, apiProj, compileIncrementalProj % "test->test").
settings(
testedBaseSettings,
name := "Persist",
libraryDependencies += sbinary
)
// sbt-side interface to compiler. Calls compiler-side interface reflectively
lazy val compilerProj = (project in compilePath).
dependsOn(interfaceProj % "compile;test->test", logProj, ioProj, classpathProj, apiProj, classfileProj,
logProj % "test->test" /*,launchProj % "test->test" */).
settings(
testedBaseSettings,
name := "Compile",
libraryDependencies ++= Seq(scalaCompiler.value % Test, launcherInterface),
unmanagedJars in Test <<= (packageSrc in compileInterfaceProj in Compile).map(x => Seq(x).classpath)
)
lazy val compilerIntegrationProj = (project in (compilePath / "integration")).
dependsOn(compileIncrementalProj, compilerProj, compilePersistProj, apiProj, classfileProj).
settings(
baseSettings,
name := "Compiler Integration"
)
lazy val compilerIvyProj = (project in compilePath / "ivy").
dependsOn (ivyProj, compilerProj).
settings(
baseSettings,
name := "Compiler Ivy Integration"
name := "Run",
libraryDependencies ++= Seq(sbtIO,
utilLogging, (utilLogging % Test).classifier("tests"), compilerClasspath)
)
lazy val scriptedBaseProj = (project in scriptedPath / "base").
dependsOn (ioProj, processProj).
settings(
testedBaseSettings,
name := "Scripted Framework",
libraryDependencies ++= scalaParsers.value
libraryDependencies ++= scalaParsers.value ++ Seq(sbtIO)
)
lazy val scriptedSbtProj = (project in scriptedPath / "sbt").
dependsOn (ioProj, logProj, processProj, scriptedBaseProj, interfaceProj).
dependsOn(scriptedBaseProj).
settings(
baseSettings,
name := "Scripted sbt",
libraryDependencies += launcherInterface % "provided"
libraryDependencies ++= Seq(launcherInterface % "provided",
sbtIO, utilLogging, compilerInterface)
)
lazy val scriptedPluginProj = (project in scriptedPath / "plugin").
dependsOn (sbtProj, classpathProj).
dependsOn(sbtProj).
settings(
baseSettings,
name := "Scripted Plugin"
name := "Scripted Plugin",
libraryDependencies ++= Seq(compilerClasspath)
)
// Implementation and support code for defining actions.
lazy val actionsProj = (project in mainPath / "actions").
dependsOn (classpathProj, completeProj, apiProj, compilerIntegrationProj, compilerIvyProj,
interfaceProj, ioProj, ivyProj, logProj, processProj, runProj, relationProj, stdTaskProj,
taskProj, trackingProj, testingProj).
dependsOn(runProj, stdTaskProj, taskProj, testingProj).
settings(
testedBaseSettings,
name := "Actions"
name := "Actions",
libraryDependencies ++= Seq(compilerClasspath, utilCompletion, compilerApiInfo,
incrementalcompiler, compilerIvyIntegration, compilerInterface,
sbtIO, utilLogging, utilRelation, libraryManagement, utilTracking)
)
// General command support and core commands not specific to a build system
lazy val commandProj = (project in mainPath / "command").
dependsOn(interfaceProj, ioProj, logProj, completeProj, classpathProj, crossProj).
settings(
testedBaseSettings,
name := "Command",
libraryDependencies += launcherInterface
libraryDependencies ++= Seq(launcherInterface, compilerInterface,
sbtIO, utilLogging, utilCompletion, compilerClasspath)
)
// Fixes scope=Scope for Setting (core defined in collectionProj) to define the settings system used in build definitions
lazy val mainSettingsProj = (project in mainPath / "settings").
dependsOn (applyMacroProj, interfaceProj, ivyProj, relationProj, logProj, ioProj, commandProj,
completeProj, classpathProj, stdTaskProj, processProj).
dependsOn(commandProj, stdTaskProj).
settings(
testedBaseSettings,
name := "Main Settings",
libraryDependencies += sbinary
libraryDependencies ++= Seq(sbinary, utilApplyMacro, compilerInterface, utilRelation,
utilLogging, sbtIO, utilCompletion, compilerClasspath, libraryManagement)
)
// The main integration project for sbt. It brings all of the Projsystems together, configures them, and provides for overriding conventions.
lazy val mainProj = (project in mainPath).
dependsOn (actionsProj, mainSettingsProj, interfaceProj, ioProj, ivyProj, logProj, logicProj, processProj, runProj, commandProj).
dependsOn(actionsProj, mainSettingsProj, runProj, commandProj).
settings(
testedBaseSettings,
name := "Main",
libraryDependencies ++= scalaXml.value ++ Seq(launcherInterface)
libraryDependencies ++= scalaXml.value ++ Seq(launcherInterface, compilerInterface,
sbtIO, utilLogging, utilLogic, libraryManagement)
)
// Strictly for bringing implicits and aliases from subsystems into the top-level sbt namespace through a single package object
// technically, we need a dependency on all of mainProj's dependencies, but we don't do that since this is strictly an integration project
// with the sole purpose of providing certain identifiers without qualification (with a package object)
lazy val sbtProj = (project in sbtPath).
dependsOn(mainProj, compileInterfaceProj, scriptedSbtProj % "test->test").
dependsOn(mainProj, scriptedSbtProj % "test->test").
settings(
baseSettings,
name := "sbt",
normalizedName := "sbt"
normalizedName := "sbt",
libraryDependencies ++= Seq(compilerBrdige)
)
lazy val mavenResolverPluginProj = (project in file("sbt-maven-resolver")).
dependsOn(sbtProj, ivyProj % "test->test").
dependsOn(sbtProj).
settings(
baseSettings,
name := "sbt-maven-resolver",
libraryDependencies ++= aetherLibs,
libraryDependencies ++= aetherLibs ++ Seq((libraryManagement % Test).classifier("tests")),
sbtPlugin := true
)
@ -452,12 +224,8 @@ lazy val publishLauncher = TaskKey[Unit]("publish-launcher")
lazy val myProvided = config("provided") intransitive
def allProjects = Seq(interfaceProj, apiProj,
controlProj, collectionProj, applyMacroProj, processProj, ioProj, classpathProj, completeProj,
logProj, relationProj, classfileProj, datatypeProj, crossProj, logicProj, ivyProj,
testingProj, testAgentProj, taskProj, stdTaskProj, cacheProj, trackingProj, runProj,
compileInterfaceProj, compileIncrementalProj, compilePersistProj, compilerProj,
compilerIntegrationProj, compilerIvyProj,
def allProjects = Seq(
testingProj, testAgentProj, taskProj, stdTaskProj, runProj,
scriptedBaseProj, scriptedSbtProj, scriptedPluginProj,
actionsProj, commandProj, mainSettingsProj, mainProj, sbtProj, bundledLauncherProj, mavenResolverPluginProj)
@ -517,23 +285,14 @@ def mainPath = file("main")
lazy val safeUnitTests = taskKey[Unit]("Known working tests (for both 2.10 and 2.11)")
lazy val safeProjects: ScopeFilter = ScopeFilter(
inProjects(mainSettingsProj, mainProj, ivyProj, completeProj,
actionsProj, classpathProj, collectionProj, compileIncrementalProj,
logProj, runProj, stdTaskProj, compilerProj),
inProjects(mainSettingsProj, mainProj,
actionsProj, runProj, stdTaskProj),
inConfigurations(Test)
)
lazy val otherUnitTests = taskKey[Unit]("Unit test other projects")
lazy val otherProjects: ScopeFilter = ScopeFilter(
inProjects(interfaceProj, apiProj, controlProj,
applyMacroProj,
// processProj, // this one is suspicious
ioProj,
relationProj, classfileProj, datatypeProj,
crossProj, logicProj, testingProj, testAgentProj, taskProj,
cacheProj, trackingProj,
compileIncrementalProj,
compilePersistProj, compilerProj,
compilerIntegrationProj, compilerIvyProj,
inProjects(
testingProj, testAgentProj, taskProj,
scriptedBaseProj, scriptedSbtProj, scriptedPluginProj,
commandProj, mainSettingsProj, mainProj,
sbtProj, mavenResolverPluginProj),

View File

@ -8,6 +8,33 @@ object Dependencies {
lazy val scala210 = "2.10.5"
lazy val scala211 = "2.11.7"
// sbt modules
val utilVersion = "0.1.0-M3"
val ioVersion = "1.0.0-M3"
val incremenalcompilerVersion = "0.1.0-M1-746894baddb6d986a876160a656d72d2203e7613"
val librarymanagementVersion = "0.1.0-M2"
lazy val sbtIO = "org.scala-sbt" %% "io" % ioVersion
lazy val utilCollection = "org.scala-sbt" %% "util-collection" % utilVersion
lazy val utilLogging = "org.scala-sbt" %% "util-logging" % utilVersion
lazy val utilTesting = "org.scala-sbt" %% "util-testing" % utilVersion
lazy val utilControl = "org.scala-sbt" %% "util-control" % utilVersion
lazy val utilCompletion = "org.scala-sbt" %% "util-completion" % utilVersion
lazy val utilApplyMacro = "org.scala-sbt" %% "util-apply-macro" % utilVersion
lazy val utilRelation = "org.scala-sbt" %% "util-relation" % utilVersion
lazy val utilLogic = "org.scala-sbt" %% "util-logic" % utilVersion
lazy val utilTracking = "org.scala-sbt" %% "util-tracking" % utilVersion
lazy val libraryManagement = "org.scala-sbt" %% "librarymanagement" % librarymanagementVersion
lazy val launcherInterface = "org.scala-sbt" % "launcher-interface" % "1.0.0-M1"
lazy val rawLauncher = "org.scala-sbt" % "launcher" % "1.0.0-M1"
lazy val testInterface = "org.scala-sbt" % "test-interface" % "1.0"
lazy val incrementalcompiler = "org.scala-sbt" %% "incrementalcompiler" % incremenalcompilerVersion
lazy val compilerInterface = "org.scala-sbt" % "compiler-interface" % incremenalcompilerVersion
lazy val compilerBrdige = "org.scala-sbt" %% "compiler-bridge" % incremenalcompilerVersion
lazy val compilerClasspath = "org.scala-sbt" %% "compiler-classpath" % incremenalcompilerVersion
lazy val compilerApiInfo = "org.scala-sbt" %% "compiler-apiinfo" % incremenalcompilerVersion
lazy val compilerIvyIntegration = "org.scala-sbt" %% "compiler-ivy-integration" % incremenalcompilerVersion
lazy val jline = "jline" % "jline" % "2.11"
lazy val ivy = "org.scala-sbt.ivy" % "ivy" % "2.3.0-sbt-d592b1b0f77cf706e882b1b8e0162dee28165fb2"
lazy val jsch = "com.jcraft" % "jsch" % "0.1.46" intransitive ()
@ -15,12 +42,9 @@ object Dependencies {
lazy val sbtSerialization = "org.scala-sbt" %% "serialization" % "0.1.2"
lazy val scalaCompiler = Def.setting { "org.scala-lang" % "scala-compiler" % scalaVersion.value }
lazy val scalaReflect = Def.setting { "org.scala-lang" % "scala-reflect" % scalaVersion.value }
lazy val testInterface = "org.scala-sbt" % "test-interface" % "1.0"
lazy val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.11.4"
lazy val specs2 = "org.specs2" %% "specs2" % "2.3.11"
lazy val junit = "junit" % "junit" % "4.11"
lazy val launcherInterface = "org.scala-sbt" % "launcher-interface" % "1.0.0-M1"
lazy val rawLauncher = "org.scala-sbt" % "launcher" % "1.0.0-M1"
private def scala211Module(name: String, moduleVersion: String) =
Def.setting {