1
0

build.gradle 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. defaultTasks 'distZip'
  2. apply plugin: 'java-library'
  3. apply plugin: 'application'
  4. sourceCompatibility = 1.8
  5. version = 'SNAPSHOT'
  6. task fatJar(type: Jar) {
  7. manifest{
  8. attributes 'Implementation-Title': 'iZSetup',
  9. 'Implementation-Version': 'SNAPSHOT',
  10. 'Main-Class': 'de.nplusc.izc.InstallPak.Main'
  11. }
  12. baseName = project.name + '-all'
  13. from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
  14. with jar
  15. }
  16. task izsetupDist(type: IZSetupPkgTask, dependsOn: 'makeDistC')
  17. class IZSetupPkgTask extends DefaultTask {
  18. @TaskAction
  19. def work() {
  20. println 'iZsetupCustomPackaging finished'
  21. }
  22. }
  23. mainClassName = 'de.nplusc.izc.InstallPak.Main'
  24. task makeDistA(type:Exec, dependsOn: 'fatJar') {
  25. File jarschiv = file(tasks.fatJar.archivePath)
  26. File WrkDir = file('distPackagerBase/')
  27. commandLine 'java', '-jar', jarschiv.getAbsolutePath() , '--makedist','0' , WrkDir.getAbsolutePath() , jarschiv.getAbsolutePath()
  28. }
  29. makeDistA.inputs.file file(tasks.fatJar.archivePath)
  30. makeDistA.outputs.file file('distPackagerBase/dist/iZsetup_setup.jar')
  31. task makeDistB(type: Copy, dependsOn: makeDistA) {
  32. from('distPackagerBase/dist')
  33. into('release')
  34. include('iZsetup_setup.jar')
  35. }
  36. task makeDistC(type: Copy, dependsOn: makeDistB) {
  37. from('distPackagerBase/64b/dist')
  38. into('release')
  39. include('iZsetup_setup.jar')
  40. rename { String fileName ->
  41. fileName.replace("iZsetup_setup.jar", "iZsetup_setup64.jar")
  42. }
  43. }
  44. task makeDistD(type:Exec, dependsOn: makeDistC) {
  45. workingDir 'release'
  46. commandLine file('release').getAbsolutePath()+'\\zip.exe', '-A', 'iZsetup_setup.jar'
  47. }
  48. task makeDistE(type:Exec, dependsOn: makeDistD) {
  49. workingDir 'release'
  50. commandLine file('release').getAbsolutePath()+'\\zip.exe', '-A', 'iZsetup_setup64.jar'
  51. }
  52. jar{
  53. manifest{
  54. attributes 'Implementation-Title': 'iZSetup',
  55. 'Implementation-Version': 'SNAPSHOT',
  56. 'Main-Class': 'de.nplusc.izc.InstallPak.Main'
  57. }
  58. }
  59. dependencies{
  60. api fileTree(dir: 'lib', include: '*.jar')
  61. api "commons-io:commons-io:2.+"
  62. api 'org.apache.commons:commons-exec:1.3'
  63. api "org.yaml:snakeyaml:1.14"
  64. api "commons-net:commons-net:3.3"
  65. api group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.+'
  66. api group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.+'
  67. api group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.+'
  68. api 'org.xerial:sqlite-jdbc:3.8.7'
  69. api(project(':ToolKit')) {
  70. transitive = false
  71. }
  72. }