forked from dharmeshsing/CoinTossX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.gradle
31 lines (25 loc) · 1004 Bytes
/
install.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
apply plugin: 'application'
//Exclude properties from the jar
jar{
exclude '*.properties'
}
task copyResourcesToInstallDir(type: Copy) {
from 'src/main/resources'
into 'build/install/' + project.name + '/resources'
def myProps = new Properties()
file(rootProject.projectDir.absolutePath + '/' + project.envProp).withInputStream{
myProps.load(it);
}
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: myProps)
}
startScripts {
classpath += files('build/install/' + project.name + '/resources')
doLast {
def windowsScriptFile = file getWindowsScript()
def unixScriptFile = file getUnixScript()
windowsScriptFile.text = windowsScriptFile.text.replace('%APP_HOME%\\lib\\resources', '%APP_HOME%\\resources')
unixScriptFile.text = unixScriptFile.text.replace('$APP_HOME/lib/resources', '$APP_HOME/resources')
windowsScriptFile.setExecutable(true,true)
unixScriptFile.setExecutable(true,true)
}
}