(Quick Reference)

3.7 Compiler - Reference Documentation

Authors: Andres Almiray

Version: 1.2.0

3.7 Compiler

The following sections explain settings that affect how the compiler behaves

Most of these settings may specified in either griffon-app/conf/BuildConfig.groovy (local to project) or $USER_HOME/.griffon/settings.groovy (global to all projects), with the caveat that values specified at the command prompt will have precedence over those specified config files.

3.7.1 Source Encoding

The assumed source encoding is UTF-8. You can change this setting by specifying the following flag

griffon.source.encoding

for example

griffon -Dgriffon.source.encoding=='ISO-8859-1' compile

3.7.2 Source and Target Levels

Java source and target levels are chosen by the compiler to whatever values it picks by default (this is akin to specifying source and target in Ant's javac task). You can instruct the compiler to use a specific value by defining the following flags

griffon.project.source.level
griffon.project.target.level

For example, forcing JDK6 compatibility while using JDK7 can be done in this way

griffon -Dgriffon.project.source.level=1.6 -Dgriffon.project.target.level=1.6 compile

3.7.3 Debug Information

Indicates whether Java sources should be compiled with debug information; default is yes. You can change this setting by specifying the following flag

griffon.project.compiler.debug

3.7.4 Additional Sources

There may be times where additional sources should be compiled along with application sources, for example when a custom patch is needed when targetting a particular platform or applying a security fix that should not be included in the application's versioned sources.

Additional sources may be defined in BuildConfig.groovy in the following way

griffon.compiler.additional.sources = [
    'path/to/custom.patch.directory',
    'path/to/security.fix.directory'
]

You may define literal or File values. Paths are assumed to be relative to the application's root.

3.7.5 Additional Resources

Sometimes you' want additional resources to be included with the application but their inclusion is conditional, for example when packaging a generic applicaiton that contains customization for clients A and B you'd want an application per client that only includes the client's respective logos and brand recognition resources. Another example would be protected resources that should not be included in the application's sources under SCM.

Additional resources may be defined in BuildConfig.groovy in the following way

griffon.compiler.additional.resources = [
    'path/to/protected/resources'
]

You may define literal or File values. Paths are assumed to be relative to the application's root.