-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-bytegraph.sh
More file actions
33 lines (26 loc) · 956 Bytes
/
run-bytegraph.sh
File metadata and controls
33 lines (26 loc) · 956 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
# ============================================================
# ByteGraph Runner (macOS/Linux)
# Usage: ./run-bytegraph.sh <classpath_root>
#
# - arg1 (required): Absolute path to the class or directory
# ============================================================
# 0) Check if the required argument is provided
if [ -z "$1" ]; then
echo "[ERROR] .class file path is required."
echo "Usage: $(basename "$0") -t /path/to/MyClass.class [-a analyzeMode] [-d dfgMode] [-l libPath]"
exit 1
fi
echo "[INFO] Running Gradle..."
echo "[INFO] Initializing ByteGraph Analysis..."
echo "[INFO] Class Path: $CLASS_PATH"
# 1) Execute Gradle task
gradle run --console=plain -q --args="$*" -Dfile.encoding=UTF-8
# 2) Capture and check the exit code
RC=$?
if [ $RC -ne 0 ]; then
echo "[ERROR] Gradle run failed (exit code=$RC)"
exit $RC
fi
echo "[INFO] Done. Please check the 'out/' directory for JSON results."