forked from mkaring/ConfuserEx
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sh
More file actions
52 lines (40 loc) · 1.39 KB
/
Copy pathbuild.sh
File metadata and controls
52 lines (40 loc) · 1.39 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
#!/bin/bash
set -e
ROOT="$(cd "$(dirname "$0")" && pwd)"
CONFIG="${1:-Release}"
OUTPUT="${2:-$ROOT/bin/$CONFIG}"
# Find MSBuild via vswhere
MSBUILD="$("$(cygpath 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe')" \
-latest -requires Microsoft.Component.MSBuild \
-find 'MSBuild\**\Bin\MSBuild.exe' 2>/dev/null | head -1)"
if [ -z "$MSBUILD" ]; then
echo "[ERROR] MSBuild not found. Install Visual Studio with C++ build tools."
exit 1
fi
MSBUILD="$(cygpath "$MSBUILD")"
WIN_SLN="$(cygpath -w "$ROOT/Confuser2.sln")"
echo "============================================"
echo " Building ConfuserEx ($CONFIG)"
echo "============================================"
"$MSBUILD" -t:Restore "$WIN_SLN"
"$MSBUILD" -p:Configuration="$CONFIG" "$WIN_SLN"
# Verify core outputs exist
CLI_BIN="$ROOT/Confuser.CLI/bin/$CONFIG/net461"
GUI_BIN="$ROOT/ConfuserEx/bin/$CONFIG/net461"
if [ ! -f "$CLI_BIN/Confuser.CLI.exe" ]; then
echo "[ERROR] Build failed — Confuser.CLI.exe not found."
exit 1
fi
echo "[OK] ConfuserEx built."
# Clear and copy to output directory
rm -rf "$OUTPUT"
mkdir -p "$OUTPUT"
# CLI has all shared libs — copy first
cp -r "$CLI_BIN/"* "$OUTPUT/"
# GUI adds its exe + WPF dependencies on top
if [ -f "$GUI_BIN/ConfuserEx.exe" ]; then
cp -r "$GUI_BIN/"* "$OUTPUT/"
echo "[OK] CLI + GUI -> $OUTPUT"
else
echo "[OK] CLI -> $OUTPUT (GUI not built)"
fi