Class JavaCompiler

All Implemented Interfaces:
Generator, ResourceProvider

public class JavaCompiler extends JavaTool

The JavaCompiler generator provides two types of resources.

  1. The JavaSourceFiles of the project as configured with addSources(org.jdrupes.builder.api.FileTree<org.jdrupes.builder.java.JavaSourceFile>) in response to a ResourceRequest with ResourceType JavaTypes.JavaSourceTreeType (or a more general type).

  2. The ClassFiles that result from compiling the sources in response to a ResourceRequest with ResourceType JavaTypes.ClassTreeType (or a more general type such as JavaTypes.ClasspathElementType).

No attempt has been made to define types for the options of the java compiler. Rather, the options are passed as strings as the ToolProvider API suggests. There are some noteworthy exceptions for options that are directly related to resource types (files, directory trees, paths) from the builder context.

If no "-g..." option is specified, the generator adds "-g" and thus generates full debug information. If you want to restore the default behavior of the java compiler, you have to specify -g:[lines, source] explicitly.