diff options
author | Raphael Jolly <rjolly@users.sourceforge.net> | 2016-02-09 22:16:22 +0100 |
---|---|---|
committer | Raphael Jolly <rjolly@users.sourceforge.net> | 2016-05-21 10:40:07 +0200 |
commit | a412ea04ba0ba41dbac469b89e1412f0c56fce3f (patch) | |
tree | 2196a33d3d34068731c2b64f911b39c6e4e2a115 | |
parent | 0d0671ae10ef552d66861248fa087306c960520e (diff) | |
download | scala-a412ea04ba0ba41dbac469b89e1412f0c56fce3f.tar.gz scala-a412ea04ba0ba41dbac469b89e1412f0c56fce3f.tar.bz2 scala-a412ea04ba0ba41dbac469b89e1412f0c56fce3f.zip |
Use jarlister in build
The goal of this change is to exercize the "manifest classpath" mechanism,
meant to bring the compiler its needed classes as resources, listed
in jar manifests, as opposed to files, thus enabling to use the compiler
in sandboxed environments (and also the scripting engine for that matter).
-rw-r--r-- | build.xml | 14 | ||||
-rw-r--r-- | test/files/run/t7843-jsr223-service.scala | 6 | ||||
-rw-r--r-- | test/files/run/t7933.scala | 6 |
3 files changed, 17 insertions, 9 deletions
@@ -279,6 +279,10 @@ TODO: <dependency groupId="com.googlecode.jarjar" artifactId="jarjar" version="1.3"/> </artifact:dependencies> + <artifact:dependencies pathId="jarlister.classpath"> + <dependency groupId="com.github.rjolly" artifactId="jarlister_2.11" version="1.0"/> + </artifact:dependencies> + <!-- JUnit --> <property name="junit.version" value="4.11"/> <artifact:dependencies pathId="junit.classpath" filesetId="junit.fileset"> @@ -867,6 +871,11 @@ TODO: <path refid="aux.libs"/> </path> + <path id="pack.lib.path"> + <pathelement location="${library.jar}"/> + <path refid="jarlister.classpath"/> + </path> + <path id="pack.bin.tool.path"> <pathelement location="${library.jar}"/> <pathelement location="${xml.jar}"/> @@ -1230,7 +1239,10 @@ TODO: <!-- =========================================================================== PACKED QUICK BUILD (PACK) ============================================================================ --> - <target name="pack.lib" depends="quick.lib, forkjoin.done"> <staged-pack project="library"/></target> + <target name="pack.lib" depends="quick.lib, forkjoin.done"> <staged-pack project="library"/> + <taskdef resource="scala/tools/ant/antlib.xml" classpathref="pack.lib.path"/> + <jarlister file="${library.jar}"/> + </target> <target name="pack.reflect" depends="quick.reflect"> <staged-pack project="reflect"/> </target> diff --git a/test/files/run/t7843-jsr223-service.scala b/test/files/run/t7843-jsr223-service.scala index 31112212ea..3c853878ba 100644 --- a/test/files/run/t7843-jsr223-service.scala +++ b/test/files/run/t7843-jsr223-service.scala @@ -1,8 +1,6 @@ -import scala.tools.nsc.interpreter.IMain - object Test extends App { - val engine = new IMain.Factory getScriptEngine() - engine.asInstanceOf[IMain].settings.usejavacp.value = true + val m = new javax.script.ScriptEngineManager() + val engine = m.getEngineByName("scala") engine put ("n", 10) engine eval "1 to n.asInstanceOf[Int] foreach print" } diff --git a/test/files/run/t7933.scala b/test/files/run/t7933.scala index b06dffcd80..58e39dd384 100644 --- a/test/files/run/t7933.scala +++ b/test/files/run/t7933.scala @@ -1,8 +1,6 @@ -import scala.tools.nsc.interpreter.IMain - object Test extends App { - val engine = new IMain.Factory getScriptEngine() - engine.asInstanceOf[IMain].settings.usejavacp.value = true + val m = new javax.script.ScriptEngineManager() + val engine = m.getEngineByName("scala") val res2 = engine.asInstanceOf[javax.script.Compilable] res2 compile "8" eval() val res5 = res2 compile """println("hello") ; 8""" |