defaultTasks 'distZip' apply plugin: 'java-library' apply plugin: 'application' sourceCompatibility = 1.8 version = 'SNAPSHOT' task fatJar(type: Jar) { manifest{ attributes 'Implementation-Title': 'iZSetup', 'Implementation-Version': 'SNAPSHOT', 'Main-Class': 'de.nplusc.izc.InstallPak.Main' } baseName = project.name + '-all' from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } with jar } task izsetupDist(type: IZSetupPkgTask, dependsOn: 'makeDistC') class IZSetupPkgTask extends DefaultTask { @TaskAction def work() { println 'iZsetupCustomPackaging finished' } } mainClassName = 'de.nplusc.izc.InstallPak.Main' task makeDistA(type:Exec, dependsOn: 'fatJar') { File jarschiv = file(tasks.fatJar.archivePath) File WrkDir = file('distPackagerBase/') commandLine 'java', '-jar', jarschiv.getAbsolutePath() , '--makedist','0' , WrkDir.getAbsolutePath() , jarschiv.getAbsolutePath() } makeDistA.inputs.file file(tasks.fatJar.archivePath) makeDistA.outputs.file file('distPackagerBase/dist/iZsetup_setup.jar') task makeDistB(type: Copy, dependsOn: makeDistA) { from('distPackagerBase/dist') into('release') include('iZsetup_setup.jar') } task makeDistC(type: Copy, dependsOn: makeDistB) { from('distPackagerBase/64b/dist') into('release') include('iZsetup_setup.jar') rename { String fileName -> fileName.replace("iZsetup_setup.jar", "iZsetup_setup64.jar") } } task makeDistD(type:Exec, dependsOn: makeDistC) { workingDir 'release' commandLine file('release').getAbsolutePath()+'\\zip.exe', '-A', 'iZsetup_setup.jar' } task makeDistE(type:Exec, dependsOn: makeDistD) { workingDir 'release' commandLine file('release').getAbsolutePath()+'\\zip.exe', '-A', 'iZsetup_setup64.jar' } jar{ manifest{ attributes 'Implementation-Title': 'iZSetup', 'Implementation-Version': 'SNAPSHOT', 'Main-Class': 'de.nplusc.izc.InstallPak.Main' } } dependencies{ api fileTree(dir: 'lib', include: '*.jar') api "commons-io:commons-io:2.+" api 'org.apache.commons:commons-exec:1.3' api "org.yaml:snakeyaml:1.14" api "commons-net:commons-net:3.3" api group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.+' api group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.+' api group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.+' api 'org.xerial:sqlite-jdbc:3.8.7' api(project(':ToolKit')) { transitive = false } }