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

31
LINES

< > BotCompany Repo | #642 // isJavaCompilable

JavaX source code - run with: x30.jar

!636
!quickmain
!auto-import
!standard functions
!class _x14

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.lang.reflect.*;

main {
  psvm {
    String text;
    if (args.length != 0)
      text = loadSnippet(args[0]);
    else
      text = loadTextFile("input/main.java", null);
    if (text == null)
      throw new IOException("No input.");
      
    File srcDir = _x14.TempDirMaker_make();
    saveTextFile(new File(srcDir, "main.java").getPath(), text);
    File classesDir = _x14.TempDirMaker_make();
    List<File> libraries = new ArrayList<File>();
    
    String javacOutput = _x14.compileJava(srcDir, libraries, classesDir);
    boolean isCompilable = _x14.didCompile(classesDir);
    System.out.println("Compilable: " + isCompilable);
    saveTextFile(isCompilable ? "output/is-compilable" : "output/is-not-compilable", "x");
  }
}

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: #642
Snippet name: isJavaCompilable
Eternal ID of this version: #642/1
Text MD5: 79f64f1aa95e8e1f3861a7fc64ec1838
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-06-25 20:33:33
Source code size: 923 bytes / 31 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 828 / 717
Referenced in: [show references]