| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # --------------------------------------------------------------------------- |
| 4 | # This script builds Windows, Linux, and Java archive binaries for a |
| 5 | # release. |
| 6 | # --------------------------------------------------------------------------- |
| 7 | |
| 8 | source $HOME/bin/build-template |
| 9 | |
| 10 | readonly FILE_PROPERTIES="${SCRIPT_DIR}/src/main/resources/bootstrap.properties" |
| 11 | readonly BIN_INSTALLER="${SCRIPT_DIR}/installer" |
| 12 | |
| 13 | DEPENDENCIES=( |
| 14 | "gradle,https://gradle.org" |
| 15 | "${FILE_PROPERTIES},File containing application name" |
| 16 | ) |
| 17 | |
| 18 | execute() { |
| 19 | $log "Build Windows installer binary" |
| 20 | ${BIN_INSTALLER} -o windows |
| 21 | |
| 22 | $log "Build Linux installer binary" |
| 23 | ${BIN_INSTALLER} -o linux |
| 24 | |
| 25 | $log "Build Java archive" |
| 26 | gradle clean jar |
| 27 | mv "build/libs/${application_title}.jar" . |
| 28 | } |
| 29 | |
| 30 | preprocess() { |
| 31 | while IFS='=' read -r key value; do |
| 32 | if [[ "${key}" = "" || "${key}" = "#"* ]]; then |
| 33 | continue |
| 34 | fi |
| 35 | |
| 36 | key=$(echo $key | tr '.' '_') |
| 37 | eval ${key}=\${value} |
| 38 | done < "${FILE_PROPERTIES}" |
| 39 | |
| 40 | application_title="${application_title,,}" |
| 41 | |
| 42 | return 1 |
| 43 | } |
| 44 | |
| 45 | main "$@" |
| 46 | |
| 1 | 47 | |