|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwcs.Task
wcs.ProcessTask
wcs.JavacTask
public class JavacTask
task to run the Java compiler.
BUG: this should not use ProcessTask.
BUG: this does not support all conceivable options.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class wcs.Task |
|---|
Task.Exception, Task.In, Task.Out |
| Field Summary | |
|---|---|
protected ArrayList |
args
commandline. |
String |
className
set by each call to addToSources(wcs.Task.In). |
protected StringBuffer |
classpath
classpath. |
String |
packagePath
set by each call to addToSources(wcs.Task.In). |
protected static Pattern |
packagePattern
pattern to extract package path, if any, and public class name. |
protected File |
src
root of source file area. |
| Fields inherited from class wcs.ProcessTask |
|---|
argv |
| Fields inherited from class wcs.Task |
|---|
env, err, in, out |
| Constructor Summary | |
|---|---|
JavacTask(File tmpDir,
Task.Out err,
Properties env)
required property: javac Java compiler Optional properties: javac.bootclasspath javac.extdirs | intended for crosscompilation, e.g., version 1.3 for MSIE javac.deprecation true for Java compiler -deprecation option javac.source Java compiler -source value |
| Method Summary | |
|---|---|
void |
addToClasspath(File component)
add a component to the classpath. |
void |
addToSources(String packagePath,
String className,
Task.In in)
add a source file: move the content to the workarea. |
void |
addToSources(Task.In in)
add a source file. |
static void |
main(String[] argv)
test: run commandline with system properties, keep workarea. |
void |
run()
insert args as ProcessTask.argv and insert classpath,
delegate to base method. |
| Methods inherited from class wcs.ProcessTask |
|---|
run |
| Methods inherited from class wcs.Task |
|---|
In, In, In, Out, Out |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Pattern packagePattern
protected final StringBuffer classpath
protected final File src
protected final ArrayList args
public String packagePath
addToSources(wcs.Task.In).
public String className
addToSources(wcs.Task.In).
| Constructor Detail |
|---|
public JavacTask(File tmpDir,
Task.Out err,
Properties env)
throws IOException
| javac | Java compiler |
Optional properties:
| javac.bootclasspath
javac.extdirs | intended for crosscompilation, e.g., version 1.3 for MSIE |
| javac.deprecation | true for Java compiler -deprecation option |
| javac.source | Java compiler -source value |
tmpDir - root of workarea; src will contain source files,
classes will contain class files.
IOException| Method Detail |
|---|
public void addToClasspath(File component)
throws IOException
IOException
public void addToSources(Task.In in)
throws IOException
packagePath and className.
IOException
public void addToSources(String packagePath,
String className,
Task.In in)
throws IOException
IOException
public void run()
throws Task.Exception
args as ProcessTask.argv and insert classpath,
delegate to base method.
run in interface Runnablerun in class ProcessTaskTask.Exception
public static void main(String[] argv)
throws Exception
Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||