forked from ZephyrJung/keenwrite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·55 lines (40 loc) · 1.28 KB
/
release.sh
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
#!/usr/bin/env bash
# ---------------------------------------------------------------------------
# This script builds Windows, Linux, and Java archive binaries for a
# release.
# ---------------------------------------------------------------------------
source $HOME/bin/build-template
readonly FILE_PROPERTIES="${SCRIPT_DIR}/src/main/resources/bootstrap.properties"
readonly BIN_INSTALLER="${SCRIPT_DIR}/installer.sh"
DEPENDENCIES=(
"gradle,https://gradle.org"
"zip,http://infozip.sourceforge.net"
"${FILE_PROPERTIES},File containing application name"
)
execute() {
$log "Remove distribution directory"
rm -rf "${SCRIPT_DIR}/dist"
$log "Remove stale binaries"
rm -f "${application_title,,}.jar"
rm -f "${application_title,,}.bin"
rm -f "${application_title}.exe"
$log "Build Java archive"
gradle clean jar
mv "build/libs/${application_title,,}.jar" .
$log "Build Windows installer binary"
${BIN_INSTALLER} -o windows
$log "Build Linux installer binary"
${BIN_INSTALLER} -o linux
}
preprocess() {
while IFS='=' read -r key value; do
if [[ "${key}" = "" || "${key}" = "#"* ]]; then
continue
fi
key=$(echo $key | tr '.' '_')
eval ${key}=\${value}
done < "${FILE_PROPERTIES}"
application_title="${application_title}"
return 1
}
main "$@"