Compiler options

PDE/Build supports a number of options to control the compiler for individual plug-ins. For settings related to source and target levels and bootclasspath, see "Setting the Compilation Environment".

Warnings and Errors

PDE/Build allows specifying custom compile warnings and errors in the build.properties file. These can be set on a per library basis (a single plug-in can contain multiple jar libraries) with the javacWarnings.<library> and javacErrors.<library> options. The values for these properties are given in the "-warn:..." section on the using the batch compiler page (from the Java development user guide).

Example:
		javacErrors.. = forbidden,discouraged,
		javacWarnings.library.jar = deprecation,nullDereference

Warnings and Errors from Project preferences

The JDT project preferences can now also be used during PDE/Build. PDE/Build itself is not able to read the preference files, but it is able to pass them to the JDT compiler which does understand them. To use this, a plug-in should specify the javacProjectSettings property in its build.properties file. The value should be: Some projects may wish to use different warning and error settings in the workspace as compared to a releng build. This allows a more convenient method of specifying these settings compared to the "javacWarnings.<library>" property.

File Encoding

PDE/Build can accept custom file encodings on a per library, folder or file basis.

Custom Compiler Arguments

Custom compiler arguments can now be specified per bundle using the compilerArg property in the bundle's build.properties file. This property is similar to the compilerArg property in the builder configuration except that it affects only the single plug-in instead of all plug-ins. The specific arguments here depend on the compiler being used. The JDT compiler arguments are listed here.

Compiler Option Precedence

There are a number of difference ways to specify different compiler options. As a general rule, option precedence is as follows:

Using a Custom Compiler

A bundle can now use a custom compiler by setting the compilerAdapter property. The specified compiler adapter must be available in the ant environment. The JDT compiler adapter used by default is org.eclipse.jdt.core.JDTCompilerAdapter. One particular reason for specifying an alternate compiler is for Aspect J or Groovy bundles. Bundles specifying a custom compiler adapter may need to also specify some of the following properties: