build.gradle 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. defaultTasks 'distZip'
  2. apply plugin: 'java'
  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. }
  53. dependencies{
  54. compile fileTree(dir: 'lib', include: '*.jar')
  55. //compile "net.rubygrapefruit:native-platform:0.9"
  56. compile "commons-io:commons-io:2.+"
  57. compile 'org.apache.commons:commons-exec:1.3'
  58. compile "org.yaml:snakeyaml:+"
  59. compile 'org.ini4j:ini4j:0.5.2'
  60. compile 'mysql:mysql-connector-java:5.1.6'
  61. compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.+'
  62. compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.+'
  63. compile group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.+'
  64. compile 'org.fusesource.jansi:jansi:1.11'
  65. compile 'commons-cli:commons-cli:1.3'
  66. compile(project(':ToolKit')) {
  67. transitive = false
  68. }
  69. compile(project(':external:java-progressbar'))
  70. compile 'net.java.dev.jna:jna:4.1.0'
  71. compile 'net.java.dev.jna:jna-platform:4.1.0'
  72. }