build.gradle 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. evaluationDependsOn(':iZplPlugins:GameRadio')
  2. evaluationDependsOn(':iZplPlugins:WMP')
  3. evaluationDependsOn(':iZplPlugins:Editor')
  4. evaluationDependsOn(':iZplPlugins:rtsslink')
  5. evaluationDependsOn(':iZplPlugins:JukeBox')
  6. evaluationDependsOn(':iZplPlugins:Extractor')
  7. evaluationDependsOn(':iZplPlugins:discordjukebox')
  8. defaultTasks 'distZip'
  9. apply plugin: 'java'
  10. apply plugin: 'application'
  11. apply from: "$rootDir/utils/IO.gradle"
  12. version = '0.11.0.0-SNAPSHOT'
  13. mainClassName = 'de.nplusc.izc.iZpl.Main'
  14. //'de.nplusc.izc.iZpl.Main'
  15. jar{
  16. manifest{
  17. attributes 'Implementation-Title': 'iZPlaylist',
  18. 'Implementation-Version': version,
  19. 'Main-Class': 'de.nplusc.izc.iZpl.Main'
  20. }
  21. }
  22. startScripts {
  23. doLast {
  24. defaultJvmOpts = ["-Dlog4j.skipJansi=false"] // fahr zur hölle Log5J
  25. def startScriptDir = outputDir.getAbsolutePath()
  26. def winStartScript = startScriptDir + "/" + applicationName + ".bat"
  27. def winStartScriptCopy = startScriptDir + "/" + applicationName + "c.bat"
  28. def linuxStartScript = startScriptDir + "/" + applicationName
  29. def overwriteExistingFile = true
  30. copyFile(winStartScript, winStartScriptCopy, overwriteExistingFile)
  31. //:init
  32. modifyFile(winStartScript) {
  33. // javaw.exe doesn't have a console
  34. if(it.contains("java.exe")){
  35. return it.replace("java.exe", "javaw.exe")
  36. }
  37. // Command that launches the app
  38. else if(it.startsWith("\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%")){
  39. return "start \"\" /b " + it
  40. }
  41. else if (it.startsWith("set DEFAULT_JVM_OPTS="))
  42. {
  43. return it+" -Dlog4j.skipJansi=false"
  44. }
  45. else if(it.startsWith(":init"))
  46. {
  47. //HACK
  48. return it+"\n"+"set VLC_PLUGIN_PATH=%APP_HOME%\\lib\\vlcbinaries\\plugins"
  49. }
  50. // Leave the line unchanged
  51. else{
  52. return it
  53. }
  54. }
  55. modifyFile(linuxStartScript) {
  56. if (it.startsWith("DEFAULT_JVM_OPTS=\"\""))
  57. {
  58. return "DEFAULT_JVM_OPTS=\"-Dlog4j.skipJansi=false\""
  59. }
  60. // Leave the line unchanged
  61. else{
  62. return it
  63. }
  64. }
  65. modifyFile(winStartScriptCopy) {
  66. if(it.startsWith(":init"))
  67. {
  68. //HACK
  69. return it+"\n"+"set VLC_PLUGIN_PATH=%APP_HOME%\\lib\\vlcbinaries\\plugins"
  70. }
  71. else if (it.startsWith("set DEFAULT_JVM_OPTS="))
  72. {
  73. return it+" -Dlog4j.skipJansi=false"
  74. }
  75. // Leave the line unchanged
  76. else{
  77. return it
  78. }
  79. }
  80. }
  81. }
  82. distZip {
  83. // Include the additional start script
  84. into(project.name+"-"+project.version+"/bin/"){
  85. from(startScripts.outputDir)
  86. include '*c.bat'
  87. }
  88. into(project.name+"-"+project.version+"/plugins/"){
  89. from project(':iZplPlugins:GameRadio').jar
  90. from project(':iZplPlugins:WMP').jar
  91. from project(':iZplPlugins:Editor').jar
  92. from project(':iZplPlugins:rtsslink').jar
  93. from project(':iZplPlugins:JukeBox').jar
  94. from project(':iZplPlugins:Extractor').jar
  95. from project(':iZplPlugins:discordjukebox').jar
  96. }
  97. }
  98. task apiJar(type: Jar, dependsOn: compileJava) {
  99. baseName = project.name + '-apistub'
  100. from sourceSets.main.output
  101. include '**/iZpl/API/*'
  102. }
  103. sourceSets{
  104. main{
  105. resources{
  106. exclude '**/*.xcf'
  107. }
  108. }
  109. }
  110. dependencies{
  111. compile fileTree(dir: 'lib', include: '*.jar')
  112. //compile "net.rubygrapefruit:native-platform:0.9"
  113. compile "commons-io:commons-io:2.+"
  114. compile 'org.apache.commons:commons-exec:1.3'
  115. compile "org.yaml:snakeyaml:1.14"
  116. compile "commons-net:commons-net:3.3"
  117. compile 'uk.co.caprica:vlcj:4.+'
  118. compile 'com.googlecode.mp4parser:isoparser:1.0-RC-1'
  119. compile 'net.java.truevfs:truevfs-profile-default_2.11:0.12.0'
  120. compile 'commons-cli:commons-cli:1.3'
  121. compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.+'
  122. compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.+'
  123. compile group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.+'
  124. compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.+'
  125. compile group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '2.+'
  126. compile 'org.fusesource.jansi:jansi:1.11'
  127. compile 'org.jgrapht:jgrapht-core:0.9.0'
  128. compile(project(':external:java-progressbar'))
  129. compile(project(':ToolKit')) {
  130. transitive = false
  131. }
  132. compile(project(':izpl-shared'))
  133. }
  134. configurations {
  135. apistub
  136. }
  137. artifacts {
  138. apistub apiJar
  139. }