Skip to content

Commit ceccd91

Browse files
author
Antonio Cunei
committed
Turn sbt dependencies into "provided" ones
The dbuild plugins used to bring onto the classpath all sorts of sbt libraries; the result was that multiple versions of the sbt libraries would appear on the classpath, leading to bizarre behaviour. The plugin will now use whatever sbt places on the classpath, matching the sbt version in use. In theory, this should fix scala/community-build#384 and may help with sbt/sbt#1696
1 parent e0a3493 commit ceccd91

File tree

9 files changed

+14
-6
lines changed

9 files changed

+14
-6
lines changed

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ lazy val repo = (
115115
SubProj("repo")
116116
dependsOn(adapter, metadata, logging)
117117
dependsOnRemote(mvnAether, dispatch, aether, aetherApi, aetherSpi, aetherUtil, aetherImpl, aetherConnectorBasic, aetherFile, aetherHttp, aetherWagon, mvnAether)
118-
dependsOnSbt(sbtIo, sbtLaunchInt)
118+
dependsOnSbt(sbtIo, sbtLaunchInt, sbtLogging)
119119
)
120120

121121
lazy val core = (
122122
SubProj("core")
123123
dependsOnRemote(javaMail)
124124
dependsOn(adapter,metadata, graph, hashing, logging, repo)
125-
dependsOnSbt(sbtIo)
125+
dependsOnSbt(sbtIo, sbtLogging)
126126
)
127127

128128
lazy val proj = (
@@ -195,7 +195,7 @@ lazy val build = (
195195
dependsOn(actorProj, support, supportGit, repo, metadata, deploy, proj)
196196
dependsOnRemote(aws, uriutil, dispatch, jsch, oro, scallop, commonsLang)
197197
dependsOnRemote(gpgLibIf210:_*)
198-
dependsOnSbt(sbtLaunchInt, sbtLauncher)
198+
dependsOnSbt(sbtLaunchInt, sbtLauncher, sbtLogging, sbtIo)
199199
settings(skip211:_*)
200200
settings(SbtSupport.settings:_*)
201201
settings(

build/src/main/scala/com/typesafe/dbuild/build/Comparison.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import sbt._
44
import com.typesafe.dbuild.adapter.Adapter
55
import Adapter.{IO,allPaths}
66
import Adapter.syntaxio._
7+
import Adapter.Path._
78
import com.typesafe.dbuild.model._
89
import com.typesafe.dbuild.logging.Logger
910
import java.io.File

build/src/main/scala/com/typesafe/dbuild/build/DeployBuild.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import com.typesafe.dbuild.adapter.Adapter
55
import Adapter.IO
66
import Adapter.syntaxio._
77
import Adapter.allPaths
8+
import Adapter.Path._
89
import com.typesafe.dbuild.model._
910
import com.typesafe.dbuild.repo.core._
1011
import java.io.File

deploy/src/main/scala/com/typesafe/dbuild/deploy/Deploy.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import com.typesafe.dbuild.adapter.Adapter
1818
import Adapter.{IO,Logger,allPaths}
1919
import Adapter.syntaxio._
2020
import com.lambdaworks.jacks.JacksMapper
21+
import Adapter.Path._
2122

2223
/**
2324
* A generic (S3, http, https, etc) deploy location.

project/RemoteDepHelper.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import sbt._
22
import Keys._
33
import Dependencies._
4+
import extra.syntax._
45

56
// DSL for adding remote deps like local deps.
67
class RemoteDepHelper(p: Project) {
78
def dependsOnRemote(ms: ModuleID*): Project = p.settings(libraryDependencies ++= ms)
89
def dependsOnSbt(ms: (String=>ModuleID)*): Project =
910
p.settings(libraryDependencies ++= {
1011
val v = sbtVersion.value
11-
ms map {_(v)}
12+
ms map { _(v) % "provided"}
1213
})
1314
}
1415
object RemoteDepHelper {

project/src/main/scala-2.10/Dependencies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ object Dependencies extends CommonDependencies {
1111
def sbtIo(v:String) = "org.scala-sbt" % "io" % v
1212
def sbtIvy(v:String) = "org.scala-sbt" % "ivy" % v
1313
def sbtLogging(v:String) = "org.scala-sbt" % "logging" % v
14-
def sbtLaunchInt(v:String) = "org.scala-sbt" % "launcher" % v % "provided"
14+
def sbtLaunchInt(v:String) = "org.scala-sbt" % "launcher" % v
1515
def sbtLauncher(v:String) = "org.scala-sbt" % "launcher" % v
1616
def sbtSbt(v:String) = "org.scala-sbt" % "sbt" % v
1717

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
object extra {val syntax = new {}}
2+

project/src/main/scala-2.11/Dependencies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ object Dependencies extends CommonDependencies {
1111
def sbtIo(v:String) = "org.scala-sbt" %% "io" % "1.0.0-M6"
1212
def sbtIvy(v:String) = "org.scala-sbt" %% "librarymanagement" % "0.1.0-M12"
1313
def sbtLogging(v:String) = "org.scala-sbt" %% "util-logging" % "0.1.0-M14"
14-
def sbtLaunchInt(v:String) = "org.scala-sbt" % "launcher" % "1.0.0" % "provided"
14+
def sbtLaunchInt(v:String) = "org.scala-sbt" % "launcher" % "1.0.0"
1515
def sbtLauncher(v:String) = "org.scala-sbt" % "launcher" % "1.0.0"
1616
def sbtSbt(v:String) = "org.scala-sbt" % "sbt" % v
1717

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
object extra {val syntax = sbt.syntax}
2+

0 commit comments

Comments
 (0)