Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adds JSR223 spi config to jar archives

  • Loading branch information...
commit 41f22fb2d3f541f36d6a111d790772289f379c40 1 parent 6495cc4
@yokolet yokolet authored
View
13 build.xml
@@ -297,6 +297,9 @@
<zipfileset src="${build.lib.dir}/yydebug.jar"/>
<zipfileset src="${build.lib.dir}/nailgun-0.7.1.jar"/>
<zipfileset src="${build.lib.dir}/emma.jar"/>
+ <metainf dir="${base.dir}/spi">
+ <include name="services/**"/>
+ </metainf>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="org.jruby.Main"/>
@@ -314,6 +317,7 @@
<exclude name="**/AnnotationBinder*.class"/>
<exclude name="**/InvokerGenerator.class"/>
<exclude name="org/jruby/ext/ffi/**/*"/>
+ <exclude name="org/jruby/embed/**/*"/>
</fileset>
<zipfileset src="${build.lib.dir}/asm-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-util-3.2.jar"/>
@@ -367,6 +371,9 @@
<zipfileset src="${build.lib.dir}/dynalang-0.3.jar"/>
<zipfileset src="${build.lib.dir}/yydebug.jar"/>
<zipfileset src="${build.lib.dir}/nailgun-0.7.1.jar"/>
+ <metainf dir="${base.dir}/spi">
+ <include name="services/**"/>
+ </metainf>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="org.jruby.Main"/>
@@ -461,6 +468,9 @@
<zipfileset src="${build.lib.dir}/yydebug.jar"/>
<zipfileset src="${build.lib.dir}/nailgun-0.7.1.jar"/>
<zipfileset src="${shared.lib.dir}/yecht.jar"/>
+ <metainf dir="${base.dir}/spi">
+ <include name="services/**"/>
+ </metainf>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="${mainclass}"/>
@@ -548,6 +558,9 @@
<zipfileset src="${build.lib.dir}/yydebug.jar"/>
<zipfileset src="${build.lib.dir}/nailgun-0.7.1.jar"/>
<zipfileset src="${shared.lib.dir}/yecht.jar"/>
+ <metainf dir="${base.dir}/spi">
+ <include name="services/**"/>
+ </metainf>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="${mainclass}"/>
View
27 nbproject/project.xml
@@ -210,5 +210,32 @@
<source-level>1.5</source-level>
</compilation-unit>
</java-data>
+ <preferences xmlns="http://www.netbeans.org/ns/auxiliary-configuration-preferences/1">
+ <module name="org-netbeans-modules-editor-indent">
+ <node name="CodeStyle">
+ <node name="project">
+ <property name="spaces-per-tab" value="2"/>
+ <property name="expand-tabs" value="true"/>
+ <property name="text-limit-width" value="80"/>
+ <property name="indent-shift-width" value="2"/>
+ <property name="tab-size" value="2"/>
+ </node>
+ <property name="usedProfile" value="project"/>
+ </node>
+ <node name="text">
+ <node name="x-java">
+ <node name="CodeStyle">
+ <node name="project">
+ <property name="spaces-per-tab" value="4"/>
+ <property name="expand-tabs" value="true"/>
+ <property name="text-limit-width" value="80"/>
+ <property name="indent-shift-width" value="4"/>
+ <property name="tab-size" value="4"/>
+ </node>
+ </node>
+ </node>
+ </node>
+ </module>
+ </preferences>
</configuration>
</project>
View
1  spi/services/javax.script.ScriptEngineFactory
@@ -0,0 +1 @@
+org.jruby.embed.jsr223.JRubyEngineFactory
View
2  src/org/jruby/embed/PathType.java
@@ -47,7 +47,7 @@
*
* <pre>
* ScriptingContainer container = new ScriptingContainer();
- * container.setAttribute(Attribute.BASE_DIR, System.getProperty("user.dir"));
+ * container.setAttribute(AttributeName.BASE_DIR, System.getProperty("user.dir"));
* String filename = "test/ruby/iteration.rb";
* Object receiver = container.runScriptlet(PathType.RELATIVE, filename);</pre>
*/
View
4 src/org/jruby/embed/internal/EmbedRubyRuntimeAdapterImpl.java
@@ -49,6 +49,7 @@
import org.jruby.embed.PathType;
import org.jruby.embed.ScriptingContainer;
import org.jruby.embed.io.ReaderInputStream;
+import org.jruby.embed.util.SystemPropertyCatcher;
import org.jruby.exceptions.RaiseException;
import org.jruby.javasupport.JavaEmbedUtils;
import org.jruby.javasupport.JavaEmbedUtils.EvalUnit;
@@ -102,6 +103,9 @@ public EmbedEvalUnit parse(PathType type, String filename, int... lines) {
break;
case RELATIVE:
String basedir = (String) container.getAttribute(AttributeName.BASE_DIR);
+ if (basedir == null) {
+ basedir = SystemPropertyCatcher.getBaseDir();
+ }
String absolutePath = basedir + File.separator + filename;
istream = new FileInputStream(absolutePath);
break;
View
8 src/org/jruby/embed/util/SystemPropertyCatcher.java
@@ -149,4 +149,12 @@ public static boolean isRuby19(String name) {
return false;
}
}
+
+ public static String getBaseDir() {
+ String baseDir = System.getenv("PWD");
+ if (baseDir == null || "/".equals(baseDir)) {
+ baseDir = System.getProperty("user.dir");
+ }
+ return baseDir;
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.