Download Jar. Transpiled version (12373L) is out of date.
!7 sS defaultJavaTarget = "1.8"; sS standardCredentials() { ret ""; } // public snippets only // (transpilation md5, snippetID) => jar file //static new SerializeComputations<PairS, File> computations; // transpilation md5 => jar file static new SerializeComputations<S, File> computations; html { // lock lock; // now using SerializeComputations uri = dropPrefixSlash(uri); S snippetID = fsI(uri); if (!isSnippetPublic(snippetID)) fail("Snippet not public: " + snippetID); S transpiledSrc = getServerTranspiled2(snippetID); // md5 check (if parameter supplied) S md5 = params.get('md5); S srcMD5 = md5(transpiledSrc); if (md5 != null && !eq(md5, srcMD5)) ret "md5 mismatch"; File jar = computations.get(srcMD5/*, snippetID)*/, -> { remutable transpiledSrc; int i = transpiledSrc.indexOf('\n'); S libs = transpiledSrc.substring(0, Math.max(0, i)); printVars(+snippetID, +libs); transpiledSrc = transpiledSrc.substring(i+1); S javaTarget = or(params.get('javaTarget), defaultJavaTarget); CompilerBot.verbose = true; ret CompilerBot.compile(transpiledSrc, libs, javaTarget, snippetID); }); bool withLibs = eq("1", params.get("withLibs")); if (withLibs) { Pair<S, LS> srcAndLibs = extractLibsFromTranspilation(transpiledSrc); if (nempty(srcAndLibs.b)) { File jar2 = appendToBaseFileName(jar, ".with-libs"); if (fileLength(jar2) <= 22) { mergeJars_manifestFromFirst(flattenLists( jar, map loadLibraryOrSrcLib(srcAndLibs.b) ), jar2); } jar = jar2; } } bool noCompiler = eq("1", params.get("noCompiler")); if (noCompiler) { File jar2 = appendToBaseFileName(jar, ".no-compiler"); if (fileLength(jar2) <= 22) { temp var jarOut = zipOutputStream(jar2); zip2zip(jar, jarOut); zip2zip(pathToJavaxJar(), jarOut, name -> ! startsWithOneOf(name, "org/eclipse/", "META-INF/")); } printFileInfo(jar = jar2); } bool withX30 = eq("1", params.get("withX30")); if (withX30) { File jar2 = appendToBaseFileName(jar, ".with-x30"); if (fileLength(jar2) <= 22) { mergeJars_manifestFromFirst(jar, pathToJavaxJar(), jar2); } jar = jar2; } bool noSrc = eq("1", params.get("noSrc")); bool dynamicObjectOnly = eq("dynamicObjectOnly", params.get("mode")); if (dynamicObjectOnly) { File jar2 = appendToBaseFileName(jar, ".dynamicObjectOnly" + stringIf(noSrc, ".noSrc")); if (fileLength(jar2) <= 22) { temp var jarOut = zipOutputStream(jar2); bool withSrc = !noSrc; zip2zip(jar, jarOut, name -> withSrc || !endsWith(name, ".java")); zip2zip(pathToJavaxJar(), jarOut, name -> contains(name, "DynamicObject")); } jar = jar2; } print("Serving jar for " + snippetID + ": " + renderFileInfo(jar)); ret subBot_serveFileWithName(jar, psI(snippetID) + ".jar", "application/java-archive"); }
Began life as a copy of #1020140
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): bhatertpkbcr, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033462 |
Snippet name: | Jar Web Bot [backup] |
Eternal ID of this version: | #1033462/3 |
Text MD5: | bf2f474ba04e629ade40c40fefa48e7b |
Author: | stefan |
Category: | javax / web |
Type: | JavaX module |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-28 22:22:55 |
Source code size: | 3041 bytes / 89 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 252 / 979 |
Version history: | 2 change(s) |
Referenced in: | [show references] |