Skip to content

Commit e0d34de

Browse files
authored
Merge pull request #1349 from kzys/jline-remove
Fixes #1316: Remove JLine
2 parents 5ffce6e + 8e55954 commit e0d34de

File tree

9 files changed

+7
-46
lines changed

9 files changed

+7
-46
lines changed

bin/common

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ function getLastStringOnLineWith {
1111
SCALA_VERSION=$(getLastStringOnLineWith "scalaVersion in")
1212
SCALA_BINARY_VERSION=2.11
1313
SCALA_COMPILER_VERSION=$(getLastStringOnLineWith "scala-compiler")
14-
JLINE_VERSION=$(getLastStringOnLineWith "jline")
1514
SBT_VERSION=$(grep "sbt.version=" "$DOTTY_ROOT/project/build.properties" | sed 's/sbt.version=//')
1615
bootcp=true
1716
bootstrapped=false
@@ -129,10 +128,6 @@ if [ "$SCALA_COMPILER_JAR" == "" ]; then
129128
SCALA_COMPILER_JAR=$(find_jar "$HOME/.ivy2/cache/me.d-d/scala-compiler/jars" "scala-compiler-$SCALA_COMPILER_VERSION.jar")
130129
fi
131130

132-
if [ "$JLINE_JAR" == "" ]; then
133-
JLINE_JAR=$(find_jar "$HOME/.ivy2/cache/jline/jline/jars" "jline-$JLINE_VERSION.jar")
134-
fi
135-
136131
if [ "$SBT_INTERFACE_JAR" == "" ]; then
137132
SBT_INTERFACE_JAR=$(find_jar "$HOME/.ivy2/cache/org.scala-sbt/interface/jars" "interface-$SBT_VERSION.jar")
138133
fi

bin/dotc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ CompilerMain=dotty.tools.dotc.Main
1919
FromTasty=dotty.tools.dotc.FromTasty
2020
ReplMain=dotty.tools.dotc.repl.Main
2121

22-
if [ ! -f "$SCALA_LIBRARY_JAR" -o ! -f "$SCALA_REFLECT_JAR" -o ! -f "$SCALA_COMPILER_JAR" -o ! -f "$JLINE_JAR" -o ! -f "$SBT_INTERFACE_JAR" ]
22+
if [ ! -f "$SCALA_LIBRARY_JAR" -o ! -f "$SCALA_REFLECT_JAR" -o ! -f "$SCALA_COMPILER_JAR" -o ! -f "$SBT_INTERFACE_JAR" ]
2323
then
2424
echo To use this script please set
2525
echo SCALA_LIBRARY_JAR to point to scala-library-$SCALA_VERSION.jar "(currently $SCALA_LIBRARY_JAR)"
2626
echo SCALA_REFLECT_JAR to point to scala-reflect-$SCALA_VERSION.jar "(currently $SCALA_REFLECT_JAR)"
2727
echo SCALA_COMPILER_JAR to point to scala-compiler-$SCALA_VERSION.jar with bcode patches "(currently $SCALA_COMPILER_JAR)"
28-
echo JLINE_JAR to point to jline-$JLINE_VERSION.jar "(currently $JLINE_JAR)"
2928
echo SBT_INTERFACE_JAR to point to interface-$SBT_VERSION.jar "(currently $SBT_INTERFACE_JAR)"
3029
fi
3130

@@ -116,9 +115,9 @@ trap onExit INT
116115
classpathArgs () {
117116
if [[ "true" == $bootstrapped ]]; then
118117
check_jar "dotty-bootstrapped" $DOTTY_JAR "target" 'build_jar "test:runMain dotc.build" target' &> /dev/null
119-
toolchain="$DOTTY_JAR:$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$JLINE_JAR:$SBT_INTERFACE_JAR"
118+
toolchain="$DOTTY_JAR:$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$SBT_INTERFACE_JAR"
120119
else
121-
toolchain="$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$JLINE_JAR:$SBT_INTERFACE_JAR"
120+
toolchain="$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$SBT_INTERFACE_JAR"
122121
fi
123122
bcpJars="$INTERFACES_JAR:$MAIN_JAR"
124123
cpJars="$INTERFACES_JAR:$MAIN_JAR:$TEST_JAR"

project/Build.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ object DottyBuild extends Build {
9999
libraryDependencies ++= Seq("org.scala-lang.modules" %% "scala-xml" % "1.0.1",
100100
"org.scala-lang.modules" %% "scala-partest" % "1.0.11" % "test",
101101
"com.novocode" % "junit-interface" % "0.11" % "test",
102-
"jline" % "jline" % "2.12",
103102
"com.googlecode.java-diff-utils" % "diffutils" % "1.3.0",
104103
"com.typesafe.sbt" % "sbt-interface" % sbtVersion.value),
105104
// enable improved incremental compilation algorithm

src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ class ScalaSettings extends Settings.SettingGroup {
7474
val maxClassfileName = IntSetting("-Xmax-classfile-name", "Maximum filename length for generated classes", 255, 72 to 255)
7575
val Xmigration = VersionSetting("-Xmigration", "Warn about constructs whose behavior may have changed since version.")
7676
val Xsource = VersionSetting("-Xsource", "Treat compiler input as Scala source for the specified version.")
77-
val Xnojline = BooleanSetting("-Xnojline", "Do not use JLine for editing.")
7877
val Xverify = BooleanSetting("-Xverify", "Verify generic signatures in generated bytecode (asm backend only.)")
7978
val plugin = MultiStringSetting("-Xplugin", "file", "Load one or more plugins from files.")
8079
val disable = MultiStringSetting("-Xplugin-disable", "plugin", "Disable the given plugin(s).")

src/dotty/tools/dotc/repl/InteractiveReader.scala

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,8 @@ trait InteractiveReader {
1313
/** The current Scala REPL know how to do this flexibly.
1414
*/
1515
object InteractiveReader {
16-
/** Create an interactive reader. Uses JLine if the
17-
* library is available, but otherwise uses a
18-
* SimpleReader. */
16+
/** Create an interactive reader */
1917
def createDefault(in: Interpreter)(implicit ctx: Context): InteractiveReader = {
20-
try {
21-
new AmmoniteReader(in)
22-
} catch { case e =>
23-
//out.println("jline is not available: " + e) //debug
24-
e.printStackTrace()
25-
println("Could not use ammonite, falling back to simple reader")
26-
new SimpleReader()
27-
}
18+
new AmmoniteReader(in)
2819
}
2920
}

src/dotty/tools/dotc/repl/JLineReader.scala

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/dotty/tools/dotc/repl/Main.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ package repl
1313
*
1414
* There are a number of TODOs:
1515
*
16-
* - re-enable jline support (urgent, easy, see TODO in InteractiveReader.scala)
1716
* - figure out why we can launch REPL only with `java`, not with `scala`.
1817
* - make a doti command (urgent, easy)
1918
* - create or port REPL tests (urgent, intermediate)
@@ -26,4 +25,4 @@ package repl
2625
* - integrate with presentation compiler for command completion (not urgent, hard)
2726
*/
2827
/** The main entry point of the REPL */
29-
object Main extends REPL
28+
object Main extends REPL

src/dotty/tools/dotc/repl/REPL.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ object REPL {
9090
def input(in: Interpreter)(implicit ctx: Context): InteractiveReader = {
9191
val emacsShell = System.getProperty("env.emacs", "") != ""
9292
//println("emacsShell="+emacsShell) //debug
93-
if (ctx.settings.Xnojline.value || emacsShell) new SimpleReader()
93+
if (emacsShell) new SimpleReader()
9494
else InteractiveReader.createDefault(in)
9595
}
9696

test/test/ShowClassTests.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ class ShowClassTests extends DottyTest {
9595
showClasses("scala.math.Ordering")
9696
}
9797
98-
@Test
99-
def loadJavaClasses() = {
100-
showPackage("scala.tools.jline", 0)
101-
}
102-
10398
@Test
10499
def loadMoreClasses() = {
105100
showClasses("scala.collection.JavaConversions")

0 commit comments

Comments
 (0)