This repository was archived by the owner on Aug 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathpackage
More file actions
executable file
·61 lines (50 loc) · 1.37 KB
/
package
File metadata and controls
executable file
·61 lines (50 loc) · 1.37 KB
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
#!/usr/bin/env bash
SCRIPT_DIR=$(realpath $(dirname ${BASH_SOURCE[0]}))
[ ! -d "${SCRIPT_DIR}" ] && exit 100;
source "${SCRIPT_DIR}/../base"
# Build arguments
FRAMEWORK="net6.0"
RUNTIME="osx-x64"
PROJECTS=("OpenTabletDriver.Daemon" "OpenTabletDriver.UX.MacOS")
# Directories
PKG_DIR="${SCRIPT_DIR}/OpenTabletDriver.app"
OUT_DIR="${PKG_DIR}/Contents/MacOS"
# Package
PKG_ICONS_FILE="${PKG_DIR}/Contents/Resources/Icon.icns"
PKG_TARBALL_FILE="${SCRIPT_DIR}/OpenTabletDriver.${RUNTIME}.tar.gz"
clean() {
clean_target "${PKG_TARBALL_FILE}" "Cleaning up existing builds..."
clean_target "${OUT_DIR}" "Cleaning up build directory..."
}
build() {
print "Building OpenTabletDriver..."
for project in ${PROJECTS[@]}; do
dotnet publish "${SRC_DIR}/${project}"\
--runtime ${RUNTIME} \
--configuration Release \
--self-contained true \
--framework ${FRAMEWORK} \
--output ${OUT_DIR} \
/p:PublishTrimmed=false \
/p:VersionSuffix="${VERSION_SUFFIX}"
done
}
package() {
clean_debug "${OUT_DIR}"
print "Copying MacOS assets..."
cp -v "${SRC_DIR}/OpenTabletDriver.UX.MacOS/Icon.icons" "${PKG_ICONS_FILE}"
create_tarball "${PKG_DIR}" "${PKG_TARBALL_FILE}"
print "Packaging complete."
}
case $1 in
"clean") clean ;;
"prepare") prepare ;;
"build") build ;;
"package") package ;;
*)
clean
prepare
build
package
;;
esac