Created
December 12, 2013 05:37
-
-
Save lifuzu/7923644 to your computer and use it in GitHub Desktop.
extract the class file to create a jar package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1. Use the zipTree directly in the jar task rather than creating an intermediate zip. | |
//2. Use eachFile to change the relative path of each file to strip off the first folder. | |
jar { | |
from zipTree('runtime.jar') { | |
include 'classes/**/*.class' | |
eachFile { it.relativePath = it.relativePath.segments[1..-1] } | |
} | |
} | |
//Jar tasks have all of the CopySpec methods, which provide the eachFile abilities. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment