fabric-loom
fabric-loom copied to clipboard
Remap jar task overwrites any copy functionality provided by/to Gradle
The RemapJarTask
executes two actions:
-
Jar#copy
method which copies the whole jar including any user defined copy specs. -
RemapJarTask#doTask
method which copies and transforms the input jar and overwrites the previous actions' output.
This prevents the use of user defined copy specs, for example:
remapJar {
from('LICENSE')
}
Potential Solutions
- Don't implement
Jar
and copy desirable properties from it and parent classes e.g. archive classifiers. - Ideally the task would be converted to a
CopySpec
however binary transformations are currently not possible however it seems they were intended to be. (blocked by) https://github.com/gradle/gradle/issues/4010
If anyone can think of any better fixes feel free to comment.
IMO it should be done like @Chocohead's RemappingJar
does it (iirc): remap the output from this
jar task with a custom task action. The input property would be replaced by Gradle's own methods for zips.
Im not too sure this is easily fixable, I rewrote the jar remapping in 0.11 and had a quick go at using this
as an input without much success. If anyone has any ideas please let me know.