Thanks for your reply, Magnus.  However, I am still not able to get the working.

* What went wrong:
Execution failed for task ':compile'.
Cause: Could not find method asPath() for arguments [] on
configuration ':antcompile'.


On Mon, Aug 16, 2010 at 12:47 AM, Magnus Rundberget
<[email protected]> wrote:
> Hi,
> You need to add the dependencies manually to the ant tasks classpath.
> Short sample that should work:
> // custom dependency configuration
> configurations {
>    antcompile
> }
> dependencies {
>   antcompile files('/Users/andrew/libs/my-compiler-adapter.jar')
> }
> task compile << {
>  ant.javac(srcdir: '.', verbose: true,
> compiler:'org.foo.bar.MyCompilerAdapter',
> classpath:configurations.antcompile.asPath()) {
>  include(name: '**/*.java')
>  include(name: '**/*.groovy')
>  }
>  }
>
> cheers
> Magnus
>
>
>> Date: Sun, 15 Aug 2010 20:53:14 -0700
>> From: [email protected]
>> To: [email protected]
>> Subject: [gradle-user] how to add a jar file to gradle's AntBuilder
>>
>> Hi all,
>>
>> I am trying to execute an ant javac call inside of a gradle task.
>> However, I am trying to execute with a custom CompilerAdapter, using
>> the compiler attribute (this allows me to run the javac task with my
>> own compiler implementation). In order to do this, I need to add an
>> extra jar to ant's classpath. Here is the current build.gradle that I
>> have, but it is not working:
>>
>>
>> dependencies {
>> files('/Users/andrew/libs/my-compiler-adapter.jar')
>> }
>>
>> task compile << {
>> ant.javac(srcdir: '.', verbose: true, compiler:
>> 'org.foo.bar.MyCompilerAdapter') {
>> include(name: '**/*.java')
>> include(name: '**/*.groovy')
>> }
>> }
>>
>> The script is failing with the message:
>>
>> Execution failed for task ':compile'.
>> Cause: Class not found: org.foo.bar.MyCompilerAdapter
>>
>> It looks like the file in the dependencies section is not being added
>> to the ant classpath. (As a side note, this is working when I run the
>> related script directly in ant.) Any ideas on how to fix this script?
>>
>> Much appreciated.
>>
>> --andrew
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to