static Class<?> hotwire_overBot(String progID) ctex {
S compilerBot = "Compiler Bot with caching!";
startBot(compilerBot, "#1002203");
S ss = "please compile this javax snippet: *";
print("Sending to compiler bot: " + ss);
S s = sendToLocalBot_cached(compilerBot, ss, progID);
new Matches m;
print(s);
assertTrue("Compiler Bot response: " + s, match("ok, *", s, m));
S jarPath = m.unq(0);
File jar = new File(jarPath);
assertTrue(jar.getAbsolutePath(), jar.isFile());
// collect urls (program + libraries)
L<URL> urls = litlist(jar.toURI().toURL());
S dehlibs = unnull(loadTextFileFromZip(jar, "libraries"));
Matcher matcher = Pattern.compile("\\d+").matcher(dehlibs);
while (matcher.find()) {
S libID = matcher.group();
urls.add(loadLibrary(libID).toURI().toURL());
}
// make class loader
URLClassLoader classLoader = new URLClassLoader(urls.toArray(new URL[l(urls)]));
// load & return main class
Class<?> theClass = classLoader.loadClass("main");
Class j = getJavaX();
S src = loadTextFileFromZip(jar, "main.java");
call(j, "registerSourceCode", theClass, src);
synchronized(j) { // hopefully this goes well...
call(j, "setVars", theClass, progID);
callOpt(j, "addInstance", progID, theClass);
}
hotwire_copyOver(theClass);
return theClass;
}Began life as a copy of #1000963
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
| ID | Author/Program | Comment | Date |
|---|---|---|---|
| 1204 | stefan | TODO: Load source code for registerSourceCode | 2016-01-22 01:50:23 |