summaryrefslogtreecommitdiff
path: root/src/jline
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-05-29 18:40:29 +0000
committerPaul Phillips <paulp@improving.org>2011-05-29 18:40:29 +0000
commit46897927575bf25e8d2a1816b0e084bd3ceaf09f (patch)
treeaad8af3c19d01a98b0e46a9435a1b9aec284d293 /src/jline
parent3adaa37cd2fc40deeb58ce9da9015f329d9c254e (diff)
downloadscala-46897927575bf25e8d2a1816b0e084bd3ceaf09f.tar.gz
scala-46897927575bf25e8d2a1816b0e084bd3ceaf09f.tar.bz2
scala-46897927575bf25e8d2a1816b0e084bd3ceaf09f.zip
Updated jline build to use xsbt 0.9.9 and rebui...
Updated jline build to use xsbt 0.9.9 and rebuilt, no review.
Diffstat (limited to 'src/jline')
-rw-r--r--src/jline/TEST-NOTE.txt4
-rw-r--r--src/jline/build.sbt49
-rwxr-xr-xsrc/jline/manual-test.sh8
-rw-r--r--src/jline/project/build.properties8
-rw-r--r--src/jline/project/build/JlineProject.scala35
-rw-r--r--src/jline/project/plugins/Plugins.scala5
-rw-r--r--src/jline/project/plugins/build.sbt5
-rw-r--r--src/jline/project/plugins/project/build.properties3
-rw-r--r--src/jline/src/main/java/scala/tools/jline/console/ConsoleReader.java9
-rw-r--r--src/jline/src/test/java/scala/tools/jline/console/ConsoleReaderTestSupport.java1
10 files changed, 72 insertions, 55 deletions
diff --git a/src/jline/TEST-NOTE.txt b/src/jline/TEST-NOTE.txt
deleted file mode 100644
index 04f5de8dc1..0000000000
--- a/src/jline/TEST-NOTE.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Apparently the jline bundled with sbt interferes with testing some changes: for instance after changing the keybindings I kept seeing failures until I realized what was happening, and bypassed sbt, e.g.
-
-% java -cp ./lib_managed/scala_2.9.0/compile/jansi-1.4.jar:./lib_managed/scala_2.9.0/test/'*':./target/scala_2.9.0/classes:./target/scala_2.9.0/test-classes:./target/scala_2.9.0/resources org.junit.runner.JUnitCore scala.tools.jline.console.EditLineTest
-
diff --git a/src/jline/build.sbt b/src/jline/build.sbt
new file mode 100644
index 0000000000..4fc3bab28a
--- /dev/null
+++ b/src/jline/build.sbt
@@ -0,0 +1,49 @@
+seq(ProguardPlugin.proguardSettings :_*)
+
+name := "jline"
+
+organization := "org.scala-lang"
+
+version := "2.10.0-SNAPSHOT"
+
+scalaVersion := "2.9.0-1"
+
+// Only need these because of weird testing jline issues.
+retrieveManaged := true
+
+parallelExecution in Test := false
+
+libraryDependencies ++= Seq(
+ "org.fusesource.jansi" % "jansi" % "1.4",
+ "com.novocode" % "junit-interface" % "0.7" % "test->default"
+)
+
+javacOptions ++= Seq("-target", "1.5")
+
+proguardOptions ++= Seq(
+ "-dontshrink",
+ "-keep class *",
+ "-keepdirectories"
+)
+
+proguardInJars := Nil
+
+makeInJarFilter ~= { prevFilter =>
+ val jansiFilter = List(
+ "!META-INF/MANIFEST.MF",
+ "org/fusesource/hawtjni/runtime",
+ "org/fusesource/hawtjni/runtime/Callback.class",
+ "org/fusesource/hawtjni/runtime/Library.class",
+ "!org/fusesource/hawtjni/**",
+ "!META-INF/maven/org.fusesource.hawtjni",
+ "!META-INF/maven/org.fusesource.jansi",
+ "!META-INF/maven/org.fusesource.hawtjni/**",
+ "!META-INF/maven/org.fusesource.jansi/**"
+ ).mkString(",")
+ // In sbt 0.9.8 the scala-library.jar line was not necessary,
+ // but in 0.9.9 it started showing up here. Who knows.
+ file =>
+ if (file startsWith "jansi-") jansiFilter
+ else if (file == "scala-library.jar") "!**"
+ else prevFilter(file)
+}
diff --git a/src/jline/manual-test.sh b/src/jline/manual-test.sh
new file mode 100755
index 0000000000..aa5131c903
--- /dev/null
+++ b/src/jline/manual-test.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+#
+# Apparently the jline bundled with sbt interferes with testing some
+# changes: for instance after changing the keybindings I kept seeing
+# failures until I realized what was happening and bypassed sbt, like this.
+
+java -cp lib_managed/jar/com.novocode/junit-interface/junit-interface-0.5.jar:lib_managed/jar/junit/junit/junit-4.8.1.jar:lib_managed/jar/org.fusesource.jansi/jansi/jansi-1.4.jar:lib_managed/jar/org.scala-tools.testing/test-interface/test-interface-0.5.jar:target/scala-2.9.0.1/test-classes:target/scala-2.9.0.1/jline_2.9.0-1-2.10.0-SNAPSHOT.jar \
+org.junit.runner.JUnitCore scala.tools.jline.console.EditLineTest
diff --git a/src/jline/project/build.properties b/src/jline/project/build.properties
deleted file mode 100644
index 0c2795bca5..0000000000
--- a/src/jline/project/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-#Project properties
-#Wed Mar 23 21:05:24 PDT 2011
-project.organization=org.improving
-project.name=jline
-sbt.version=0.7.7
-project.version=0.99-SNAPSHOT
-build.scala.versions=2.9.0
-project.initialize=false
diff --git a/src/jline/project/build/JlineProject.scala b/src/jline/project/build/JlineProject.scala
deleted file mode 100644
index ef1b30c008..0000000000
--- a/src/jline/project/build/JlineProject.scala
+++ /dev/null
@@ -1,35 +0,0 @@
-import sbt._
-
-/** I'm sure much of this is done the hard way, but it's done!
- */
-class JlineProject(info: ProjectInfo) extends DefaultProject(info) with ProguardProject {
- val snapShots = "Snapshots" at "http://scala-tools.org/repo-snapshots/"
- val jansi = "org.fusesource.jansi" % "jansi" % "1.4"
- val junitInterface = "com.novocode" % "junit-interface" % "0.5" % "test->default"
-
- // val junit = "junit" % "junit" % "4.8.1" % "test"
- // lazy val jansiPath = (managedDependencyPath / "compile" ** "jansi*").get.toList.head.absolutePath
-
- override def javaCompileOptions = super.javaCompileOptions ++ javaCompileOptions("-target", "1.5")
-
- override def makeInJarFilter(file: String) = {
- if (!file.startsWith("jansi")) super.makeInJarFilter(file)
- else List(
- "!META-INF/MANIFEST.MF",
- "org/fusesource/hawtjni/runtime",
- "org/fusesource/hawtjni/runtime/Callback.class",
- "org/fusesource/hawtjni/runtime/Library.class",
- "!org/fusesource/hawtjni/**",
- "!META-INF/maven/org.fusesource.hawtjni",
- "!META-INF/maven/org.fusesource.jansi",
- "!META-INF/maven/org.fusesource.hawtjni/**",
- "!META-INF/maven/org.fusesource.jansi/**"
- ) mkString ", "
- }
-
- override def proguardOptions = List(
- "-dontshrink",
- "-keep class *",
- "-keepdirectories"
- )
-}
diff --git a/src/jline/project/plugins/Plugins.scala b/src/jline/project/plugins/Plugins.scala
deleted file mode 100644
index 8c336f0abf..0000000000
--- a/src/jline/project/plugins/Plugins.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-import sbt._
-
-class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
- val proguard = "org.scala-tools.sbt" % "sbt-proguard-plugin" % "0.0.5"
-}
diff --git a/src/jline/project/plugins/build.sbt b/src/jline/project/plugins/build.sbt
new file mode 100644
index 0000000000..0e0f27b1eb
--- /dev/null
+++ b/src/jline/project/plugins/build.sbt
@@ -0,0 +1,5 @@
+resolvers += "Proguard plugin repo" at "http://siasia.github.com/maven2"
+
+libraryDependencies <<= (libraryDependencies, appConfiguration) { (deps, app) =>
+ deps :+ "com.github.siasia" %% "xsbt-proguard-plugin" % app.provider.id.version
+}
diff --git a/src/jline/project/plugins/project/build.properties b/src/jline/project/plugins/project/build.properties
deleted file mode 100644
index 7a06683cda..0000000000
--- a/src/jline/project/plugins/project/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-#Project properties
-#Wed May 25 15:08:22 PDT 2011
-plugin.uptodate=true
diff --git a/src/jline/src/main/java/scala/tools/jline/console/ConsoleReader.java b/src/jline/src/main/java/scala/tools/jline/console/ConsoleReader.java
index 7882fcc1db..9df42708bb 100644
--- a/src/jline/src/main/java/scala/tools/jline/console/ConsoleReader.java
+++ b/src/jline/src/main/java/scala/tools/jline/console/ConsoleReader.java
@@ -1120,6 +1120,15 @@ public class ConsoleReader
return getKeyForAction(op.code);
}
+ public void printBindings() {
+ System.out.println("printBindings(): keyBindings.length = " + keyBindings.length);
+ for (int i = 0; i < keyBindings.length; i++) {
+ if (keyBindings[i] != Operation.UNKNOWN.code) {
+ System.out.println("keyBindings[" + i + "] = " + keyBindings[i]);
+ }
+ }
+ }
+
/**
* Reads the console input and returns an array of the form [raw, key binding].
*/
diff --git a/src/jline/src/test/java/scala/tools/jline/console/ConsoleReaderTestSupport.java b/src/jline/src/test/java/scala/tools/jline/console/ConsoleReaderTestSupport.java
index 04e98e5bcb..c19099f0b2 100644
--- a/src/jline/src/test/java/scala/tools/jline/console/ConsoleReaderTestSupport.java
+++ b/src/jline/src/test/java/scala/tools/jline/console/ConsoleReaderTestSupport.java
@@ -65,6 +65,7 @@ public abstract class ConsoleReaderTestSupport
int action = console.getKeyForAction(logicalAction);
if (action == -1) {
+ console.printBindings();
fail("Keystroke for logical action " + logicalAction + " was not bound in the console");
}