Hi Marco,
there is a shortcut function to enable the compile debugging:
allprojects {
usePlugin('java')
compile {
destinationDir = new File($rootDir, 'tmp/build/classes')
sourceCompatibility = 1.4
targetCompatibility = 1.4
options.bootClasspath = bootClasspath
options.deprecation = true
options.debug(debugLevel : 'lines,source')
}
This way the logical separation we do doesn't affect the build.gradle
script.
Kr,
Tom
2009/2/5 Marco Hunsicker <[email protected]>
> > I want to provide a custom debug level for compilation, but Gradle does
>
>> not seem to support this attribute and I could not get around the Ant task
>> either.
>>
>> I first tried to configure custom options:
>>
>> compile.options.define(
>> debug: true,
>> debugLevel: 'lines,source',
>> deprecation: true,
>> optimize: false,
>> source: 1.4,
>> target: 1.4,
>> )
>>
>> But Gradle complains that "No such property: debugLevel for class:
>> org.gradle.api.tasks.compile.CompileOptions" exists.
>>
>
> After some further digging, I finally found out how to do this:
> CompileOptions provides a DebugOptions object that provides access to the
> debugLevel attribute. As a novice user I find the configuration concept of
> the compile task not especially intuitive or at least well documented.
>
> My global compile task configuration now looks like this:
>
> allprojects
> {
> usePlugin('java')
>
> // define global compile options
> compile.destinationDir = new File("$rootDir/tmp/build/classes")
> compile.sourceCompatibility = 1.4
> compile.targetCompatibility = 1.4
> compile.options.bootClasspath = bootClasspath
> compile.options.debug = true
> compile.options.debugOptions.debugLevel = 'lines,source'
> compile.options.deprecation = true
> }
>
> What is the reasoning to require such nested access?
>
>
> --
> Cheers,
> Marco
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>