Steve Appling wrote:
> 
> 
> On Aug 10, 2010, at 10:04 AM, Bergmann Manfred wrote:
> 
>> Hi.
>> 
>> The following task:
>> task myjar(dependsOn:enhance) << {
>>   def destFile = "build/libs/${project.name}-${version}-myjar.jar"
>>   ant.delete(file:destFile)
>>   ant.mkdir(dir:'build/libs')
>>   ant.jar(destfile:destFile) {
>>       manifest() {
>>           attribute(name:"Specification-Title", value:"${project.name}")
>>           attribute(name:"Specification-Version", value:"${version}")
>>           attribute(name:"Specification-Vendor", value:"${vendor}")
>>           attribute(name:"Implementation-Title", value:"${project.name}")
>>           attribute(name:"Implementation-Version", value:"${version}")
>>           attribute(name:"Implementation-Vendor", value:"${vendor}")
>>           attribute(name:"Main-Class", value:"de.mabe.xea.ui.XeaUI")
>>       }
>>   }
>> }
>> 
>> 
>> Produces the following error:
>> * What went wrong:
>> Execution failed for task ':myjar'.
>> Cause: jar doesn't support the nested "attribute" element.
>> 
> 
> 
> manifest implements an attributes method (note the plural) that takes a
> map.
> Like:
>   ant.jar(destfile:destFile) {
>       manifest() {
>           attributes (
>              'Specification-Title': project.name",
>              'Specification-Version':version
>           )
>       }
>   }
> 

Hmm, this will result in this error:
No 'manifest' attribute was specified for the <jar> task, a default manifest
will be generated.
Seems logical to me because there is no <attribute> ant tag which takes a
Map as argument.

The problem now is that I can't do it either way using Groovy's Ant.


Manfred
-- 
View this message in context: 
http://gradle.1045684.n5.nabble.com/Odd-error-with-Ant-Jar-task-and-nested-manifest-with-0-9rc-1-tp2436278p2471635.html
Sent from the gradle-user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email



Reply via email to