-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonoaction
executable file
·87 lines (76 loc) · 2.27 KB
/
monoaction
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
NAME="WorldEditor"
ASSETS="Assets"
CONTENT="Assets/Content"
LEVEL_EDITOR="/home/ark/Documents/game/tools/ldtk"
DESKTOP="Source/$NAME.Desktop"
CORE="Source/$NAME.Core"
NEZ="Vendor/Nez"
PROJECT_NAME=$NAME.Desktop
PROJECT=$DESKTOP
echo $NAME
pkill dotnet
if [[ $1 == "build" ]]; then
dotnet build -c Debug $PROJECT
dotnet run --project $PROJECT
elif [[ $1 == "run" ]]; then
dotnet run --project $DESKTOP
elif [[ $1 == "last" ]]; then
$DESKTOP/bin/Debug/net8.0/$PROJECT_NAME
elif [[ $1 == "runlog" ]]; then
dotnet run --project $PROJECT > ./Logs/stdout.txt 2> ./Logs/stderr.txt
# Build the project in windows to be run with GDB and grant debuginfod in immediate mode
elif [[ $1 == "debug" ]]; then
dotnet build --sc -c Release --os win $PROJECT
gdb gdb -ex "run" --args $PROJECT/bin/Release/net8.0/win-x64/$PROJECT_NAME.exe <<EOF
y
EOF
elif [[ $1 == "debug_last" ]]; then
gdb gdb -ex "run" --args $PROJECT/bin/Release/net8.0/win-x64/$PROJECT_NAME.exe <<EOF
y
EOF
elif [[ $1 == "content" ]]; then
echo "Content pipeline $DESKTOP"
cd $DESKTOP
dotnet mgcb-editor ../../$CONTENT/Content.mgcb
sleep 5
elif [[ $1 == "level" ]]; then
echo "Level editor"
cd $LEVEL_EDITOR/app
npm run start
elif [[ $1 == "clean" ]]; then
echo "Clear"
rm -r $DESKTOP/bin
rm -r $DESKTOP/obj
rm -r $CORE/bin
rm -r $CORE/obj
rm -r $NEZ/Nez.ImGui/bin
rm -r $NEZ/Nez.ImGui/obj
rm -r $NEZ/Nez.Portable/bin
rm -r $NEZ/Nez.Portable/obj
rm -r $NEZ/Nez.Persistence/bin
rm -r $NEZ/Nez.Persistence/obj
rm -r $NEZ/Nez.FarseerPhysics/bin
rm -r $NEZ/Nez.FarseerPhysics/obj
cd $DESKTOP
dotnet clean
dotnet restore
elif [[ $1 == "t4" ]]; then
source ~/.zshrc > /dev/null 2>&1
echo "Generating content paths..."
t4 -o Source/$NAME.Core/ContentPathGenerator.cs Source/$NAME.Core/ContentPathGenerator.tt
file_path=Source/$NAME.Core/ContentPathGenerator.cs
new_content="class $ASSETS"
sed -i 's/Nez/'"$NAME"'/g' "$file_path"
sed -i 's/class Content/'"$new_content"'/g' "$file_path"
sed -i "s|../../$ASSETS/||g" "$file_path"
sed -i "s|.png||g" "$file_path"
sed -i "s|.ttf||g" "$file_path"
sed -i "s|.txt||g" "$file_path"
sed -i "s|.json||g" "$file_path"
sed -i "s|.fnt||g" "$file_path"
sed -i "s|Raw/||g" "$file_path"
else
echo "Unrecognized"
fi
pkill dotnet