1 11 package org.eclipse.pde.internal.build.ant; 12 13 import org.eclipse.pde.internal.build.IXMLConstants; 14 import org.eclipse.pde.internal.build.Utils; 15 16 19 public class JavacTask implements ITask { 20 21 protected String classpathId; 22 protected String bootclasspath; 23 protected String destdir; 24 protected String failonerror; 25 protected String [] srcdir; 26 protected String verbose; 27 protected String includeAntRuntime; 28 protected String fork; 29 protected String debug; 30 protected String source; 31 protected String target; 32 protected String compileArgs; 33 protected String compileArgsFile; 34 protected String encoding; 35 protected String logExtension; 36 37 40 public JavacTask() { 41 super(); 42 } 43 44 47 public void print(AntScript script) { 48 script.printTab(); 49 script.print("<javac"); script.printAttribute("destdir", destdir, false); script.printAttribute("failonerror", failonerror, false); script.printAttribute("verbose", verbose, false); script.printAttribute("fork", fork, false); script.printAttribute("debug", debug, false); script.printAttribute("includeAntRuntime", includeAntRuntime, false); script.printAttribute("bootclasspath", bootclasspath, false); script.printAttribute("source", source, false); script.printAttribute("target", target, false); script.printAttribute("encoding", encoding, false); script.println(">"); 62 script.indent++; 63 64 if (compileArgs != null) { 65 script.println("<compilerarg line=\"" + compileArgs + "\" compiler=\"" + Utils.getPropertyFormat(IXMLConstants.PROPERTY_BUILD_COMPILER) + "\"/>"); } 67 68 script.println("<classpath refid=\"" + classpathId + "\" />"); 70 for (int i = 0; i < srcdir.length; i++) { 71 script.printTab(); 72 script.print("<src path="); script.printQuotes(srcdir[i]); 74 script.println("/>"); } 76 77 if (compileArgsFile != null) { 78 script.println("<compilerarg value=\"@" + compileArgsFile + "\" compiler=\"" + IXMLConstants.JDT_COMPILER_ADAPTER + "\"/>"); } 80 if (destdir != null) { 81 script.println("<compilerarg line=\"-log '" + destdir + logExtension + "'\" compiler=\"" + IXMLConstants.JDT_COMPILER_ADAPTER + "\"/>"); } 83 script.indent--; 84 script.printEndTag("javac"); } 86 87 91 public void setClasspathId(String classpathId) { 92 this.classpathId = classpathId; 93 } 94 95 100 public void setBootClasspath(String bootclasspath) { 101 this.bootclasspath = bootclasspath; 102 } 103 104 109 public void setDestdir(String destdir) { 110 this.destdir = destdir; 111 } 112 113 119 public void setFailOnError(String failonerror) { 120 this.failonerror = failonerror; 121 } 122 123 129 public void setIncludeAntRuntime(String include) { 130 this.includeAntRuntime = include; 131 } 132 133 138 public void setSrcdir(String [] srcdir) { 139 this.srcdir = srcdir; 140 } 141 142 148 public void setVerbose(String verbose) { 149 this.verbose = verbose; 150 } 151 152 158 public void setFork(String fork) { 159 this.fork = fork; 160 } 161 162 168 public void setDebug(String debug) { 169 this.debug = debug; 170 } 171 172 177 public void setSource(String source) { 178 this.source = source; 179 } 180 181 186 public void setTarget(String target) { 187 this.target = target; 188 } 189 190 public void setCompileArgs(String args) { 191 this.compileArgs = args; 192 } 193 194 public void setEncoding(String encoding) { 195 this.encoding = encoding; 196 } 197 198 public void setLogExtension(String extension) { 199 this.logExtension = extension; 200 } 201 202 public void setCompileArgsFile(String file) { 203 this.compileArgsFile = file; 204 } 205 } 206 | Popular Tags |