static O hotwire_onCompile; // voidfunc(Pair) sbool hotwire_serially; static Lock hotwire_overInternalBot_lock = lock(); sbool hotwire_compileOnServer; static Class hotwire_overInternalBot(S progID) { ret hotwire_overInternalBot(progID, "main"); } static Class hotwire_overInternalBot(S progID, S mainClass) { ret hotwire_overInternalBot(progID, _ -> mainClass); } static Class hotwire_overInternalBot(S progID, IF1 calculateMainClass) ctex { Pair p; try { p = hotwire_compile(progID); } catch e { throw rethrow("Error hotwiring " + progID, e); } File jar = p.a; assertTrue(jar.getAbsolutePath(), jar.isFile()); L files = hotwire_collectJars(jar); // make class loader JavaXClassLoader classLoader = hotwire_makeClassLoader(files); classLoader.progID = progID; S mainClass = calculateMainClass == null ? "main" : calculateMainClass.get(classLoader); ret hotwire_finish(classLoader, progID, p.b, mainClass); } // returns pair(jar, transpiled src) static Pair hotwire_compile(S progID) { Pair p = hotwire_compileOnServer && !isLocalSnippetID(progID) ? compileSnippetThroughServer(progID) : CompilerBot.compileSnippet2(progID); lock hotwire_serially ? hotwire_overInternalBot_lock : null; callF(hotwire_onCompile, p); ret p; }