This repository has been archived by the owner on Feb 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 227
/
installer.gradle
45 lines (38 loc) · 1.65 KB
/
installer.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
import static org.opendatakit.aggregate.gradle.Util.*
task installerClean() {
delete 'build/installer'
delete 'build/installers'
}
task installerBuild(dependsOn: [installerClean], type: Copy) {
into "${buildDir}/installer"
from fileTree(dir: 'installer/project')
into('files') {
from "${buildDir}/libs/${archivesBaseName}-${version}.war"
}
into('files/conf/common') {
from files(
'src/main/resources/logging.properties',
'src/main/resources/odk-common-security-settings.xml',
'src/main/resources/odk-security-settings.xml',
'src/main/resources/security.properties'
)
}
doLast {
setXmlValue("${buildDir}/installer/buildWar.xml", "version", version)
file("${buildDir}/installer/files/${archivesBaseName}-${version}.war").renameTo(file("build/installer/files/ODKAggregate.war"))
if (installBuilderHome != null) {
run("mkdir", "${buildDir}/installers")
setXmlValue("${buildDir}/installer/buildWar.xml", "outputDirectory", "${buildDir}/installers")
[["linux-x64", "Linux-x64.run"],
["linux", "Linux.run"],
["windows", "Windows.exe"],
["osx", "macOS.app"]
].forEach({ pair ->
setXmlValue("${buildDir}/installer/buildWar.xml", "installerFilename", "ODK-Aggregate-${version}-${pair[1]}")
run("${installBuilderHome}/bin/builder", "build", "${buildDir}/installer/buildWar.xml", "${pair[0]}")
runInWorkingDir("${buildDir}/installers", "zip", "-r", "ODK-Aggregate-${version}-${pair[1]}.zip", "ODK-Aggregate-${version}-${pair[1]}")
runInWorkingDir("${buildDir}/installers", "rm", "-r", "ODK-Aggregate-${version}-${pair[1]}")
})
}
}
}