-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Expand file tree
/
Copy pathlayout.sh
More file actions
executable file
·87 lines (72 loc) · 1.68 KB
/
layout.sh
File metadata and controls
executable file
·87 lines (72 loc) · 1.68 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
79
80
81
82
83
84
85
86
87
#!/bin/bash
set -eu
die () {
echo "$*" >&2
exit 1
}
make_absolute () {
case "$1" in
/*)
echo "$1"
;;
*)
echo "$PWD/$1"
;;
esac
}
# Parse script arguments
for i in "$@"
do
case "$i" in
--configuration=*)
CONFIGURATION="${i#*=}"
shift # past argument=value
;;
*)
# unknown option
;;
esac
done
# Directories
THISDIR="$( cd "$(dirname "$0")" || exit 1 ; pwd -P )"
ROOT="$( cd "$THISDIR"/../../.. || exit 1 ; pwd -P )"
SRC="$ROOT/src"
OUT="$ROOT/out"
GCM_SRC="$SRC/shared/Git-Credential-Manager"
PROJ_OUT="$OUT/linux/Packaging.Linux"
# Build parameters
FRAMEWORK=net8.0
RUNTIME=linux-x64
# Perform pre-execution checks
CONFIGURATION="${CONFIGURATION:=Debug}"
# Outputs
PAYLOAD="$PROJ_OUT/$CONFIGURATION/payload"
SYMBOLOUT="$PROJ_OUT/$CONFIGURATION/payload.sym"
# Cleanup payload directory
if [ -d "$PAYLOAD" ]; then
echo "Cleaning existing payload directory '$PAYLOAD'..."
rm -rf "$PAYLOAD"
fi
# Cleanup symbol directory
if [ -d "$SYMBOLOUT" ]; then
echo "Cleaning existing symbols directory '$SYMBOLOUT'..."
rm -rf "$SYMBOLOUT"
fi
# Ensure directories exists
mkdir -p "$PAYLOAD" "$SYMBOLOUT"
if [ -z "${DOTNET_ROOT+x}" ]; then
DOTNET_ROOT="$(dirname "$(which dotnet)")"
fi
# Publish core application executables
echo "Publishing core application..."
"$DOTNET_ROOT"/dotnet publish "$GCM_SRC" \
--configuration="$CONFIGURATION" \
--framework="$FRAMEWORK" \
--runtime="$RUNTIME" \
--self-contained \
-p:PublishSingleFile=true \
--output="$(make_absolute "$PAYLOAD")" || exit 1
# Collect symbols
echo "Collecting managed symbols..."
mv "$PAYLOAD"/*.pdb "$SYMBOLOUT" || exit 1
echo "Build complete."