forked from OpenTabletDriver/OpenTabletDriver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·56 lines (41 loc) · 1.85 KB
/
build.sh
File metadata and controls
executable file
·56 lines (41 loc) · 1.85 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
#!/usr/bin/env bash
# Simple bash script to easily build on linux to verify functionality.
# Uses the same commands as those found in the PKGBUILD for the AUR
# package.
prev_pwd=$(pwd)
runtime=${1:-linux-x64}
config="Release"
shift
options=(--configuration "$config" --verbosity=quiet --self-contained='false' --output='./bin' /p:PublishSingleFile=true /p:DebugType=embedded \
/p:SuppressNETCoreSdkPreviewMessage=true /p:PublishTrimmed=false --runtime=$runtime -p:SourceRevisionId=$(git rev-parse --short HEAD))
# change dir to script root, in case people run the script outside of the folder
cd "$(dirname "$0")"
# sanity check
if [ ! -d OpenTabletDriver ]; then
echo "Could not find OpenTabletDriver folder! Please put this script from the root of the OpenTabletDriver repository."
exit 1
fi
echo "Cleaning old build dirs"
if [ -d ./bin ]; then
for dir in ./bin/*; do
if [ "$dir" != "./bin/userdata" ]; then
rm -rf "$dir"
fi
done
fi
dotnet clean --configuration "$config" --verbosity=quiet
echo "Building OpenTabletDriver with runtime $runtime."
mkdir -p ./bin
echo -e "\nBuilding Daemon...\n"
dotnet publish OpenTabletDriver.Daemon ${options[@]} $@ || exit 1
echo -e "\nBuilding Console...\n"
dotnet publish OpenTabletDriver.Console ${options[@]} $@ || exit 2
echo -e "\nBuilding GTK UX...\n"
dotnet publish OpenTabletDriver.UX.Gtk ${options[@]} $@ || exit 3
echo -e "\nBuild finished successfully. Binaries created in ./bin\n"
if [ ! -f /etc/udev/rules.d/??-opentabletdriver.rules ] && [ ! -f /usr/lib/udev/rules.d/??-opentabletdriver.rules ]; then
echo "Udev rules don't seem to be installed in /etc/udev/rules.d or /usr/lib/udev/rules.d."
echo "If your distribution installs them elsewhere, ignore this message."
echo "If not, generate them by running generate-rules.sh, then follow the prompts."
fi
cd "$prev_pwd"