|
@@ -2,7 +2,7 @@ defaultTasks 'distZip'
|
|
|
|
|
|
apply plugin: 'java'
|
|
|
apply plugin: 'application'
|
|
|
-
|
|
|
+apply from: "$rootDir/utils/IO.gradle"
|
|
|
|
|
|
sourceCompatibility = 1.8
|
|
|
version = 'SNAPSHOT'
|
|
@@ -29,14 +29,48 @@ options.compilerArgs << '-Xlint:-deprecation'
|
|
|
|
|
|
options.compilerArgs << '-XDignore.symbol.file'
|
|
|
}
|
|
|
+startScripts << {
|
|
|
+
|
|
|
+ def startScriptDir = outputDir.getAbsolutePath()
|
|
|
+ def winStartScript = startScriptDir + "/" + applicationName + ".bat"
|
|
|
+ def winStartScriptCopy = startScriptDir + "/" + applicationName + "c.bat"
|
|
|
+ def overwriteExistingFile = true
|
|
|
+ copyFile(winStartScript, winStartScriptCopy, overwriteExistingFile)
|
|
|
+
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ // 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'
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
dependencies{
|
|
|
compile fileTree(dir: 'lib', include: '*.jar')
|
|
|
+ compile "net.rubygrapefruit:native-platform:0.9"
|
|
|
compile "commons-io:commons-io:2.+"
|
|
|
compile 'org.apache.commons:commons-exec:1.3'
|
|
|
compile "org.yaml:snakeyaml:1.14"
|
|
|
compile 'org.ini4j:ini4j:0.5.2'
|
|
|
compile 'mysql:mysql-connector-java:5.1.6'
|
|
|
+ compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.1'
|
|
|
+ compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.1'
|
|
|
+ compile group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.1'
|
|
|
compile(project(':ToolKit')) {
|
|
|
transitive = false
|
|
|
}
|