1 | static void renameMainJava(File srcDir, S progID) { |
2 | File fMain = new File(srcDir, "main.java"); |
3 | S src = loadTextFile(fMain); |
4 | if (tok_classHasModifier(findMainClass(javaTok(src)), "public")) ret; |
5 | S dummyClassName = dummyMainClassName(progID); |
6 | src += "\nclass " + dummyClassName + "{}"; |
7 | saveTextFile(new File(srcDir, dummyClassName + ".java"), src); |
8 | fMain.delete(); |
9 | } |
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: | #1008756 |
Snippet name: | renameMainJava |
Eternal ID of this version: | #1008756/4 |
Text MD5: | d566cb175c0be16dcb50473c1871c78d |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-06-01 01:18:14 |
Source code size: | 387 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 426 / 494 |
Version history: | 3 change(s) |
Referenced in: | [show references] |