1
0

build.gradle 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. defaultTasks 'distZip'
  2. apply plugin: 'java-library'
  3. apply plugin: 'application'
  4. apply from: "$rootDir/utils/IO.gradle"
  5. sourceCompatibility = 1.8
  6. version = 'SNAPSHOT'
  7. mainClassName = 'de.nplusc.izc.Utilities.WPCMgr.Main'
  8. jar{
  9. manifest{
  10. attributes 'Implementation-Title': 'WPCMgr',
  11. 'Implementation-Version': 'SNAPSHOT',
  12. 'Main-Class': 'de.nplusc.izc.iZpl.Builder'
  13. }
  14. }
  15. repositories{
  16. mavenCentral()
  17. }
  18. compileJava {
  19. options.compilerArgs << '-Xlint:none'
  20. options.compilerArgs << '-Xlint:-deprecation'
  21. options.compilerArgs << '-XDignore.symbol.file'
  22. }
  23. startScripts {
  24. doLast {
  25. def startScriptDir = outputDir.getAbsolutePath()
  26. def winStartScript = startScriptDir + "/" + applicationName + ".bat"
  27. def winStartScriptCopy = startScriptDir + "/" + applicationName + "c.bat"
  28. def overwriteExistingFile = true
  29. copyFile(winStartScript, winStartScriptCopy, overwriteExistingFile)
  30. modifyFile(winStartScript) {
  31. // javaw.exe doesn't have a console
  32. if(it.contains("java.exe")){
  33. return it.replace("java.exe", "javaw.exe")
  34. }
  35. // Command that launches the app
  36. else if(it.startsWith("\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%")){
  37. return "start \"\" /b " + it
  38. }
  39. // Leave the line unchanged
  40. else{
  41. return it
  42. }
  43. }
  44. }
  45. }
  46. distZip {
  47. // Include the additional start script
  48. into(project.name+"-"+project.version+"/bin/"){
  49. from(startScripts.outputDir)
  50. include '*c.bat'
  51. }
  52. duplicatesStrategy = 'include'
  53. }
  54. dependencies{
  55. api fileTree(dir: 'lib', include: '*.jar')
  56. //api "net.rubygrapefruit:native-platform:0.9"
  57. api "commons-io:commons-io:2.+"
  58. api 'org.apache.commons:commons-exec:1.3'
  59. api "org.yaml:snakeyaml:+"
  60. api 'org.ini4j:ini4j:0.5.2'
  61. api 'mysql:mysql-connector-java:5.1.6'
  62. api group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.+'
  63. api group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.+'
  64. api group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.+'
  65. api 'org.fusesource.jansi:jansi:1.11'
  66. api 'commons-cli:commons-cli:1.3'
  67. api(project(':ToolKit')) {
  68. transitive = false
  69. }
  70. api(project(':external:java-progressbar'))
  71. api 'net.java.dev.jna:jna:4.1.0'
  72. api 'net.java.dev.jna:jna-platform:4.1.0'
  73. }