build.gradle 2.9 KB

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