Warning: session_start(): open(/var/lib/php/sessions/sess_3euhivjpa73jijsisjmasbrup5, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static class CompilerBot {
static bool verbose;
// returns jar path
static File compileSnippet(S snippetID) {
S transpiledSrc = getServerTranspiled2(snippetID);
int i = transpiledSrc.indexOf('\n');
String libs = transpiledSrc.substring(0, Math.max(0, i));
if (verbose)
print("Compiling snippet: " + snippetID + ". Libs: " + libs);
transpiledSrc = transpiledSrc.substring(i+1);
return compile(transpiledSrc, libs);
}
static File compile(S src) {
ret compile(src, "");
}
static File compile(S src, S libs) {
ret compile(src, libs, null);
}
static File compile(S src, S dehlibs, S javaTarget) {
if (verbose)
print("Compiling " + l(src) + " chars");
S md5 = md5(dehlibs + "\n" + src);
File jar = getJarFile(md5);
if (jar == null || jar.length() <= 22) {
// have to compile
javaCompileToJar_standard(src, dehlibs, jar);
} else {
if (verbose)
print("Getting classes from cache (" + jar.getAbsolutePath() + ", " + jar.length() + " bytes)");
touchFile(jar); // so we can find the unused ones easier
}
ret jar;
}
static File getJarFile(S md5) {
assertTrue(isMD5(md5));
ret new File(getCacheProgramDir("#1002203"), md5 + ".jar");
}
}