[GRADLE-391] User Guide Manifest Examples Invalid in section 10.8.4 Created: 10/Feb/09 Updated: 04/Jan/13 Resolved: 31/Mar/09
|Reporter:||Spencer Allain||Assignee:||Adam Murdoch|
Both examples in this section have the below incorrect line:
manifest.mainAttributes(Implementation-Title: "Gradle", Implementation-Version: $version)
This is invalid Groovy code because of the '-' in both Implementation-Title and Implementation-Version
When attempting to build, the following error occurs because it's trying to treat Implementation-Title as an expression, instead of as a String.
build_gradle: 11: illegal colon after argument expression;
The below is all that's needed to correct the example, and is arguably a good practice because you are forcing it to treat the key as a string value.
manifest.mainAttributes("Implementation-Title": "Gradle", "Implementation-Version": $version)
|Comment by Spencer Allain [ 10/Feb/09 ]|
Hmm, looks like I forgot about the other fix I had to make, (which I had corrected in my own usage). The use of $version results in:
build_gradle: 11: unexpected token: $ @ line 11, column 49.
The version(s) that actually work would be:
manifest.mainAttributes("Implementation-Title": "Gradle", "Implementation-Version": "$version")