build.gradle 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. evaluationDependsOn(':iZplPlugins:GameRadio')
  2. evaluationDependsOn(':iZplPlugins:WMP')
  3. evaluationDependsOn(':iZplPlugins:Editor')
  4. evaluationDependsOn(':iZplPlugins:rtsslink')
  5. evaluationDependsOn(':iZplPlugins:JukeBox')
  6. defaultTasks 'distZip'
  7. apply plugin: 'java'
  8. apply plugin: 'application'
  9. apply from: "$rootDir/utils/IO.gradle"
  10. version = '0.9.0.0-snapshot'
  11. mainClassName = 'de.nplusc.izc.iZpl.Main'
  12. //'de.nplusc.izc.iZpl.Main'
  13. jar{
  14. manifest{
  15. attributes 'Implementation-Title': 'iZPlaylist',
  16. 'Implementation-Version': version,
  17. 'Main-Class': 'de.nplusc.izc.iZpl.Main'
  18. }
  19. }
  20. startScripts << {
  21. defaultJvmOpts = ["-Dlog4j.skipJansi=false"] // fahr zur hölle Log5J
  22. def startScriptDir = outputDir.getAbsolutePath()
  23. def winStartScript = startScriptDir + "/" + applicationName + ".bat"
  24. def winStartScriptCopy = startScriptDir + "/" + applicationName + "c.bat"
  25. def linuxStartScript = startScriptDir + "/" + applicationName
  26. def overwriteExistingFile = true
  27. copyFile(winStartScript, winStartScriptCopy, overwriteExistingFile)
  28. //:init
  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. else if (it.startsWith("set DEFAULT_JVM_OPTS="))
  39. {
  40. return it+" -Dlog4j.skipJansi=false"
  41. }
  42. else if(it.startsWith(":init"))
  43. {
  44. //HACK
  45. return it+"\n"+"set VLC_PLUGIN_PATH=%APP_HOME%\\lib\\vlcbinaries\\plugins"
  46. }
  47. // Leave the line unchanged
  48. else{
  49. return it
  50. }
  51. }
  52. modifyFile(linuxStartScript) {
  53. if (it.startsWith("DEFAULT_JVM_OPTS=\"\""))
  54. {
  55. return "DEFAULT_JVM_OPTS=\"-Dlog4j.skipJansi=false\""
  56. }
  57. // Leave the line unchanged
  58. else{
  59. return it
  60. }
  61. }
  62. modifyFile(winStartScriptCopy) {
  63. if(it.startsWith(":init"))
  64. {
  65. //HACK
  66. return it+"\n"+"set VLC_PLUGIN_PATH=%APP_HOME%\\lib\\vlcbinaries\\plugins"
  67. }
  68. else if (it.startsWith("set DEFAULT_JVM_OPTS="))
  69. {
  70. return it+" -Dlog4j.skipJansi=false"
  71. }
  72. // Leave the line unchanged
  73. else{
  74. return it
  75. }
  76. }
  77. }
  78. distZip {
  79. // Include the additional start script
  80. into(project.name+"-"+project.version+"/bin/"){
  81. from(startScripts.outputDir)
  82. include '*c.bat'
  83. }
  84. into(project.name+"-"+project.version+"/plugins/"){
  85. from project(':iZplPlugins:GameRadio').jar
  86. from project(':iZplPlugins:WMP').jar
  87. from project(':iZplPlugins:Editor').jar
  88. from project(':iZplPlugins:rtsslink').jar
  89. from project(':iZplPlugins:JukeBox').jar
  90. }
  91. }
  92. sourceSets{
  93. main{
  94. resources{
  95. exclude '**/*.xcf'
  96. }
  97. }
  98. }
  99. dependencies{
  100. compile fileTree(dir: 'lib', include: '*.jar')
  101. compile "net.rubygrapefruit:native-platform:0.9"
  102. compile "commons-io:commons-io:2.+"
  103. compile 'org.apache.commons:commons-exec:1.3'
  104. compile "org.yaml:snakeyaml:1.14"
  105. compile "commons-net:commons-net:3.3"
  106. compile 'uk.co.caprica:vlcj:+'
  107. compile 'com.googlecode.mp4parser:isoparser:1.0-RC-1'
  108. compile 'de.schlichtherle.truezip:truezip-file:7.7.7'
  109. compile 'de.schlichtherle.truezip:truezip-driver-zip:7.7.7'
  110. compile 'de.schlichtherle.truezip:truezip-driver-file:7.7.7'
  111. compile 'de.schlichtherle.truezip:truezip-driver-tar:7.7.7'
  112. compile 'de.schlichtherle.truezip:truezip-kernel:7.7.7'
  113. compile 'de.schlichtherle.truezip:truezip-path:7.7.7'
  114. compile 'de.schlichtherle.truezip:truezip-driver-tzp:7.7.7'
  115. compile 'de.schlichtherle.truezip:truezip-driver-http:7.7.7'
  116. compile 'commons-cli:commons-cli:1.3'
  117. compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.1'
  118. compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.1'
  119. compile group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.11.1'
  120. compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.11.1'
  121. compile group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '2.11.1'
  122. compile 'org.fusesource.jansi:jansi:1.11'
  123. compile 'org.jgrapht:jgrapht-core:0.9.0'
  124. compile(project(':ToolKit')) {
  125. transitive = false
  126. }
  127. compile(project(':izpl-shared'))
  128. }