-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
101 lines (82 loc) · 2.29 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}
apply plugin: 'java'
apply plugin: 'application'
sourceCompatibility = 1.6
version = '1.3-iso-1.0'
jar {
manifest {
attributes 'Implementation-Title': 'StreamKB',
'Implementation-Version': version
}
}
dependencies {
compile files('lib/KeyboardHook.jar')
}
build.mustRunAfter clean
def docsDir = file("$buildDir/doc")
task copyDocFiles(type: Copy) {
from 'licence-gpl.txt'
from 'readme.txt'
into docsDir.getPath()
}
def licenseDir = file("$buildDir/lib-licenses")
task copyLicenseFiles(type: Copy) {
from 'lib/COPYRIGHT'
from 'lib/VERSION'
into licenseDir.getPath()
}
task createLicenses {
outputs.dir licenseDir
doLast {
licenseDir.mkdirs()
copyLicenseFiles.execute()
}
}
task createDist {
outputs.dir docsDir
doLast {
docsDir.mkdirs()
copyDocFiles.execute()
}
}
startScripts {
mainClassName "StreamKB"
}
applicationDistribution.from(createDist) {
into "doc"
}
applicationDistribution.from(createLicenses) {
into "lib"
}
apply from: "gradle/IO.gradle"
// Modify the Windows start script so that no console is shown when the user starts the app.
// This also creates a copy of the original start script in case we want to use the console for debugging
startScripts << {
def startScriptDir = outputDir.getAbsolutePath()
def winStartScript = startScriptDir + "/" + applicationName + ".bat"
def winStartScriptCopy = startScriptDir + "/" + applicationName + "WithConsole.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
}
}
}
installApp {
// Include the additional start script
into("bin/"){
from(startScripts.outputDir)
}
}