assets/src/org/ruboto/JRubyAdapter.java in ruboto-0.9.0.rc.1 vs assets/src/org/ruboto/JRubyAdapter.java in ruboto-0.9.0

- old
+ new

@@ -215,11 +215,15 @@ throw new RuntimeException(nsme); } catch (IllegalAccessException iae) { throw new RuntimeException(iae); } catch (java.lang.reflect.InvocationTargetException ite) { if (isDebugBuild) { - throw ((RuntimeException) ite.getCause()); + if (ite.getCause() instanceof RuntimeException) { + throw ((RuntimeException) ite.getCause()); + } else { + throw ((Error) ite.getCause()); + } } else { return null; } } } @@ -249,11 +253,11 @@ // System.setProperty("jruby.compat.version", "RUBY1_8"); // RUBY1_9 is the default in JRuby 1.7 System.setProperty("jruby.ir.passes", "LocalOptimizationPass,DeadCodeElimination"); System.setProperty("jruby.backtrace.style", "normal"); // normal raw full mri // Uncomment these to debug/profile Ruby source loading - // System.setProperty("jruby.debug.loadService", "true"); + System.setProperty("jruby.debug.loadService", "true"); // System.setProperty("jruby.debug.loadService.timing", "true"); // Used to enable JRuby to generate proxy classes System.setProperty("jruby.ji.proxyClassFactory", "org.ruboto.DalvikProxyClassFactory"); System.setProperty("jruby.class.cache.path", appContext.getDir("dex", 0).getAbsolutePath()); @@ -322,10 +326,19 @@ setOutputStream(out); } else if (output != null) { setOutputStream(output); } - String jrubyHome = "file:" + apkName + "!"; + String jrubyHome = "file:" + apkName + "!/jruby.home"; + + // FIXME(uwe): Remove when we stop supporting RubotoCore 0.4.7 + Log.i("RUBOTO_CORE_VERSION_NAME: " + RUBOTO_CORE_VERSION_NAME); + if (RUBOTO_CORE_VERSION_NAME != null && + (RUBOTO_CORE_VERSION_NAME.equals("0.4.7") || RUBOTO_CORE_VERSION_NAME.equals("0.4.8"))) { + jrubyHome = "file:" + apkName + "!"; + } + // EMXIF + Log.i("Setting JRUBY_HOME: " + jrubyHome); System.setProperty("jruby.home", jrubyHome); addLoadPath(scriptsDirName(appContext));