Skip to content

Commit

Permalink
[Truffle] Fixed path to built ruby.jar in CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvdrum committed Nov 30, 2016
1 parent 357f40d commit 3204907
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions truffle/src/main/java/org/jruby/truffle/aot/RootedFileVisitor.java
Expand Up @@ -35,20 +35,20 @@ static String rubyJarPath() {
String svmJarPath = RootedFileVisitor.class.getProtectionDomain().getCodeSource().getLocation().getFile();
String parentDir = new File(svmJarPath).getParent();

try {
// First try reading in the primary Ruby binary suite JAR.
File ret = new File(parentDir + "/../mx.imports/binary/jruby/mxbuild/dists/ruby.jar");
final String[] paths = new String[] { parentDir + "/../mx.imports/binary/jruby/mxbuild/dists/ruby.jar", parentDir + "/../../../jruby/mxbuild/dists/ruby.jar", parentDir + "/../../../main/mxbuild/dists/ruby.jar" };

for (String path : paths) {
final File ret = new File(path);
if (ret.exists()) {
return ret.getCanonicalPath();
} else {
// Fallback to the locally built source suite JAR.
return new File(parentDir + "/../../../jruby/mxbuild/dists/ruby.jar").getCanonicalPath();
try {
return ret.getCanonicalPath();
} catch (IOException e) {
return null;
}
}

} catch (IOException e) {
return null;
}

return null;
}

static void visitEachFileOnClassPath(RootedFileVisitor<Path> visitor) {
Expand Down

0 comments on commit 3204907

Please sign in to comment.