build.gradle 4.4 KB

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