@@ -394,7 +394,8 @@ lazy val compiler = configureAsSubproject(project)
394
394
description := " Scala Compiler" ,
395
395
libraryDependencies ++= Seq (antDep, asmDep),
396
396
// These are only needed for the POM:
397
- libraryDependencies ++= Seq (scalaXmlDep, jlineDep % " optional" ),
397
+ // TODO: jline dependency is only needed for the REPL shell, which should move to its own jar
398
+ libraryDependencies ++= Seq (scalaXmlDep, jlineDep),
398
399
buildCharacterPropertiesFile := (resourceManaged in Compile ).value / " scala-buildcharacter.properties" ,
399
400
resourceGenerators in Compile += generateBuildCharacterPropertiesFile.map(file => Seq (file)).taskValue,
400
401
// this a way to make sure that classes from interactive and scaladoc projects
@@ -406,8 +407,7 @@ lazy val compiler = configureAsSubproject(project)
406
407
(products in Compile in packageBin in LocalProject (" interactive" )).value ++
407
408
(products in Compile in packageBin in LocalProject (" scaladoc" )).value ++
408
409
(products in Compile in packageBin in LocalProject (" repl" )).value ++
409
- (products in Compile in packageBin in LocalProject (" repl-jline" )).value ++
410
- (products in Compile in packageBin in LocalProject (" repl-jline-embedded" )).value,
410
+ (products in Compile in packageBin in LocalProject (" repl-frontend" )).value,
411
411
includeFilter in unmanagedResources in Compile :=
412
412
" *.tmpl" | " *.xml" | " *.js" | " *.css" | " *.html" | " *.properties" | " *.swf" |
413
413
" *.png" | " *.gif" | " *.gif" | " *.txt" ,
@@ -466,58 +466,21 @@ lazy val interactive = configureAsSubproject(project)
466
466
lazy val repl = configureAsSubproject(project)
467
467
.settings(disableDocs)
468
468
.settings(disablePublishing)
469
- .settings(
470
- connectInput in run := true ,
471
- run := (run in Compile ).partialInput(" -usejavacp" ).evaluated // Automatically add this so that `repl/run` works without additional arguments.
472
- )
473
469
.dependsOn(compiler, interactive)
474
470
475
- lazy val replJline = configureAsSubproject(Project (" repl-jline " , file(" ." ) / " src" / " repl-jline " ))
471
+ lazy val replFrontend = configureAsSubproject(Project (" repl-frontend " , file(" ." ) / " src" / " repl-frontend " ))
476
472
.settings(disableDocs)
477
473
.settings(disablePublishing)
478
474
.settings(
479
475
libraryDependencies += jlineDep,
480
- name := " scala-repl-jline "
476
+ name := " scala-repl-frontend "
481
477
)
482
- .dependsOn(repl)
483
-
484
- lazy val replJlineEmbedded = Project (" repl-jline-embedded" , file(" ." ) / " target" / " repl-jline-embedded-src-dummy" )
485
- .settings(scalaSubprojectSettings)
486
- .settings(disablePublishing)
487
478
.settings(
488
- name := " scala-repl-jline-embedded" ,
489
- // There is nothing to compile for this project. Instead we use the compile task to create
490
- // shaded versions of repl-jline and jline.jar. dist/mkBin puts all of quick/repl,
491
- // quick/repl-jline and quick/repl-jline-shaded on the classpath for quick/bin scripts.
492
- // This is different from the Ant build where all parts are combined into quick/repl, but
493
- // it is cleaner because it avoids circular dependencies.
494
- compile in Compile := (compile in Compile ).dependsOn(Def .task {
495
- import java .util .jar ._
496
- import collection .JavaConverters ._
497
- val inputs : Iterator [JarJar .Entry ] = {
498
- val repljlineClasses = (products in Compile in replJline).value.flatMap(base => Path .allSubpaths(base).map(x => (base, x._1)))
499
- val jlineJAR = findJar((dependencyClasspath in Compile ).value, jlineDep).get.data
500
- val jarFile = new JarFile (jlineJAR)
501
- val jarEntries = jarFile.entries.asScala.filterNot(_.isDirectory).map(entry => JarJar .JarEntryInput (jarFile, entry))
502
- def compiledClasses = repljlineClasses.iterator.map { case (base, file) => JarJar .FileInput (base, file) }
503
- (jarEntries ++ compiledClasses).filter(x =>
504
- x.name.endsWith(" .class" ) || x.name.endsWith(" .properties" ) || x.name.startsWith(" META-INF/native" ) || x.name.startsWith(" META-INF/maven" )
505
- )
506
- }
507
- import JarJar .JarJarConfig ._
508
- val config : Seq [JarJar .JarJarConfig ] = Seq (
509
- Rule (" org.fusesource.**" , " scala.tools.fusesource_embedded.@1" ),
510
- Rule (" jline.**" , " scala.tools.jline_embedded.@1" ),
511
- Rule (" scala.tools.nsc.interpreter.jline.**" , " scala.tools.nsc.interpreter.jline_embedded.@1" ),
512
- Keep (" scala.tools.**" )
513
- )
514
- val outdir = (classDirectory in Compile ).value
515
- JarJar (inputs, outdir, config)
516
- }).value,
517
- connectInput in run := true
518
-
479
+ connectInput in run := true ,
480
+ run := (run in Compile ).partialInput(" -usejavacp" ).evaluated // Automatically add this so that `repl/run` works without additional arguments.
519
481
)
520
- .dependsOn(replJline)
482
+ .dependsOn(repl)
483
+
521
484
522
485
lazy val scaladoc = configureAsSubproject(project)
523
486
.settings(disableDocs)
@@ -544,7 +507,7 @@ lazy val scalap = configureAsSubproject(project)
544
507
.dependsOn(compiler)
545
508
546
509
lazy val partestExtras = Project (" partest-extras" , file(" ." ) / " src" / " partest-extras" )
547
- .dependsOn(replJlineEmbedded , scaladoc)
510
+ .dependsOn(replFrontend , scaladoc)
548
511
.settings(commonSettings)
549
512
.settings(generatePropertiesFileSettings)
550
513
.settings(clearSourceAndResourceDirectories)
@@ -654,7 +617,7 @@ lazy val partestJavaAgent = Project("partest-javaagent", file(".") / "src" / "pa
654
617
)
655
618
656
619
lazy val test = project
657
- .dependsOn(compiler, interactive, replJlineEmbedded , scalap, partestExtras, partestJavaAgent, scaladoc)
620
+ .dependsOn(compiler, interactive, replFrontend , scalap, partestExtras, partestJavaAgent, scaladoc)
658
621
.configs(IntegrationTest )
659
622
.settings(commonSettings)
660
623
.settings(disableDocs)
@@ -867,15 +830,15 @@ lazy val root: Project = (project in file("."))
867
830
antStyle := false ,
868
831
incOptions := incOptions.value.withNameHashing(! antStyle.value).withAntStyle(antStyle.value)
869
832
)
870
- .aggregate(library, reflect, compiler, interactive, repl, replJline, replJlineEmbedded ,
833
+ .aggregate(library, reflect, compiler, interactive, repl, replFrontend ,
871
834
scaladoc, scalap, partestExtras, junit, scalaDist).settings(
872
835
sources in Compile := Seq .empty,
873
836
onLoadMessage := """ |*** Welcome to the sbt build definition for Scala! ***
874
837
|Check README.md for more information.""" .stripMargin
875
838
)
876
839
877
840
// The following subprojects' binaries are required for building "pack":
878
- lazy val distDependencies = Seq (replJline, replJlineEmbedded , compiler, library, reflect, scalap, scaladoc)
841
+ lazy val distDependencies = Seq (replFrontend , compiler, library, reflect, scalap, scaladoc)
879
842
880
843
lazy val dist = (project in file(" dist" ))
881
844
.settings(commonSettings)
@@ -978,7 +941,7 @@ lazy val mkBinImpl: Def.Initialize[Task[Seq[File]]] = Def.task {
978
941
979
942
streams.value.log.info(s " Creating scripts in $quickOutDir and $packOutDir" )
980
943
981
- mkBin(" scala" , " scala.tools.nsc.MainGenericRunner" , (fullClasspath in Compile in replJlineEmbedded ).value) ++
944
+ mkBin(" scala" , " scala.tools.nsc.MainGenericRunner" , (fullClasspath in Compile in replFrontend ).value) ++
982
945
mkBin(" scalac" , " scala.tools.nsc.Main" , (fullClasspath in Compile in compiler).value) ++
983
946
mkBin(" fsc" , " scala.tools.nsc.CompileClient" , (fullClasspath in Compile in compiler).value) ++
984
947
mkBin(" scaladoc" , " scala.tools.nsc.ScalaDoc" , (fullClasspath in Compile in scaladoc).value) ++
@@ -1009,7 +972,7 @@ watchSources ++= PartestUtil.testFilePaths((baseDirectory in ThisBuild).value, (
1009
972
commands ++= {
1010
973
val commands =
1011
974
List ((" scalac" , " compiler" , " scala.tools.nsc.Main" ),
1012
- (" scala" , " repl-jline-embedded " , " scala.tools.nsc.MainGenericRunner" ),
975
+ (" scala" , " repl-frontend " , " scala.tools.nsc.MainGenericRunner" ),
1013
976
(" scaladoc" , " scaladoc" , " scala.tools.nsc.ScalaDoc" ))
1014
977
1015
978
commands.map {
@@ -1051,8 +1014,7 @@ intellij := {
1051
1014
moduleDeps(partestJavaAgent).value,
1052
1015
moduleDeps(reflect).value,
1053
1016
moduleDeps(repl).value,
1054
- moduleDeps(replJline).value,
1055
- // moduleDeps(replJlineEmbedded).value, // No sources
1017
+ moduleDeps(replFrontend).value,
1056
1018
// moduleDeps(root).value, // No sources
1057
1019
// moduleDeps(scalaDist).value, // No sources
1058
1020
moduleDeps(scalacheck, config = Test ).value,
0 commit comments