@@ -220,7 +220,7 @@ lazy val commonSettings = clearSourceAndResourceDirectories ++ publishSettings +
220
220
// directly to stdout
221
221
outputStrategy in run := Some (StdoutOutput ),
222
222
Quiet .silenceScalaBinaryVersionWarning
223
- )
223
+ ) ++ removePomDependencies
224
224
225
225
/** Extra post-processing for the published POM files. These are needed to create POMs that
226
226
* are equivalent to the ones from the ANT build. In the long term this should be removed and
@@ -249,10 +249,16 @@ def fixPom(extra: (String, scala.xml.Node)*): Setting[_] = {
249
249
) ++ extra) }
250
250
}
251
251
252
+ val pomDependencyExclusions =
253
+ settingKey[Seq [(String , String )]](" List of (groupId, artifactId) pairs to exclude from the POM and ivy.xml" )
254
+
255
+ pomDependencyExclusions in Global := Nil
256
+
252
257
/** Remove unwanted dependencies from the POM and ivy.xml. */
253
- def removePomDependencies ( deps : ( String , String ) * ) : Seq [Setting [_]] = Seq (
258
+ lazy val removePomDependencies : Seq [Setting [_]] = Seq (
254
259
pomPostProcess := { n =>
255
260
val n2 = pomPostProcess.value.apply(n)
261
+ val deps = pomDependencyExclusions.value
256
262
import scala .xml ._
257
263
import scala .xml .transform ._
258
264
new RuleTransformer (new RewriteRule {
@@ -270,6 +276,7 @@ def removePomDependencies(deps: (String, String)*): Seq[Setting[_]] = Seq(
270
276
import scala .xml ._
271
277
import scala .xml .transform ._
272
278
val f = deliverLocal.value
279
+ val deps = pomDependencyExclusions.value
273
280
val e = new RuleTransformer (new RewriteRule {
274
281
override def transform (node : Node ) = node match {
275
282
case e : Elem if e.label == " dependency" && {
@@ -366,10 +373,10 @@ lazy val library = configureAsSubproject(project)
366
373
" /project/name" -> <name >Scala Library </name >,
367
374
" /project/description" -> <description >Standard library for the Scala Programming Language </description >,
368
375
" /project/packaging" -> <packaging >jar</packaging >
369
- )
376
+ ),
377
+ // Remove the dependency on "forkjoin" from the POM because it is included in the JAR:
378
+ pomDependencyExclusions += ((organization.value, " forkjoin" ))
370
379
)
371
- // Remove the dependency on "forkjoin" from the POM because it is included in the JAR:
372
- .settings(removePomDependencies((" org.scala-lang" , " forkjoin" )): _* )
373
380
.settings(filterDocSources(" *.scala" -- (regexFileFilter(" .*/runtime/.*\\ $\\ .scala" ) ||
374
381
regexFileFilter(" .*/runtime/ScalaRunTime\\ .scala" ) ||
375
382
regexFileFilter(" .*/runtime/StringAdd\\ .scala" ))): _* )
@@ -451,12 +458,9 @@ lazy val compiler = configureAsSubproject(project)
451
458
" /project/description" -> <description >Compiler for the Scala Programming Language </description >,
452
459
" /project/packaging" -> <packaging >jar</packaging >
453
460
),
454
- apiURL := None
461
+ apiURL := None ,
462
+ pomDependencyExclusions ++= List ((" org.apache.ant" , " ant" ), (" org.scala-lang.modules" , " scala-asm" ))
455
463
)
456
- .settings(removePomDependencies(
457
- (" org.apache.ant" , " ant" ),
458
- (" org.scala-lang.modules" , " scala-asm" )
459
- ): _* )
460
464
.dependsOn(library, reflect)
461
465
462
466
lazy val interactive = configureAsSubproject(project)
0 commit comments