Skip to content

Commit 34f0437

Browse files
committed
Revert "Do not include partest and it's dependencies in generated pom."
This reverts commit 053193f. I misunderstood bevaior of test scope/configuration in relation to transitive dependency. Partest can be included in generated pom as long as it's declared to be in test scope. Therefore the changes in 053193f are not needed.
1 parent f27ac81 commit 34f0437

File tree

1 file changed

+3
-30
lines changed

1 file changed

+3
-30
lines changed

build.sbt

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -83,39 +83,12 @@ TestKeys.includeTestDependencies := true
8383

8484
libraryDependencies ++= Seq("junit" % "junit" % "4.11" % "test", "com.novocode" % "junit-interface" % "0.10" % "test")
8585

86-
// Define custom Ivy configuration called "partest". Ivy configuration is analogous to Maven scope
87-
// and allows to group dependencies together, see:
88-
// http://www.scala-sbt.org/release/docs/Detailed-Topics/Library-Management#configurations
89-
// We define custom configuration so we can resolve partest through Ivy from Maven repository.
90-
// However, by putting partest dependency in custom configuration we can make sure that
91-
// it doesn't interfere with any other dependencies. Also, we can make sure that dependencies
92-
// resolved in partest configuration NOT included in generated pom. See makePomConfiguration
93-
// setting we define below.
94-
val partestConfiguration = config("partest")
95-
96-
// Define configuration to be used to assemble the classpath for compiling and running
97-
// tests. We define it as an union of default test configuration (scope in Maven's speak)
98-
// and partest configuration.
99-
val testWithPartestConfiguration = Configurations.Test.extend(partestConfiguration)
100-
101-
// register both configurations we defined so they are processed by `update` command
102-
ivyConfigurations ++= Seq(partestConfiguration, testWithPartestConfiguration)
103-
104-
// override configuration used to assemble classpath for tests
105-
configuration in Test := testWithPartestConfiguration
106-
107-
// Define configurations (scopes in Maven's speak) that are taken into account when
108-
// generating pom. By default sbt sets MakePomConfiguration.configurations to None which is
109-
// interpreted as "include dependencies in all configurations". That would include
110-
// dependencies in partest configuration which is not what we want: see comment above
111-
// where we define the partest configuration.
112-
makePomConfiguration := makePomConfiguration.value.copy(configurations = Some(Configurations.default))
113-
11486
// default
11587
TestKeys.partestVersion := "1.0.0-RC6"
11688

11789
// the actual partest the interface calls into -- must be binary version close enough to ours
11890
// so that it can link to the compiler/lib we're using (testing)
91+
// NOTE: not sure why, but the order matters (maybe due to the binary version conflicts for xml/parser combinators pulled in for scaladoc?)
11992
libraryDependencies ++= (
12093
if (TestKeys.includeTestDependencies.value) {
12194
/**
@@ -138,8 +111,8 @@ libraryDependencies ++= (
138111
dep.exclude("org.scala-lang.modules", "scala-xml_2.11.0-M5").
139112
exclude("org.scala-lang.modules", "scala-xml_2.11.0-M4").
140113
exclude("org.scalacheck", "scalacheck_2.11.0-M5")
141-
Seq("org.scala-lang.modules" % "scala-partest-interface_2.11.0-M5" % "0.2" % "partest",
142-
"org.scala-lang.modules" % "scala-partest_2.11.0-M5" % TestKeys.partestVersion.value % "partest").
114+
Seq("org.scala-lang.modules" % "scala-partest-interface_2.11.0-M5" % "0.2" % "test",
115+
"org.scala-lang.modules" % "scala-partest_2.11.0-M5" % TestKeys.partestVersion.value % "test").
143116
map(excludeScalaXml)
144117
}
145118
else Seq.empty

0 commit comments

Comments
 (0)