@@ -112,6 +112,8 @@ globalVersionSettings
112
112
baseVersion in Global := " 2.12.0"
113
113
baseVersionSuffix in Global := " SNAPSHOT"
114
114
115
+ embedJLine in Global := true
116
+
115
117
lazy val commonSettings = clearSourceAndResourceDirectories ++ publishSettings ++ Seq [Setting [_]](
116
118
organization := " org.scala-lang" ,
117
119
scalaVersion := bootstrapScalaVersion,
@@ -206,7 +208,9 @@ lazy val commonSettings = clearSourceAndResourceDirectories ++ publishSettings +
206
208
207
209
// Don't log process output (e.g. of forked `compiler/runMain ...Main`), just pass it
208
210
// directly to stdout
209
- outputStrategy in run := Some (StdoutOutput )
211
+ outputStrategy in run := Some (StdoutOutput ),
212
+ Quiet .silenceScalaBinaryVersionWarning,
213
+ Quiet .silenceIvyUpdateInfoLogging
210
214
)
211
215
212
216
/** Extra post-processing for the published POM files. These are needed to create POMs that
@@ -442,30 +446,33 @@ lazy val replJlineEmbedded = Project("repl-jline-embedded", file(".") / "target"
442
446
// This is different from the ant build where all parts are combined into quick/repl, but
443
447
// it is cleaner because it avoids circular dependencies.
444
448
compile in Compile <<= (compile in Compile ).dependsOn(Def .task {
445
- import java .util .jar ._
446
- import collection .JavaConverters ._
447
- val inputs : Iterator [JarJar .Entry ] = {
448
- val repljlineClasses = (products in Compile in replJline).value.flatMap(base => Path .allSubpaths(base).map(x => (base, x._1)))
449
- val jlineJAR = (dependencyClasspath in Compile ).value.find(_.get(moduleID.key) == Some (jlineDep)).get.data
450
- val jarFile = new JarFile (jlineJAR)
451
- val jarEntries = jarFile.entries.asScala.filterNot(_.isDirectory).map(entry => JarJar .JarEntryInput (jarFile, entry))
452
- def compiledClasses = repljlineClasses.iterator.map { case (base, file) => JarJar .FileInput (base, file) }
453
- (jarEntries ++ compiledClasses).filter(x =>
454
- x.name.endsWith(" .class" ) || x.name.endsWith(" .properties" ) || x.name.startsWith(" META-INF/native" ) || x.name.startsWith(" META-INF/maven" )
449
+ if (embedJLine.value) {
450
+ import java .util .jar ._
451
+ import collection .JavaConverters ._
452
+ val inputs : Iterator [JarJar .Entry ] = {
453
+ val repljlineClasses = (products in Compile in replJline).value.flatMap(base => Path .allSubpaths(base).map(x => (base, x._1)))
454
+ val jlineJAR = (dependencyClasspath in Compile ).value.find(_.get(moduleID.key) == Some (jlineDep)).get.data
455
+ val jarFile = new JarFile (jlineJAR)
456
+ val jarEntries = jarFile.entries.asScala.filterNot(_.isDirectory).map(entry => JarJar .JarEntryInput (jarFile, entry))
457
+ def compiledClasses = repljlineClasses.iterator.map { case (base, file) => JarJar .FileInput (base, file) }
458
+ (jarEntries ++ compiledClasses).filter(x =>
459
+ x.name.endsWith(" .class" ) || x.name.endsWith(" .properties" ) || x.name.startsWith(" META-INF/native" ) || x.name.startsWith(" META-INF/maven" )
460
+ )
461
+ }
462
+ import JarJar .JarJarConfig ._
463
+ val config : Seq [JarJar .JarJarConfig ] = Seq (
464
+ Rule (" org.fusesource.**" , " scala.tools.fusesource_embedded.@1" ),
465
+ Rule (" jline.**" , " scala.tools.jline_embedded.@1" ),
466
+ Rule (" scala.tools.nsc.interpreter.jline.**" , " scala.tools.nsc.interpreter.jline_embedded.@1" ),
467
+ Keep (" scala.tools.**" )
455
468
)
469
+ val outdir = (classDirectory in Compile ).value
470
+ JarJar (inputs, outdir, config)
456
471
}
457
- import JarJar .JarJarConfig ._
458
- val config : Seq [JarJar .JarJarConfig ] = Seq (
459
- Rule (" org.fusesource.**" , " scala.tools.fusesource_embedded.@1" ),
460
- Rule (" jline.**" , " scala.tools.jline_embedded.@1" ),
461
- Rule (" scala.tools.nsc.interpreter.jline.**" , " scala.tools.nsc.interpreter.jline_embedded.@1" ),
462
- Keep (" scala.tools.**" )
463
- )
464
- val outdir = (classDirectory in Compile ).value
465
- JarJar (inputs, outdir, config)
466
472
}),
467
473
publishArtifact := false ,
468
474
connectInput in run := true
475
+
469
476
)
470
477
.dependsOn(replJline)
471
478
@@ -662,6 +669,7 @@ lazy val root = (project in file("."))
662
669
)
663
670
.aggregate(library, reflect, compiler, interactive, repl, replJline, replJlineEmbedded,
664
671
scaladoc, scalap, partestExtras, junit, libraryAll, scalaDist).settings(
672
+ Quiet .silenceIvyUpdateInfoLogging,
665
673
sources in Compile := Seq .empty,
666
674
onLoadMessage := """ |*** Welcome to the sbt build definition for Scala! ***
667
675
|This build definition has an EXPERIMENTAL status. If you are not
@@ -728,6 +736,9 @@ lazy val mkBin = taskKey[Seq[File]]("Generate shell script (bash or Windows batc
728
736
lazy val mkQuick = taskKey[Unit ](" Generate a full build, including scripts, in build/quick" )
729
737
lazy val mkPack = taskKey[Unit ](" Generate a full build, including scripts, in build/pack" )
730
738
739
+ // Add `embedJLine in Global := false` to `local.sbt` to silence noise until https://github.com/scala/scala-dev/issues/146 is fixed.
740
+ lazy val embedJLine = settingKey[Boolean ](" Embed a JarJar-shaded copy of JLine and code in interacing repl-jline" )
741
+
731
742
// Defining these settings is somewhat redundant as we also redefine settings that depend on them.
732
743
// However, IntelliJ's project import works better when these are set correctly.
733
744
def clearSourceAndResourceDirectories = Seq (Compile , Test ).flatMap(config => inConfig(config)(Seq (
0 commit comments