1 Star 0 Fork 0

dssljt/jd-gui

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.gradle 5.56 KB
一键复制 编辑 原始数据 按行查看 历史
emmanue1 提交于 2015-08-08 16:21 . Prepares 1.4.0
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.netflix.nebula:gradle-ospackage-plugin:2.2.6'
classpath 'org.spockframework:spock-core:1.0-groovy-2.3'
}
}
apply plugin: 'java'
apply plugin: 'distribution'
apply plugin: 'nebula.os-package'
// Common configuration //
allprojects {
version='1.4.0'
apply plugin: 'eclipse'
apply plugin: 'idea'
tasks.withType(JavaCompile) {
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
}
tasks.withType(GroovyCompile) {
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
}
repositories {
mavenCentral()
maven {
url 'https://raw.github.com/java-decompiler/mvn-repo/master'
}
}
configurations {
provided
compile.extendsFrom provided
}
}
// 'cleanIdea' task extension //
cleanIdea {
file(project.name + '.iws').delete()
ant.delete(dir: 'out')
}
// All in one JAR //
subprojects.each { subproject ->
evaluationDependsOn(subproject.path)
}
jar {
dependsOn subprojects.tasks['jar']
def deps = []
subprojects.each { subproject ->
from subproject.sourceSets.main.output.classesDir
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) }
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': '0.7.1'
}
from deps
exclude 'META-INF/services/org.jd.gui.spi.*'
duplicatesStrategy DuplicatesStrategy.EXCLUDE
doFirst {
// Create temporary directory
def tmpSpiDir = file('build/tmp/spi')
tmpSpiDir.deleteDir()
tmpSpiDir.mkdirs()
// Copy and merge SPI config files
subprojects.each { subproject ->
def servicesDir = file(subproject.sourceSets.main.output.resourcesDir.path + File.separator + 'META-INF' + File.separator + 'services')
if (servicesDir.exists()) {
servicesDir.eachFile { source ->
def target = file(tmpSpiDir.path + File.separator + source.name)
target << source.text
}
}
}
// Add to JAR file
into('META-INF/services') {
from tmpSpiDir
}
}
}
// Windows wrapper configuration to generate "jd-gui.exe" //
task launch4jConfig(type: Copy) {
from 'src/launch4j/resources/config/launch4j.xml'
into 'build/launch4j'
expand(
JAR_FILE: project.jar.archivePath,
VERSION: project.version,
ICON: file('src/launch4j/resources/images/jd-gui.ico')
)
}
task launch4j(type: Exec, dependsOn: [':jar', ':launch4jConfig']) {
def launch4jCfg = file('build/launch4j/launch4j.xml')
def launch4jExe = System.properties['LAUNCH4J_HOME'] + '/launch4j.exe'
onlyIf {
System.properties['os.name'].startsWith('Windows')
}
if (new File(launch4jExe).exists()) {
commandLine 'cmd', '/c', launch4jExe, launch4jCfg
} else {
commandLine 'cmd', '/c', 'echo', 'OFF'
doLast {
errorOutput.println "ERROR: 'LAUNCH4J_HOME' not defined or invalid. Launch4j (http://launch4j.sourceforge.net) is required to generare 'jd-gui.exe'."
}
}
}
// Distributions for OSX and Windows //
task copyAndReplaceVariablesInInfoPlist(type: Copy) {
from 'src/osx/resources/Info.plist'
into 'build/tmp/distributions/osx'
expand(
VERSION: project.version
)
}
distributions {
osx.contents {
into('JD-GUI.app/Contents') {
from 'build/tmp/distributions/osx'
}
into('JD-GUI.app/Contents/Resources/Java') {
from jar.archivePath
}
from 'LICENSE', 'NOTICE', 'README.md'
doFirst {
ant.chmod(file:'src/osx/dist/JD-GUI.app/Contents/MacOS/universalJavaApplicationStub.sh', perm:'+x')
}
}
windows.contents {
from 'build/launch4j/jd-gui.exe'
from 'LICENSE', 'NOTICE', 'README.md'
}
}
ospackage {
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 ('build/libs/') {
fileMode = 0755
}
from ('src/linux/resources/') {
fileMode = 0755
}
from 'LICENSE', 'NOTICE', 'README.md'
postInstall 'cd /opt/'+ project.name+'; ln -s ./jd-gui-'+project.version+'.jar ./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'
}
installOsxDist.dependsOn jar, copyAndReplaceVariablesInInfoPlist
osxDistTar.dependsOn jar, copyAndReplaceVariablesInInfoPlist
osxDistZip.dependsOn jar, copyAndReplaceVariablesInInfoPlist
installWindowsDist.dependsOn launch4j
windowsDistTar.dependsOn launch4j
windowsDistZip.dependsOn launch4j
buildDeb.dependsOn jar
buildRpm.dependsOn jar
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/dssljt/jd-gui.git
git@gitee.com:dssljt/jd-gui.git
dssljt
jd-gui
jd-gui
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385