1 Star 0 Fork 0

陈有胜/jd-gui

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.gradle 5.83 KB
一键复制 编辑 原始数据 按行查看 历史
emmanue1 提交于 2019-12-25 15:42 . Prepare JD-GUI 1.6.6, JD-Core 1.1.3
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.netflix.nebula:gradle-ospackage-plugin:5.3.0' // RPM & DEB support
classpath 'edu.sc.seis.gradle:launch4j:2.4.4'
classpath 'net.sf.proguard:proguard-gradle:6.1.0'
}
}
apply plugin: 'java'
apply plugin: 'distribution'
apply plugin: 'edu.sc.seis.launch4j'
apply plugin: 'nebula.ospackage'
// Common configuration //
rootProject.version='1.6.6'
rootProject.ext.set('jdCoreVersion', '1.1.3')
targetCompatibility = '1.8'
allprojects {
apply plugin: 'eclipse'
apply plugin: 'idea'
tasks.withType(JavaCompile) {
sourceCompatibility = targetCompatibility = '1.8'
options.compilerArgs << '-Xlint:deprecation'
options.compilerArgs << '-Xlint:unchecked'
options.encoding = 'UTF-8'
}
repositories {
jcenter()
}
configurations {
provided
compile.extendsFrom provided
}
}
// 'cleanIdea' task extension //
cleanIdea.doFirst {
delete project.name + '.iws'
delete 'out'
followSymlinks = true
}
// All in one JAR file //
subprojects.each { subproject ->
evaluationDependsOn(subproject.path)
}
jar {
dependsOn subprojects.tasks['jar']
// Add SPI directory
def tmpSpiDir = file('build/tmp/spi')
from tmpSpiDir
// Add dependencies
def deps = []
subprojects.each { subproject ->
from subproject.sourceSets.main.output.classesDirs
from subproject.sourceSets.main.output.resourcesDir
deps += subproject.configurations.runtime - subproject.configurations.provided
}
subprojects.each { subproject ->
deps -= subproject.jar.archivePath
}
deps = deps.unique().collect { it.isDirectory() ? it : zipTree(it) }
from deps
manifest {
attributes 'Main-Class': 'org.jd.gui.App',
'SplashScreen-Image': 'org/jd/gui/images/jd_icon_128.png',
'JD-GUI-Version': project.version,
'JD-Core-Version': project.jdCoreVersion
}
exclude 'META-INF/licenses/**', 'META-INF/maven/**', 'META-INF/INDEX.LIST'
exclude '**/ErrorStrip_*.properties', '**/RSyntaxTextArea_*.properties', '**/RTextArea_*.properties'
exclude '**/FocusableTip_*.properties', '**/RSyntaxTextArea_License.txt'
duplicatesStrategy DuplicatesStrategy.EXCLUDE
doFirst {
// Create SPI directory
tmpSpiDir.deleteDir()
def tmpSpiServicesDir = file(tmpSpiDir.path + '/META-INF/services')
tmpSpiServicesDir.mkdirs()
// Copy and merge SPI config files
subprojects.each { subproject ->
def servicesDir = file(subproject.sourceSets.main.output.resourcesDir.path + '/META-INF/services')
if (servicesDir.exists()) {
servicesDir.eachFile { serviceFile ->
def target = file(tmpSpiServicesDir.path + '/' + serviceFile.name)
target << serviceFile.text
}
}
}
}
}
// Minify JAR file //
task proguard(type: proguard.gradle.ProGuardTask, dependsOn: 'jar') {
configuration 'src/proguard/resources/proguard.config.txt'
injars jar.archivePath
outjars 'build/libs/' + project.name + '-' + project.version + '-min.jar'
libraryjars System.getProperty('java.home') + '/lib/rt.jar'
libraryjars System.getProperty('java.home') + '/jmods/'
}
// Java executable wrapper for Windows //
launch4j {
createExe.dependsOn 'proguard'
version = textVersion = project.version
fileDescription = productName = 'JD-GUI'
errTitle 'JD-GUI Windows Wrapper'
copyright 'JD-GUI (C) 2008-2019 Emmanuel Dupuy'
icon projectDir.path + '/src/launch4j/resources/images/jd-gui.ico'
jar projectDir.path + '/' + proguard.outJarFiles[0]
bundledJrePath = '%JAVA_HOME%'
}
// Packages for Linux //
ospackage {
buildDeb.dependsOn 'proguard'
buildRpm.dependsOn 'proguard'
license = file('LICENSE')
maintainer 'Emmanuel Dupuy <emmanue1@users.noreply.github.com>'
os LINUX
packageDescription 'JD-GUI, a standalone graphical utility that displays Java sources from CLASS files'
packageGroup 'java'
packageName project.name
release '0'
summary 'A Java Decompiler'
url 'https://github.com/java-decompiler/jd-gui'
into '/opt/' + project.name
from (proguard.outJarFiles[0]) {
fileMode 0755
}
from ('src/linux/resources/') {
fileMode 0755
}
from 'LICENSE', 'NOTICE', 'README.md'
postInstall 'cd /opt/' + project.name + '; ln -s ./' + file(proguard.outJarFiles[0]).name + ' ./jd-gui.jar; xdg-icon-resource install --size 128 --novendor ./jd_icon_128.png jd-gui; xdg-desktop-menu install ./*.desktop'
preUninstall 'cd /opt/' + project.name + '; rm -f ./jd-gui.jar; rm -fr ./ext; xdg-desktop-menu uninstall ./*.desktop'
}
// Distributions for OSX and Windows //
distributions {
osx.contents {
into('JD-GUI.app/Contents') {
from('src/osx/resources') {
include 'Info.plist'
expand VERSION: project.version,
JAR: file(proguard.outJarFiles[0]).name
}
}
into('JD-GUI.app/Contents/MacOS') {
from('src/osx/resources') {
include 'universalJavaApplicationStub.sh'
fileMode 0755
}
}
into('JD-GUI.app/Contents/Resources/Java') {
from proguard.outJarFiles[0]
}
from 'LICENSE', 'NOTICE', 'README.md'
}
windows.contents {
from 'build/launch4j/jd-gui.exe'
from 'LICENSE', 'NOTICE', 'README.md'
}
installWindowsDist.dependsOn createExe
windowsDistTar.dependsOn createExe
windowsDistZip.dependsOn createExe
installOsxDist.dependsOn 'proguard'
osxDistTar.dependsOn 'proguard'
osxDistZip.dependsOn 'proguard'
}
build.finalizedBy buildDeb
build.finalizedBy buildRpm
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mChenys/jd-gui.git
git@gitee.com:mChenys/jd-gui.git
mChenys
jd-gui
jd-gui
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385