build.gradle 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. apply plugin: 'java-library'
  2. apply plugin: 'application'
  3. apply from: "$rootDir/utils/IO.gradle"
  4. version = '0.11.0.0-SNAPSHOT'
  5. mainClassName = 'de.nplusc.izc.izpl.plugins.jukebox.StandaloneMain'
  6. //task distZip(dependsOn: 'jar') {
  7. // //NO-OPtask als redirect
  8. //}
  9. startScripts {
  10. doLast {
  11. defaultJvmOpts = ["-Dlog4j.skipJansi=false"] // fahr zur hölle Log5J
  12. def startScriptDir = outputDir.getAbsolutePath()
  13. def winStartScript = startScriptDir + "/" + applicationName + ".bat"
  14. def winStartScriptCopy = startScriptDir + "/" + applicationName + "c.bat"
  15. def linuxStartScript = startScriptDir + "/" + applicationName
  16. def overwriteExistingFile = true
  17. copyFile(winStartScript, winStartScriptCopy, overwriteExistingFile)
  18. //:init
  19. modifyFile(winStartScript) {
  20. // javaw.exe doesn't have a console
  21. if(it.contains("java.exe")){
  22. return it.replace("java.exe", "javaw.exe")
  23. }
  24. // Command that launches the app
  25. else if(it.startsWith("\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%")){
  26. return "start \"\" /b " + it
  27. }
  28. else if (it.startsWith("set DEFAULT_JVM_OPTS="))
  29. {
  30. return it+" -Dlog4j.skipJansi=false"
  31. }
  32. else if(it.startsWith(":init"))
  33. {
  34. //HACK
  35. return it+"\n"+"set VLC_PLUGIN_PATH=%APP_HOME%\\lib\\vlcbinaries\\plugins"
  36. }
  37. // Leave the line unchanged
  38. else{
  39. return it
  40. }
  41. }
  42. modifyFile(linuxStartScript) {
  43. if (it.startsWith("DEFAULT_JVM_OPTS=\"\""))
  44. {
  45. return "DEFAULT_JVM_OPTS=\"-Dlog4j.skipJansi=false\""
  46. }
  47. // Leave the line unchanged
  48. else{
  49. return it
  50. }
  51. }
  52. modifyFile(winStartScriptCopy) {
  53. if(it.startsWith(":init"))
  54. {
  55. //HACK
  56. return it+"\n"+"set VLC_PLUGIN_PATH=%APP_HOME%\\lib\\vlcbinaries\\plugins"
  57. }
  58. else if (it.startsWith("set DEFAULT_JVM_OPTS="))
  59. {
  60. return it+" -Dlog4j.skipJansi=false"
  61. }
  62. // Leave the line unchanged
  63. else{
  64. return it
  65. }
  66. }
  67. }
  68. }
  69. distZip {
  70. // Include the additional start script
  71. into(project.name+"-"+project.version+"/bin/"){
  72. from(startScripts.outputDir)
  73. include '*c.bat'
  74. }
  75. duplicatesStrategy = 'include'
  76. }
  77. compileJava.options.encoding = 'UTF-8'
  78. dependencies
  79. {
  80. api fileTree(dir: 'lib', include: '*.jar')
  81. api (project(path: ':iZpl', configuration: 'apistub')){
  82. transitive = false
  83. // HACK for the light-mode standalone
  84. }
  85. api(project(':ToolKit')) {
  86. transitive = false
  87. }
  88. api(project(':izpl-shared')){
  89. transitive = false
  90. }
  91. api group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.+'
  92. api group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.+'
  93. api group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.+'
  94. api group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.+'
  95. api group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '2.+'
  96. api "org.yaml:snakeyaml:1.14"
  97. api 'org.java-websocket:Java-WebSocket:1.5.3'
  98. api 'com.fasterxml.jackson.core:jackson-databind:2+'
  99. }