From 7278fbc56783c41f0f9a757a7fc819cc72cf858d Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Tue, 9 Jul 2013 14:55:30 -0400 Subject: [PATCH] Scala 2.11 modularized dependencies --- project/Sbt.scala | 8 ++++---- project/Util.scala | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/project/Sbt.scala b/project/Sbt.scala index f4f07edce..a601fd509 100644 --- a/project/Sbt.scala +++ b/project/Sbt.scala @@ -56,7 +56,7 @@ object Sbt extends Build lazy val collectionSub = testedBaseProject(utilPath / "collection", "Collections") settings( Util.keywordsSettings: _* ) lazy val applyMacroSub = testedBaseProject(utilPath / "appmacro", "Apply Macro") dependsOn(collectionSub) settings(scalaCompiler) // The API for forking, combining, and doing I/O with system processes - lazy val processSub = baseProject(utilPath / "process", "Process") dependsOn(ioSub % "test->test") + lazy val processSub = baseProject(utilPath / "process", "Process") dependsOn(ioSub % "test->test") settings(scalaXml) // Path, IO (formerly FileUtilities), NameFilter and other I/O utility classes lazy val ioSub = testedBaseProject(utilPath / "io", "IO") dependsOn(controlSub) settings(ioSettings : _ *) // Utilities related to reflection, managing Scala versions, and custom class loaders @@ -88,7 +88,7 @@ object Sbt extends Build // Standard task system. This provides map, flatMap, join, and more on top of the basic task model. lazy val stdTaskSub = testedBaseProject(tasksPath / "standard", "Task System") dependsOn(taskSub % "compile;test->test", collectionSub, logSub, ioSub, processSub) settings( testExclusive ) // Persisted caching based on SBinary - lazy val cacheSub = baseProject(cachePath, "Cache") dependsOn(ioSub, collectionSub) settings(sbinary) + lazy val cacheSub = baseProject(cachePath, "Cache") dependsOn(ioSub, collectionSub) settings(sbinary, scalaXml) // Builds on cache to provide caching for filesystem-related operations lazy val trackingSub = baseProject(cachePath / "tracking", "Tracking") dependsOn(cacheSub, ioSub) // Embedded Scala code runner @@ -113,7 +113,7 @@ object Sbt extends Build compileIncrementalSub, compilerSub, compilePersistSub, apiSub, classfileSub) lazy val compilerIvySub = baseProject(compilePath / "ivy", "Compiler Ivy Integration") dependsOn(ivySub, compilerSub ) - lazy val scriptedBaseSub = baseProject(scriptedPath / "base", "Scripted Framework") dependsOn(ioSub, processSub) + lazy val scriptedBaseSub = baseProject(scriptedPath / "base", "Scripted Framework") dependsOn(ioSub, processSub) settings(scalaParsers) lazy val scriptedSbtSub = baseProject(scriptedPath / "sbt", "Scripted sbt") dependsOn(ioSub, logSub, processSub, scriptedBaseSub, launchInterfaceSub % "provided") lazy val scriptedPluginSub = baseProject(scriptedPath / "plugin", "Scripted Plugin") dependsOn(sbtSub, classpathSub) @@ -130,7 +130,7 @@ object Sbt extends Build completeSub, classpathSub, stdTaskSub, processSub) settings( sbinary ) // The main integration project for sbt. It brings all of the subsystems together, configures them, and provides for overriding conventions. - lazy val mainSub = testedBaseProject(mainPath, "Main") dependsOn(actionsSub, mainSettingsSub, interfaceSub, ioSub, ivySub, launchInterfaceSub, logSub, processSub, runSub, commandSub) + lazy val mainSub = testedBaseProject(mainPath, "Main") dependsOn(actionsSub, mainSettingsSub, interfaceSub, ioSub, ivySub, launchInterfaceSub, logSub, processSub, runSub, commandSub) settings(scalaXml) // 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 mainSub's dependencies, but we don't do that since this is strictly an integration project diff --git a/project/Util.scala b/project/Util.scala index 50ed51d1f..6e12d75a6 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -163,6 +163,11 @@ object Common lazy val sbinary = lib("org.scala-tools.sbinary" %% "sbinary" % "0.4.1" ) lazy val scalaCompiler = libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _ ) lazy val testInterface = lib("org.scala-sbt" % "test-interface" % "1.0") + def libModular(name: String) = libraryDependencies <++= (scalaVersion, scalaOrganization)( (sv,o) => + if(sv.startsWith("2.11.")) (o % name % sv) :: Nil else Nil + ) + lazy val scalaXml = libModular("scala-xml") + lazy val scalaParsers = libModular("scala-parser-combinators") } object Licensed {