Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

23
LINES

< > BotCompany Repo | #1033517 // freshenClassFilesInJar [dev.]

JavaX fragment (include)

static File projectForLocalCompilation(File destZip, S programID) {
  temp var zipOut = zipOutputStream(destZip);
  Pair<S, LS> p = extractLibsFromTranspilation(getServerTranspiled2(programID));
  text2zip(p.a, zipOut, "main.java");
  new LS libPaths;
  new LS toCompile;
  for (lib : p.b) {
    S libPath = "lib" + lib + ".jar";
    libPaths.add(libPath);
    file2zip(loadLibraryOrSrcLib(lib), zipOut, libPath);
    if (isSrcLib(lib))
      text2zip(zipOut, addAndReturn(toCompile, "loadableUtils/utils.java"), getServerTranspiledWithoutLibs(lib)); // TODO
  }
  libPaths.add("x30.jar");
  file2zip(pathToJavaxJar(), zipOut, "x30.jar");
  text2zip("javac -cp " + join(":", libPaths) + " main.java " + joinWithSpace(toCompile) + "\n", zipOut, "compile");
  text2zip("java -cp .:" + join(":", libPaths) + " main\n", zipOut, "run");
  ret destZip;
}

static File projectForLocalCompilation(S programID, File destZip) {
  ret projectForLocalCompilation(destZip, programID);
}

Author comment

Began life as a copy of #1033487

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033517
Snippet name: freshenClassFilesInJar [dev.]
Eternal ID of this version: #1033517/1
Text MD5: 4ad27af30e9d52050ce3e0061d6b0d70
Author: stefan
Category: javax / compiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-29 10:30:21
Source code size: 995 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 72 / 84
Referenced in: [show references]