This repository was archived by the owner on May 19, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
src/main/resources/META-INF/gradle-plugins Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -2,31 +2,39 @@ package com.github.jrubygradle.jar.bootstrap;
2
2
3
3
import org.jruby.embed.ScriptingContainer;
4
4
import static org.jruby.embed.PathType.*;
5
+ import org.jruby.CompatVersion;
5
6
6
7
class JarMain {
7
8
8
9
private JarMain(String[] args) throws Exception {
9
10
container = new ScriptingContainer();
10
11
container.setArgv(args);
12
+
13
+ // TODO: Do we need to do anything extra for load paths ?
11
14
// List<String> loadPaths = new ArrayList();
12
15
// loadPaths.add(jrubyhome);
13
- // Ruby Version
14
- // container.setCompatVersion(CompatVersion.%%RUBY_COMPAT_VERSION%%);
15
- // RubyInstanceConfig config = container.getProvider().getRubyInstanceConfig();
16
16
17
+ // TODO: Allow compatinility version to be set
18
+ // CompatVersion cv = CompatVersion.getVersionFromString("%%RUBY_COMPAT_VERSION%%");
19
+ // if(cv != null) {
20
+ // container.setCompatVersion(cv);
21
+ // }
22
+
23
+ // TODO: Do we need to do seomthign extra for environment control?
17
24
// container.setEnvironment(Map environment)
18
25
19
26
}
20
27
21
28
private int run() {
22
29
try {
23
- Object outcome = container.runScriptlet(LAUNCH_SCRIPT /*, RELATIVE|CLASSPATH */ );
30
+ Object outcome = container.runScriptlet(LAUNCH_SCRIPT);
24
31
return ( outcome instanceof Number ) ? ( (Number) outcome ).intValue() : 0;
25
32
} finally {
26
33
container.terminate();
27
34
}
28
35
}
29
36
37
+ // TODO. Allow this to be changes via a system property at run-time
30
38
private static final String LAUNCH_SCRIPT = "load '%%LAUNCH_SCRIPT%%'";
31
39
32
40
private ScriptingContainer container;
You can’t perform that action at this time.
0 commit comments