Libraryless. Click here for Pure Java version (4942L/28K).
static S invokeEcj(S options) ctex { new StringWriter writer; PrintWriter printWriter = new(writer); File optionsFile = File.createTempFile("javax", ""); saveTextFile(optionsFile, options); S[] args = { "@" + optionsFile.getPath() }; Class ecjClass = javax_loadClass("org.eclipse.jdt.internal.compiler.batch.Main"); Object main = newInstance(ecjClass, printWriter, printWriter, false); call(main, "compile", new Object[]{args}); int errors = (Int) get(main, "globalErrorsCount"); S output = str(writer); if (errors != 0) { print(output); throw new JavaCompileException("ECJ returned errors. " + output + "\nOptions: " + options); } ret output; }
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
No comments. add comment
| Snippet ID: | #1008598 |
| Snippet name: | invokeEcj |
| Eternal ID of this version: | #1008598/7 |
| Text MD5: | 3421745df55be047e834fd58717424d7 |
| Transpilation MD5: | 865837e06e7d2da0b7510f6cd3327e78 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-11-01 18:01:42 |
| Source code size: | 711 bytes / 21 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 918 / 1081 |
| Version history: | 6 change(s) |
| Referenced in: | [show references] |