apply plugin: 'java-library' apply plugin: 'application' apply from: "$rootDir/utils/IO.gradle" version = '0.11.0.0-SNAPSHOT' mainClassName = 'de.nplusc.izc.izpl.plugins.jukebox.StandaloneMain' java { toolchain { sourceCompatibility = JavaLanguageVersion.of(17) targetCompatibility = JavaLanguageVersion.of(17) } } //task distZip(dependsOn: 'jar') { // //NO-OPtask als redirect //} startScripts { doLast { defaultJvmOpts = ["-Dlog4j.skipJansi=false"] // fahr zur hölle Log5J def startScriptDir = outputDir.getAbsolutePath() def winStartScript = startScriptDir + "/" + applicationName + ".bat" def winStartScriptCopy = startScriptDir + "/" + applicationName + "c.bat" def linuxStartScript = startScriptDir + "/" + applicationName def overwriteExistingFile = true copyFile(winStartScript, winStartScriptCopy, overwriteExistingFile) //:init modifyFile(winStartScript) { // javaw.exe doesn't have a console if(it.contains("java.exe")){ return it.replace("java.exe", "javaw.exe") } // Command that launches the app else if(it.startsWith("\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS%")){ return "start \"\" /b " + it } else if (it.startsWith("set DEFAULT_JVM_OPTS=")) { return it+" -Dlog4j.skipJansi=false" } else if(it.startsWith(":init")) { //HACK return it+"\n"+"set VLC_PLUGIN_PATH=%APP_HOME%\\lib\\vlcbinaries\\plugins" } // Leave the line unchanged else{ return it } } modifyFile(linuxStartScript) { if (it.startsWith("DEFAULT_JVM_OPTS=\"\"")) { return "DEFAULT_JVM_OPTS=\"-Dlog4j.skipJansi=false\"" } // Leave the line unchanged else{ return it } } modifyFile(winStartScriptCopy) { if(it.startsWith(":init")) { //HACK return it+"\n"+"set VLC_PLUGIN_PATH=%APP_HOME%\\lib\\vlcbinaries\\plugins" } else if (it.startsWith("set DEFAULT_JVM_OPTS=")) { return it+" -Dlog4j.skipJansi=false" } // Leave the line unchanged else{ return it } } } } distZip { // Include the additional start script into(project.name+"-"+project.version+"/bin/"){ from(startScripts.outputDir) include '*c.bat' } duplicatesStrategy = 'include' } compileJava.options.encoding = 'UTF-8' dependencies { api fileTree(dir: 'lib', include: '*.jar') api (project(path: ':iZpl', configuration: 'apistub')){ transitive = false // HACK for the light-mode standalone } api(project(':ToolKit')) { transitive = false } api(project(':izpl-shared')){ transitive = false } api group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.+' api group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.+' api group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.+' api group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.+' api group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '2.+' api "org.yaml:snakeyaml:1.14" api 'org.java-websocket:Java-WebSocket:1.5.3' api 'com.fasterxml.jackson.core:jackson-databind:2+' }