build.gradle 3.4 KB

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