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
·78 lines (65 loc) · 1.88 KB
/
Copy pathpackage
File metadata and controls
executable file
·78 lines (65 loc) · 1.88 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env bash
SCRIPT_DIR=$(realpath $(dirname ${BASH_SOURCE[0]}))
[ ! -d "${SCRIPT_DIR}" ] && exit 100;
source "${SCRIPT_DIR}/../base"
RUNTIMES=("osx-x64" "osx-arm64")
package_with() {
# Build arguments
FRAMEWORK="net6.0"
RUNTIME=$1
PROJECTS=("OpenTabletDriver.Daemon" "OpenTabletDriver.UX.MacOS")
# Directories
SRC_PKG_DIR="${SCRIPT_DIR}/OpenTabletDriver.app"
RUNTIME_DIR="${SCRIPT_DIR}/${RUNTIME}"
PKG_DIR="${RUNTIME_DIR}/OpenTabletDriver.app"
OUT_DIR="${PKG_DIR}/Contents/MacOS"
# Package
PKG_TARBALL_FILE="${SCRIPT_DIR}/OpenTabletDriver.${RUNTIME}.tar.gz"
clean() {
clean_target "${PKG_TARBALL_FILE}" "Cleaning up existing builds..."
clean_target "${RUNTIME_DIR}" "Cleaning up build directory..."
}
build() {
print "Building ${RUNTIME} OpenTabletDriver..."
mkdir -p "${PKG_DIR}"
cp -r "${SRC_PKG_DIR}" "${RUNTIME_DIR}"
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}" \
/p:MacIsBuildingBundle=true #prevent eto from generating app bundle since we are bundling ourselves
done
}
package() {
clean_debug "${OUT_DIR}"
if type -p codesign
then
print "Signing ${RUNTIME} MacOS App..."
codesign -s - -f --deep "${PKG_DIR}"
else
print "Skipping signing ${RUNTIME} MacOS App..."
fi
create_tarball "${PKG_DIR}" "${PKG_TARBALL_FILE}"
print "Packaging ${RUNTIME} complete."
}
case $2 in
"clean") clean ;;
"prepare") prepare ;;
"build") build ;;
"package") package ;;
*)
clean
prepare
build
package
;;
esac
}
for runtime in ${RUNTIMES[@]}; do
package_with $runtime $1
done