Esempio n. 1
0
 /** @see #compile(String, String, String, boolean) */
 public static boolean compile(
     String jarFile, String mainClass, String javaFiles[], boolean allErrors) {
   try {
     String buildDir = ".build";
     JarManager.rmDir(new File(buildDir));
     new File(buildDir).mkdirs();
     JarManager.jarExtract(Core.javascoolJar(), buildDir, "org/javascool");
     for (int i = 0; i < javaFiles.length; i++) {
       String file = javaFiles[i];
       javaFiles[i] = buildDir + File.separator + file;
       JarManager.copyFiles(file, javaFiles[i]);
     }
     if (!Java2Class.compile(javaFiles, allErrors)) {
       return false;
     }
     String mfFile = buildDir + File.separator + "manifest.jmf";
     Pml manifest =
         new Pml()
             .set("Main-Class", mainClass)
             .set("Implementation-URL", "http://javascool.gforge.inria.fr")
             .save(mfFile);
     JarManager.jarCreate(jarFile, mfFile, buildDir);
     JarManager.rmDir(new File(buildDir));
     return true;
   } catch (IOException e) {
     throw new RuntimeException("Erreur d'entrées-sorties à la compilation : " + e);
   }
 }
Esempio n. 2
0
 /** @see #jarCreate(String, String, String, String[]) */
 public static void jarCreate(String jarFile, String mfFile, String srcDir) {
   JarManager.jarCreate(jarFile, mfFile, srcDir, null);
 }