1 package org.ozoneDB.tools.OPP; 7 8 import org.ozoneDB.tools.OPP.compiler.JavaCompiler; 9 import org.ozoneDB.tools.OPP.compiler.AbstractJavaCompiler; 10 import org.ozoneDB.tools.OPP.compiler.InternalJavaCompiler; 11 import org.ozoneDB.tools.OPP.compiler.ExternalJavaCompiler; 12 13 import java.io.File ; 14 15 public class OPPCompilerFactory { 16 17 18 public static JavaCompiler getCompilerInstance(File sourceDir, File outputDir) { 19 AbstractJavaCompiler compiler; 21 String jvmClassPath = System.getProperty("java.class.path", ""); 22 String compilerCommand = System.getProperty("ozone.javac", ""); 23 if (compilerCommand.equals("")) { 24 compiler = new InternalJavaCompiler(); 25 } else { 26 compiler = new ExternalJavaCompiler(compilerCommand); 27 } 28 compiler.setDebug(true); 29 compiler.setDeprecation(true); 30 compiler.setOptimize(false); 31 compiler.setClasspath(jvmClassPath); 32 compiler.setSourcePath(sourceDir); 33 compiler.setOutputPath(outputDir); 34 35 return compiler; 37 } 38 } 39 | Popular Tags |