diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-06-24 15:21:08 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-07-05 16:00:29 -0700 |
commit | 1b0fa91aa3f4d469505e5a1ff5d9cb1db0bdf662 (patch) | |
tree | 14755f21d0b6eeac18c3fe3c29ef361a391204ab | |
parent | 46a4635d3acc0a18869131879e6cde862d6b9776 (diff) | |
download | scala-1b0fa91aa3f4d469505e5a1ff5d9cb1db0bdf662.tar.gz scala-1b0fa91aa3f4d469505e5a1ff5d9cb1db0bdf662.tar.bz2 scala-1b0fa91aa3f4d469505e5a1ff5d9cb1db0bdf662.zip |
Unfork jline: use vanilla jline 2.11 as a dependency.
Notes:
- no longer specifying terminal by class name in scripts (using 'unix')
- jline doesn't need a separate jansi dependency;
it includes its own version according to:
http://mvnrepository.com/artifact/jline/jline/2.11
-rwxr-xr-x | build.xml | 39 | ||||
-rw-r--r-- | lib/jline.jar.desired.sha1 | 1 | ||||
-rw-r--r-- | src/build/bnd/scala-compiler.bnd | 2 | ||||
-rw-r--r-- | src/build/maven/jline-pom.xml | 68 | ||||
-rw-r--r-- | src/build/maven/maven-deploy.xml | 2 | ||||
-rw-r--r-- | src/build/maven/scala-compiler-pom.xml | 4 | ||||
-rw-r--r-- | src/build/pack.xml | 11 | ||||
-rw-r--r-- | src/compiler/scala/tools/ant/templates/tool-unix.tmpl | 2 | ||||
-rw-r--r-- | src/repl/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala | 2 | ||||
-rw-r--r-- | src/repl/scala/tools/nsc/interpreter/Delimited.scala | 2 | ||||
-rw-r--r-- | src/repl/scala/tools/nsc/interpreter/JLineReader.scala | 6 | ||||
-rw-r--r-- | src/repl/scala/tools/nsc/interpreter/session/SimpleHistory.scala | 5 | ||||
-rw-r--r-- | src/repl/scala/tools/nsc/interpreter/session/package.scala | 8 |
13 files changed, 43 insertions, 109 deletions
@@ -123,7 +123,6 @@ TODO: <property name="library.starr.jar" value="${lib.dir}/scala-library.jar"/> <property name="reflect.starr.jar" value="${lib.dir}/scala-reflect.jar"/> <property name="compiler.starr.jar" value="${lib.dir}/scala-compiler.jar"/> - <property name="jline.jar" value="${lib.dir}/jline.jar"/> <property name="ant.jar" value="${ant.home}/lib/ant.jar"/> <property name="scalacheck.jar" value="${lib.dir}/scalacheck.jar"/> @@ -153,6 +152,8 @@ TODO: <property name="copyright.string" value="Copyright 2002-2013, LAMP/EPFL"/> <property name="partest.version.number" value="0.9.3"/> + <property name="jline.version" value="2.11"/> + <!-- These are NOT the flags used to run SuperSabbus, but the ones written into the script runners created with scala.tools.ant.ScalaTool --> <property name="java.flags" value="-Xmx256M -Xms32M"/> @@ -238,6 +239,10 @@ TODO: <dependency groupId="org.scala-tools.testing" artifactId="test-interface" version="0.5" /> </artifact:dependencies> + <artifact:dependencies pathId="repl.deps.classpath" filesetId="repl.deps.fileset" versionsId="repl.deps.versions"> + <dependency groupId="jline" artifactId="jline" version="${jline.version}"/> + </artifact:dependencies> + <!-- BND support --> <typedef resource="aQute/bnd/ant/taskdef.properties" classpathref="extra.tasks.classpath" /> @@ -529,7 +534,7 @@ TODO: <path id="quick.repl.build.path"> <path refid="quick.compiler.build.path"/> <pathelement location="${build-quick.dir}/classes/repl"/> - <pathelement location="${jline.jar}"/> + <path refid="repl.deps.classpath"/> </path> <path id="quick.xml.build.path"> @@ -610,7 +615,7 @@ TODO: <pathelement location="${build-pack.dir}/lib/scala-reflect.jar"/> <pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/> <pathelement location="${build-pack.dir}/lib/scalap.jar"/> - <pathelement location="${build-pack.dir}/lib/jline.jar"/> + <path refid="repl.deps.classpath"/> <path refid="aux.libs"/> </path> @@ -740,7 +745,7 @@ TODO: <pathelement location="${build-palo.dir}/lib/scala-library.jar"/> <pathelement location="${build-palo.dir}/lib/scala-reflect.jar"/> <pathelement location="${build-palo.dir}/lib/scala-compiler.jar"/> - <pathelement location="${build-palo.dir}/lib/jline.jar"/> + <path refid="repl.deps.classpath"/> </path> <path id="test.positions.sub.build.path" path="${build-quick.dir}/classes/library"/> @@ -1265,7 +1270,10 @@ TODO: <target name="pack.comp" depends="quick.comp, quick.scaladoc, quick.interactive, quick.repl, asm.done"> <staged-pack project="compiler" manifest="${build-pack.dir}/META-INF/MANIFEST.MF"> <pre> <!-- TODO the files copied here do not influence actuality of this target (nor does the manifest) --> - <copy file="${jline.jar}" toDir="${build-pack.dir}/lib"/> + <copy todir="${build-pack.dir}/lib"> + <resources refid="repl.deps.fileset"/> + <mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper" from="${repl.deps.versions}" to="flatten"/> + </copy> <copy todir="${build-pack.dir}/lib"> <fileset dir="${lib-extra.dir}"> <include name="**/*.jar"/> @@ -1340,7 +1348,10 @@ TODO: <fileset dir="${build-locker.dir}/classes/compiler"/> <fileset dir="${asm-classes}"/> </jar> - <copy file="${jline.jar}" toDir="${build-palo.dir}/lib"/> + <copy todir="${build-palo.dir}/lib"> + <resources refid="repl.deps.fileset"/> + <mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper" from="${repl.deps.versions}" to="flatten"/> + </copy> </target> <target name="palo.bin" depends="palo.done"> <staged-bin stage="palo"/></target> @@ -1738,13 +1749,6 @@ TODO: </staged-docs> </target> - <target name="docs.jline" depends="docs.start"> - <staged-docs project="jline" dir="jline/src/main/java" title="Scala JLine"> - <include name="**/*.scala"/> - <include name="**/*.java"/> - </staged-docs> - </target> - <target name="docs.scalap" depends="docs.start"> <staged-docs project="scalap" title="Scalap"> <include name="**/*.scala"/> @@ -1800,7 +1804,7 @@ TODO: </staged-uptodate> </target> - <target name="docs.done" depends="docs.jline, docs.comp, docs.man, docs.lib, docs.xml, docs.parser-combinators, docs.scalap, docs.partest, docs.continuations-plugin"/> + <target name="docs.done" depends="docs.comp, docs.man, docs.lib, docs.xml, docs.parser-combinators, docs.scalap, docs.partest, docs.continuations-plugin"/> <!-- =========================================================================== DISTRIBUTION @@ -1828,7 +1832,6 @@ TODO: <mkdir dir="${dist.dir}/lib"/> <copy toDir="${dist.dir}/lib"> <fileset dir="${build-pack.dir}/lib"> - <include name="jline.jar"/> <include name="scalacheck.jar"/> <include name="scala-partest.jar"/> <include name="scalap.jar"/> @@ -1841,6 +1844,12 @@ TODO: from="${partest.extras.versions}" to="flatten"/> </copy> + <copy todir="${dist.dir}/lib"> + <resources refid="repl.deps.fileset"/> + <mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper" + from="${repl.deps.versions}" to="flatten"/> + </copy> + <mkdir dir="${dist.dir}/bin"/> <!-- TODO - Stop being inefficient and don't copy OSGi bundles overtop other jars. --> <copy-bundle name="scala-library"/> diff --git a/lib/jline.jar.desired.sha1 b/lib/jline.jar.desired.sha1 deleted file mode 100644 index 1eb994cf1b..0000000000 --- a/lib/jline.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -e87ad04fdffb5cd9b7aa9293596d9fdde086eccd ?jline.jar diff --git a/src/build/bnd/scala-compiler.bnd b/src/build/bnd/scala-compiler.bnd index c289843447..dc30513db4 100644 --- a/src/build/bnd/scala-compiler.bnd +++ b/src/build/bnd/scala-compiler.bnd @@ -3,6 +3,6 @@ Bundle-SymbolicName: org.scala-lang.scala-compiler ver: @VERSION@ Bundle-Version: ${ver} Export-Package: *;version=${ver} -Import-Package: scala.tools.jline.*;resolution:=optional, \ +Import-Package: jline.*;resolution:=optional, \ org.apache.tools.ant.*;resolution:=optional, \ * diff --git a/src/build/maven/jline-pom.xml b/src/build/maven/jline-pom.xml deleted file mode 100644 index 0d6e801551..0000000000 --- a/src/build/maven/jline-pom.xml +++ /dev/null @@ -1,68 +0,0 @@ -<project - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.scala-lang</groupId> - <artifactId>jline</artifactId> - <packaging>jar</packaging> - <version>@VERSION@</version> - <name>jline</name> - <description>Like readline, but better</description> - <url>http://www.scala-lang.org/</url> - <inceptionYear>2011</inceptionYear> - <organization> - <name>LAMP/EPFL</name> - <url>http://lamp.epfl.ch/</url> - </organization> - <licenses> - <license> - <name>BSD-like</name> - <url>http://www.scala-lang.org/downloads/license.html - </url> - <distribution>repo</distribution> - </license> - <license> - <name>The BSD License</name> - <url>http://www.opensource.org/licenses/bsd-license.php</url> - <distribution>repo</distribution> - </license> - </licenses> - <scm> - <connection>scm:git:git://github.com/scala/scala.git</connection> - <url>https://github.com/scala/scala.git</url> - </scm> - <issueManagement> - <system>JIRA</system> - <url>https://issues.scala-lang.org/</url> - </issueManagement> - - <dependencies> - <dependency> - <groupId>org.fusesource.jansi</groupId> - <artifactId>jansi</artifactId> - <version>1.4</version> - <!--<scope>provided</scope>--> - </dependency> - </dependencies> - <distributionManagement> - <repository> - <id>scala-tools.org</id> - <url>@RELEASE_REPOSITORY@</url> - </repository> - <snapshotRepository> - <id>scala-tools.org</id> - <url>@SNAPSHOT_REPOSITORY@</url> - <uniqueVersion>false</uniqueVersion> - </snapshotRepository> - </distributionManagement> - <developers> - <developer> - <id>lamp</id> - <name>EPFL LAMP</name> - </developer> - <developer> - <id>Typesafe</id> - <name>Typesafe, Inc.</name> - </developer> - </developers> -</project> diff --git a/src/build/maven/maven-deploy.xml b/src/build/maven/maven-deploy.xml index 7df9a8ec9a..84a12066f5 100644 --- a/src/build/maven/maven-deploy.xml +++ b/src/build/maven/maven-deploy.xml @@ -57,6 +57,7 @@ <filter token="VERSION" value="@{version}" /> <filter token="RELEASE_REPOSITORY" value="${remote.release.repository}" /> <filter token="SNAPSHOT_REPOSITORY" value="${remote.snapshot.repository}" /> + <filter token="JLINE_VERSION" value="${jline.version}" /> </filterset> </copy> <artifact:pom id="@{name}.pom" file="${path}-pom-filtered.xml" /> @@ -104,7 +105,6 @@ <attribute name="signed" default="false"/> <sequential> - <deploy-one name="jline" version="${maven.version.number}" local="@{local}" signed="@{signed}"/> <deploy-one name="scala-actors" version="${maven.version.number}" local="@{local}" signed="@{signed}"/> <deploy-one name="scala-compiler" version="${maven.version.number}" local="@{local}" signed="@{signed}"/> <deploy-one name="scala-library" version="${maven.version.number}" local="@{local}" signed="@{signed}"/> diff --git a/src/build/maven/scala-compiler-pom.xml b/src/build/maven/scala-compiler-pom.xml index fedc34a5d5..4b90997da4 100644 --- a/src/build/maven/scala-compiler-pom.xml +++ b/src/build/maven/scala-compiler-pom.xml @@ -43,9 +43,9 @@ <version>@VERSION@</version> </dependency> <dependency> - <groupId>org.scala-lang</groupId> + <groupId>jline</groupId> <artifactId>jline</artifactId> - <version>@VERSION@</version> + <version>@JLINE_VERSION@</version> <optional>true</optional> </dependency> </dependencies> diff --git a/src/build/pack.xml b/src/build/pack.xml index aac121f828..6b6579ce12 100644 --- a/src/build/pack.xml +++ b/src/build/pack.xml @@ -151,7 +151,6 @@ MAIN DISTRIBUTION PACKAGING </copy> </sequential> </macrodef> - <mvn-copy-lib mvn.artifact.name="jline"/> <mvn-copy-lib mvn.artifact.name="scala-library"/> <mvn-copy-lib mvn.artifact.name="scala-xml"/> <mvn-copy-lib mvn.artifact.name="scala-parser-combinators"/> @@ -183,12 +182,6 @@ MAIN DISTRIBUTION PACKAGING <target name="pack-maven.srcs" depends="pack-maven.libs"> <!-- Add missing src jars. --> - <jar whenmanifestonly="fail" destfile="${dists.dir}/maven/${version.number}/jline/jline-src.jar" - basedir="${src.dir}/jline/src/main/java"> - <include name="**/*"/> - </jar> - - <!-- Continuations plugin --> <jar whenmanifestonly="fail" destfile="${dists.dir}/maven/${version.number}/plugins/continuations/continuations-src.jar" basedir="${src.dir}/continuations/plugin"> @@ -197,10 +190,6 @@ MAIN DISTRIBUTION PACKAGING </target> <target name="pack-maven.docs" depends="pack-maven.libs, pack-maven.plugins"> - <jar whenmanifestonly="fail" destfile="${dists.dir}/maven/${version.number}/jline/jline-docs.jar" - basedir="${build-docs.dir}/jline"> - <include name="**/*"/> - </jar> <jar whenmanifestonly="fail" destfile="${dists.dir}/maven/${version.number}/scala-library/scala-library-docs.jar" basedir="${build-docs.dir}/library"> <include name="**/*"/> diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl index 84ccaba749..abf9925ad9 100644 --- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl +++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl @@ -115,7 +115,7 @@ if [[ -n "$cygwin$mingw" ]]; then case "$TERM" in rxvt* | xterm*) stty -icanon min 1 -echo - WINDOWS_OPT="-Djline.terminal=scala.tools.jline.UnixTerminal" + WINDOWS_OPT="-Djline.terminal=unix" ;; esac fi diff --git a/src/repl/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala b/src/repl/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala index 48af261937..cf03ecb480 100644 --- a/src/repl/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala +++ b/src/repl/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala @@ -6,7 +6,7 @@ package scala.tools.nsc package interpreter -import scala.tools.jline.console.{ ConsoleReader, CursorBuffer } +import jline.console.{ ConsoleReader, CursorBuffer } trait ConsoleReaderHelper extends ConsoleReader { def terminal = getTerminal() diff --git a/src/repl/scala/tools/nsc/interpreter/Delimited.scala b/src/repl/scala/tools/nsc/interpreter/Delimited.scala index e88a044931..b7f06f1d0a 100644 --- a/src/repl/scala/tools/nsc/interpreter/Delimited.scala +++ b/src/repl/scala/tools/nsc/interpreter/Delimited.scala @@ -6,7 +6,7 @@ package scala.tools.nsc package interpreter -import scala.tools.jline.console.completer.ArgumentCompleter.{ ArgumentDelimiter, ArgumentList } +import jline.console.completer.ArgumentCompleter.{ ArgumentDelimiter, ArgumentList } class JLineDelimiter extends ArgumentDelimiter { def toJLine(args: List[String], cursor: Int) = args match { diff --git a/src/repl/scala/tools/nsc/interpreter/JLineReader.scala b/src/repl/scala/tools/nsc/interpreter/JLineReader.scala index 5d41f1bbb4..d8a876feb2 100644 --- a/src/repl/scala/tools/nsc/interpreter/JLineReader.scala +++ b/src/repl/scala/tools/nsc/interpreter/JLineReader.scala @@ -6,8 +6,8 @@ package scala.tools.nsc package interpreter -import scala.tools.jline.console.ConsoleReader -import scala.tools.jline.console.completer._ +import jline.console.ConsoleReader +import jline.console.completer._ import session._ import Completion._ @@ -42,7 +42,7 @@ class JLineReader(_completion: => Completion) extends InteractiveReader { def readOneKey(prompt: String) = { this.print(prompt) this.flush() - this.readVirtualKey() + this.readCharacter() } def eraseLine() = consoleReader.resetPromptLine("", "", 0) def redrawLineAndFlush(): Unit = { flush() ; drawLine() ; flush() } diff --git a/src/repl/scala/tools/nsc/interpreter/session/SimpleHistory.scala b/src/repl/scala/tools/nsc/interpreter/session/SimpleHistory.scala index 89998e438a..7c49b91296 100644 --- a/src/repl/scala/tools/nsc/interpreter/session/SimpleHistory.scala +++ b/src/repl/scala/tools/nsc/interpreter/session/SimpleHistory.scala @@ -46,6 +46,11 @@ class SimpleHistory extends JLineHistory { def entries(): JListIterator[JEntry] = toEntries().asJava.listIterator() def iterator: JIterator[JEntry] = toEntries().iterator.asJava + def remove(idx: Int): CharSequence = buf remove idx + def removeFirst(): CharSequence = buf remove 0 + def removeLast(): CharSequence = buf remove lastIndex + def set(idx: Int, to: CharSequence): Unit = buf(idx) = to + def current() = if (index >= 0 && index < buf.size) buf(index) else fail("current()") def previous() = (index > 0) && minusOne def next() = (index <= lastIndex) && plusOne diff --git a/src/repl/scala/tools/nsc/interpreter/session/package.scala b/src/repl/scala/tools/nsc/interpreter/session/package.scala index c62cf21151..a3d7312c98 100644 --- a/src/repl/scala/tools/nsc/interpreter/session/package.scala +++ b/src/repl/scala/tools/nsc/interpreter/session/package.scala @@ -14,10 +14,10 @@ package object session { type JIterator[T] = java.util.Iterator[T] type JListIterator[T] = java.util.ListIterator[T] - type JEntry = scala.tools.jline.console.history.History.Entry - type JHistory = scala.tools.jline.console.history.History - type JMemoryHistory = scala.tools.jline.console.history.MemoryHistory - type JPersistentHistory = scala.tools.jline.console.history.PersistentHistory + type JEntry = jline.console.history.History.Entry + type JHistory = jline.console.history.History + type JMemoryHistory = jline.console.history.MemoryHistory + type JPersistentHistory = jline.console.history.PersistentHistory private[interpreter] implicit def charSequenceFix(x: CharSequence): String = x.toString } |