fixed issue #20

This commit is contained in:
huangyuhui
2016-02-10 14:58:03 +08:00
parent 21dcb477dc
commit c67e7c0d3a
24 changed files with 76 additions and 39 deletions

View File

@@ -15,6 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
import java.util.jar.JarFile
import java.util.jar.Pack200
import java.util.zip.GZIPOutputStream
apply plugin: 'java'
apply plugin: 'maven'
@@ -78,3 +83,17 @@ task makeExecutable(dependsOn: jar) << {
is.close()
fos.close()
}
task makePackGZ(dependsOn: jar) << {
ext {
jar.classifier = ''
makeExecutableinjar = jar.archivePath
jar.classifier = ''
makeExecutableoutjar = jar.archivePath
jar.classifier = ''
}
def loc = new File(project.buildDir, "libs/" + makeExecutableoutjar.getName().substring(0, makeExecutableoutjar.getName().length()-4)+".pack.gz")
def os = new GZIPOutputStream(new FileOutputStream(loc))
Pack200.newPacker().pack(new JarFile(makeExecutableinjar), os)
os.close()
}