build.gradle 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. jcenter()
  17. }
  18. compileJava {
  19. options.compilerArgs << '-Xlint:none'
  20. options.compilerArgs << '-Xlint:-deprecation'
  21. options.compilerArgs << '-XDignore.symbol.file'
  22. }
  23. startScripts << {
  24. def startScriptDir = outputDir.getAbsolutePath()
  25. def winStartScript = startScriptDir + "/" + applicationName + ".bat"
  26. def winStartScriptCopy = startScriptDir + "/" + applicationName + "c.bat"
  27. def overwriteExistingFile = true
  28. copyFile(winStartScript, winStartScriptCopy, overwriteExistingFile)
  29. modifyFile(winStartScript) {
  30. // javaw.exe doesn't have a console
  31. if(it.contains("java.exe")){
  32. return it.replace("java.exe", "javaw.exe")
  33. }
  34. // Command that launches the app
  35. else if(it.startsWith("\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%")){
  36. return "start \"\" /b " + it
  37. }
  38. // Leave the line unchanged
  39. else{
  40. return it
  41. }
  42. }
  43. }
  44. distZip {
  45. // Include the additional start script
  46. into(project.name+"-"+project.version+"/bin/"){
  47. from(startScripts.outputDir)
  48. include '*c.bat'
  49. }
  50. }
  51. dependencies{
  52. compile fileTree(dir: 'lib', include: '*.jar')
  53. compile "net.rubygrapefruit:native-platform:0.9"
  54. compile "commons-io:commons-io:2.+"
  55. compile 'org.apache.commons:commons-exec:1.3'
  56. compile "org.yaml:snakeyaml:+"
  57. compile 'org.ini4j:ini4j:0.5.2'
  58. compile 'mysql:mysql-connector-java:5.1.6'
  59. compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.1'
  60. compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.1'
  61. compile group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.1'
  62. compile 'org.fusesource.jansi:jansi:1.11'
  63. compile 'commons-cli:commons-cli:1.3'
  64. compile(project(':ToolKit')) {
  65. transitive = false
  66. }
  67. compile(project(':external:java-progressbar'))
  68. compile 'net.java.dev.jna:jna:4.1.0'
  69. compile 'net.java.dev.jna:jna-platform:4.1.0'
  70. }