-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-local.sh
More file actions
executable file
·36 lines (29 loc) · 1.08 KB
/
test-local.sh
File metadata and controls
executable file
·36 lines (29 loc) · 1.08 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
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TASK_DLL="$SCRIPT_DIR/src/CycloneDX.MSBuildTask/bin/Release/net8.0/CycloneDX.MSBuildTask.dll"
usage() {
echo "Usage: $0 <path-to-project-or-solution> [extra dotnet build args...]"
echo ""
echo "Builds the CycloneDX MSBuild task locally, then builds the target project"
echo "using the local task DLL so you can inspect the generated SBOM."
echo ""
echo "Examples:"
echo " $0 ../my-app/MyApp.csproj"
echo " $0 ../my-app/MyApp.sln -c Release"
echo " $0 ../my-app/src/MyApp/MyApp.csproj -r linux-x64"
exit 1
}
if [[ $# -lt 1 ]]; then
usage
fi
TARGET="$1"
shift
echo "==> Building CycloneDX.MSBuildTask (Release)..."
dotnet build "$SCRIPT_DIR/src/CycloneDX.MSBuildTask" -c Release -v q
echo "==> Building target project with local task..."
echo " Project: $TARGET"
echo " Task DLL: $TASK_DLL"
dotnet build "$TARGET" -p:CycloneDxMSBuildTaskAssembly="$TASK_DLL" "$@"
echo ""
echo "==> Done. Look for bom.json / bom.xml in the project output directory."