-
Type:
Bug
-
Status: Resolved
-
Resolution: Fixed
-
Affects Version/s: 0.9
-
Fix Version/s: 0.9-rc-1
when creating a new jar type task I want to be able to set the type to 'source'
eg:
task jarSource(type: Jar){
...
type = 'source'
classifier = 'src'
}
and then publish using ivy pattern <somedir>/[organization]/[module]/[type]s/[artifact](-[classifier]).[ext]
Currently this does not give expected result (that is type substituted in pattern is actually value of extension) -> both source and classes jar is put into folder .../jars/*.jar
Suggested fix:
add type field in class org.gradle.api.tasks.bundling.AbstractArchiveTask
then change method getType in org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact to use this field instead of extension eg (note it is probably worth though to clean up the following code snippet
public String getType() {
if (archiveTask.getType() != null && !archiveTask.getType().equals(""))
return archiveTask.getType();
else
return archiveTask.getExtension();
}
I would be highly appreciated to include this simple fix in version 0.9 release.
- dependent on
-
GRADLE-959 Make PublishArtifacts configurable
- Resolved