protoj.core
Class CompileFeature

java.lang.Object
  extended by protoj.core.CompileFeature

public final class CompileFeature
extends java.lang.Object

Compiles the project source Java (.java) files. Compilation of AspectJ (.aj) files is also supported without any additional software. Note that the compile(String, String) method is used to fully compile the project from a programmatic call or from the compile command. The compileAjc(List) and compileJavac(List) methods are used usually from the command line as an alternative to calling the initial javac in order to compile the core bootstrapping part of this project.

Author:
Ashley Williams

Constructor Summary
CompileFeature(CoreProject parent)
          See the getters corresponding to the parameters here.
 
Method Summary
 void compile(java.lang.String includes, java.lang.String excludes)
          Compiles the source code based on the specified ant patterns.
 void compileAjc(java.util.List<java.lang.String> options)
          Aspectj compiling equivalent of compileJavac(List).
 void compileAjc(java.lang.String includes, java.lang.String excludes)
          Invokes the aspectj compiler.
 void compileJavac(java.util.List<java.lang.String> options)
          Compiles a set of files in the source directory using the javac compiler.
 void compileJavac(java.lang.String includes, java.lang.String excludes)
          Invokes the javac compiler.
 void copyResources()
          Copies the files in the resources directory into the classes directory.
 AspectJCompileTask createAjcTask()
          Creates the ajc compile implementation instance.
 JavacCompileTask createJavacTask()
          Creates the javac compile implementation instance.
 AspectJCompileTask getAjcCompileTask()
          The ant wrapper used to carry out aspectj compilation.
 JavacCompileTask getJavacCompileTask()
          The ant wrapper used to carry out javac compilation.
 void initConfig(boolean aspectCompiler, ArgRunnable<CompileFeature> config)
          See the getters corresponding to the parameters here.
 boolean isAspectCompiler()
          True if the ajc compiler is configured, false if the javac compiler is configured.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompileFeature

public CompileFeature(CoreProject parent)
See the getters corresponding to the parameters here.

Parameters:
parent -
Method Detail

initConfig

public void initConfig(boolean aspectCompiler,
                       ArgRunnable<CompileFeature> config)
See the getters corresponding to the parameters here.

Parameters:
aspectCompiler -
config -

getAjcCompileTask

public AspectJCompileTask getAjcCompileTask()
The ant wrapper used to carry out aspectj compilation.

Returns:

getJavacCompileTask

public JavacCompileTask getJavacCompileTask()
The ant wrapper used to carry out javac compilation.

Returns:

compile

public void compile(java.lang.String includes,
                    java.lang.String excludes)
Compiles the source code based on the specified ant patterns.

Parameters:
includes - can be null to include all
excludes - can be null to exclude nothing

compileAjc

public void compileAjc(java.lang.String includes,
                       java.lang.String excludes)
Invokes the aspectj compiler.

Parameters:
includes -
excludes -

compileJavac

public void compileJavac(java.lang.String includes,
                         java.lang.String excludes)
Invokes the javac compiler.

Parameters:
includes -
excludes -

compileJavac

public void compileJavac(java.util.List<java.lang.String> options)
Compiles a set of files in the source directory using the javac compiler. The options parameter contains name value pairs to be applied to the underlying ant task by beans introspection, so that the compiler can easily be configured from the command line.

The bean being configured is the JavacCompileTask instance. For example a string with the content "compileTask.source=1.5" is equivalent to calling JavacCompileTask.getCompileTask().setSource("1.5").

If the source directory doesn't exist then this method does nothing.

Parameters:
options -

compileAjc

public void compileAjc(java.util.List<java.lang.String> options)
Aspectj compiling equivalent of compileJavac(List).

Parameters:
options -

isAspectCompiler

public boolean isAspectCompiler()
True if the ajc compiler is configured, false if the javac compiler is configured.

Returns:

createAjcTask

public AspectJCompileTask createAjcTask()
Creates the ajc compile implementation instance.

Returns:

createJavacTask

public JavacCompileTask createJavacTask()
Creates the javac compile implementation instance.

Returns:

copyResources

public void copyResources()
Copies the files in the resources directory into the classes directory.