aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazuyoshi Kato <kato.kazuyoshi@gmail.com>2016-06-24 08:17:35 -0700
committerKazuyoshi Kato <kato.kazuyoshi@gmail.com>2016-07-27 06:54:27 -0700
commit8e55954654596c965f220154a5f557e49463fa81 (patch)
treebfb378355fda438709c35da75b4758d387b586ad
parent5ffce6e910f4cc1fced15824df86a9524be81681 (diff)
downloaddotty-8e55954654596c965f220154a5f557e49463fa81.tar.gz
dotty-8e55954654596c965f220154a5f557e49463fa81.tar.bz2
dotty-8e55954654596c965f220154a5f557e49463fa81.zip
Fixes #1316: Remove JLine
Dotty uses ammonite.terminal since April (53bd25f) which replaces JLine. There is no reason to keep it anymore.
-rwxr-xr-xbin/common5
-rwxr-xr-xbin/dotc7
-rw-r--r--project/Build.scala1
-rw-r--r--src/dotty/tools/dotc/config/ScalaSettings.scala1
-rw-r--r--src/dotty/tools/dotc/repl/InteractiveReader.scala13
-rw-r--r--src/dotty/tools/dotc/repl/JLineReader.scala16
-rw-r--r--src/dotty/tools/dotc/repl/Main.scala3
-rw-r--r--src/dotty/tools/dotc/repl/REPL.scala2
-rw-r--r--test/test/ShowClassTests.scala5
9 files changed, 7 insertions, 46 deletions
diff --git a/bin/common b/bin/common
index 9b8b7a4da..dcfb5cc1f 100755
--- a/bin/common
+++ b/bin/common
@@ -11,7 +11,6 @@ function getLastStringOnLineWith {
SCALA_VERSION=$(getLastStringOnLineWith "scalaVersion in")
SCALA_BINARY_VERSION=2.11
SCALA_COMPILER_VERSION=$(getLastStringOnLineWith "scala-compiler")
-JLINE_VERSION=$(getLastStringOnLineWith "jline")
SBT_VERSION=$(grep "sbt.version=" "$DOTTY_ROOT/project/build.properties" | sed 's/sbt.version=//')
bootcp=true
bootstrapped=false
@@ -129,10 +128,6 @@ if [ "$SCALA_COMPILER_JAR" == "" ]; then
SCALA_COMPILER_JAR=$(find_jar "$HOME/.ivy2/cache/me.d-d/scala-compiler/jars" "scala-compiler-$SCALA_COMPILER_VERSION.jar")
fi
-if [ "$JLINE_JAR" == "" ]; then
- JLINE_JAR=$(find_jar "$HOME/.ivy2/cache/jline/jline/jars" "jline-$JLINE_VERSION.jar")
-fi
-
if [ "$SBT_INTERFACE_JAR" == "" ]; then
SBT_INTERFACE_JAR=$(find_jar "$HOME/.ivy2/cache/org.scala-sbt/interface/jars" "interface-$SBT_VERSION.jar")
fi
diff --git a/bin/dotc b/bin/dotc
index f604483c1..3a988a897 100755
--- a/bin/dotc
+++ b/bin/dotc
@@ -19,13 +19,12 @@ CompilerMain=dotty.tools.dotc.Main
FromTasty=dotty.tools.dotc.FromTasty
ReplMain=dotty.tools.dotc.repl.Main
-if [ ! -f "$SCALA_LIBRARY_JAR" -o ! -f "$SCALA_REFLECT_JAR" -o ! -f "$SCALA_COMPILER_JAR" -o ! -f "$JLINE_JAR" -o ! -f "$SBT_INTERFACE_JAR" ]
+if [ ! -f "$SCALA_LIBRARY_JAR" -o ! -f "$SCALA_REFLECT_JAR" -o ! -f "$SCALA_COMPILER_JAR" -o ! -f "$SBT_INTERFACE_JAR" ]
then
echo To use this script please set
echo SCALA_LIBRARY_JAR to point to scala-library-$SCALA_VERSION.jar "(currently $SCALA_LIBRARY_JAR)"
echo SCALA_REFLECT_JAR to point to scala-reflect-$SCALA_VERSION.jar "(currently $SCALA_REFLECT_JAR)"
echo SCALA_COMPILER_JAR to point to scala-compiler-$SCALA_VERSION.jar with bcode patches "(currently $SCALA_COMPILER_JAR)"
- echo JLINE_JAR to point to jline-$JLINE_VERSION.jar "(currently $JLINE_JAR)"
echo SBT_INTERFACE_JAR to point to interface-$SBT_VERSION.jar "(currently $SBT_INTERFACE_JAR)"
fi
@@ -116,9 +115,9 @@ trap onExit INT
classpathArgs () {
if [[ "true" == $bootstrapped ]]; then
check_jar "dotty-bootstrapped" $DOTTY_JAR "target" 'build_jar "test:runMain dotc.build" target' &> /dev/null
- toolchain="$DOTTY_JAR:$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$JLINE_JAR:$SBT_INTERFACE_JAR"
+ toolchain="$DOTTY_JAR:$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$SBT_INTERFACE_JAR"
else
- toolchain="$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$JLINE_JAR:$SBT_INTERFACE_JAR"
+ toolchain="$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$SBT_INTERFACE_JAR"
fi
bcpJars="$INTERFACES_JAR:$MAIN_JAR"
cpJars="$INTERFACES_JAR:$MAIN_JAR:$TEST_JAR"
diff --git a/project/Build.scala b/project/Build.scala
index f57c30e7d..a4e6551d7 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -99,7 +99,6 @@ object DottyBuild extends Build {
libraryDependencies ++= Seq("org.scala-lang.modules" %% "scala-xml" % "1.0.1",
"org.scala-lang.modules" %% "scala-partest" % "1.0.11" % "test",
"com.novocode" % "junit-interface" % "0.11" % "test",
- "jline" % "jline" % "2.12",
"com.googlecode.java-diff-utils" % "diffutils" % "1.3.0",
"com.typesafe.sbt" % "sbt-interface" % sbtVersion.value),
// enable improved incremental compilation algorithm
diff --git a/src/dotty/tools/dotc/config/ScalaSettings.scala b/src/dotty/tools/dotc/config/ScalaSettings.scala
index 1c1c72671..d0c4cc02c 100644
--- a/src/dotty/tools/dotc/config/ScalaSettings.scala
+++ b/src/dotty/tools/dotc/config/ScalaSettings.scala
@@ -74,7 +74,6 @@ class ScalaSettings extends Settings.SettingGroup {
val maxClassfileName = IntSetting("-Xmax-classfile-name", "Maximum filename length for generated classes", 255, 72 to 255)
val Xmigration = VersionSetting("-Xmigration", "Warn about constructs whose behavior may have changed since version.")
val Xsource = VersionSetting("-Xsource", "Treat compiler input as Scala source for the specified version.")
- val Xnojline = BooleanSetting("-Xnojline", "Do not use JLine for editing.")
val Xverify = BooleanSetting("-Xverify", "Verify generic signatures in generated bytecode (asm backend only.)")
val plugin = MultiStringSetting("-Xplugin", "file", "Load one or more plugins from files.")
val disable = MultiStringSetting("-Xplugin-disable", "plugin", "Disable the given plugin(s).")
diff --git a/src/dotty/tools/dotc/repl/InteractiveReader.scala b/src/dotty/tools/dotc/repl/InteractiveReader.scala
index 6ec6a0463..07ce23717 100644
--- a/src/dotty/tools/dotc/repl/InteractiveReader.scala
+++ b/src/dotty/tools/dotc/repl/InteractiveReader.scala
@@ -13,17 +13,8 @@ trait InteractiveReader {
/** The current Scala REPL know how to do this flexibly.
*/
object InteractiveReader {
- /** Create an interactive reader. Uses JLine if the
- * library is available, but otherwise uses a
- * SimpleReader. */
+ /** Create an interactive reader */
def createDefault(in: Interpreter)(implicit ctx: Context): InteractiveReader = {
- try {
- new AmmoniteReader(in)
- } catch { case e =>
- //out.println("jline is not available: " + e) //debug
- e.printStackTrace()
- println("Could not use ammonite, falling back to simple reader")
- new SimpleReader()
- }
+ new AmmoniteReader(in)
}
}
diff --git a/src/dotty/tools/dotc/repl/JLineReader.scala b/src/dotty/tools/dotc/repl/JLineReader.scala
deleted file mode 100644
index 73463cd7c..000000000
--- a/src/dotty/tools/dotc/repl/JLineReader.scala
+++ /dev/null
@@ -1,16 +0,0 @@
-package dotty.tools
-package dotc
-package repl
-
-import dotc.core.Contexts.Context
-import jline.console.ConsoleReader
-
-/** Adaptor for JLine
- */
-class JLineReader extends InteractiveReader {
- val reader = new ConsoleReader()
-
- val interactive = true
-
- def readLine(prompt: String) = reader.readLine(prompt)
-}
diff --git a/src/dotty/tools/dotc/repl/Main.scala b/src/dotty/tools/dotc/repl/Main.scala
index b2b92299e..48ed3e788 100644
--- a/src/dotty/tools/dotc/repl/Main.scala
+++ b/src/dotty/tools/dotc/repl/Main.scala
@@ -13,7 +13,6 @@ package repl
*
* There are a number of TODOs:
*
- * - re-enable jline support (urgent, easy, see TODO in InteractiveReader.scala)
* - figure out why we can launch REPL only with `java`, not with `scala`.
* - make a doti command (urgent, easy)
* - create or port REPL tests (urgent, intermediate)
@@ -26,4 +25,4 @@ package repl
* - integrate with presentation compiler for command completion (not urgent, hard)
*/
/** The main entry point of the REPL */
-object Main extends REPL \ No newline at end of file
+object Main extends REPL
diff --git a/src/dotty/tools/dotc/repl/REPL.scala b/src/dotty/tools/dotc/repl/REPL.scala
index cca5e8d6b..dd20852a4 100644
--- a/src/dotty/tools/dotc/repl/REPL.scala
+++ b/src/dotty/tools/dotc/repl/REPL.scala
@@ -90,7 +90,7 @@ object REPL {
def input(in: Interpreter)(implicit ctx: Context): InteractiveReader = {
val emacsShell = System.getProperty("env.emacs", "") != ""
//println("emacsShell="+emacsShell) //debug
- if (ctx.settings.Xnojline.value || emacsShell) new SimpleReader()
+ if (emacsShell) new SimpleReader()
else InteractiveReader.createDefault(in)
}
diff --git a/test/test/ShowClassTests.scala b/test/test/ShowClassTests.scala
index 5187de0bf..d5e59c169 100644
--- a/test/test/ShowClassTests.scala
+++ b/test/test/ShowClassTests.scala
@@ -96,11 +96,6 @@ class ShowClassTests extends DottyTest {
}
@Test
- def loadJavaClasses() = {
- showPackage("scala.tools.jline", 0)
- }
-
- @Test
def loadMoreClasses() = {
showClasses("scala.collection.JavaConversions")
showClasses("scala.collection.convert.Wrappers")