forked from sourcerer-io/sourcerer-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_cli.sh
More file actions
executable file
路28 lines (23 loc) 路 925 Bytes
/
Copy pathbuild_cli.sh
File metadata and controls
executable file
路28 lines (23 loc) 路 925 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
#!/usr/bin/env bash
# Builds the Kotlin extractor jar that the Go backend shells out to.
#
# The backend refuses to start without a usable jar, so this must run before
# `docker compose up`. Gradle runs inside a container to pin the toolchain
# (Gradle 4.10.3 / JDK 8) that this build script requires.
set -euo pipefail
cd "$(dirname "$0")"
JAR_PATH="cli/build/libs/sourcerer-app.jar"
if command -v docker >/dev/null 2>&1; then
docker compose --profile build run --rm cli-build
elif command -v gradle >/dev/null 2>&1; then
echo "docker not found; falling back to the host gradle (must be 4.x on JDK 8)"
(cd cli && gradle --no-daemon assemble)
else
echo "error: need either docker or gradle on PATH to build the CLI jar" >&2
exit 1
fi
if [ ! -s "$JAR_PATH" ]; then
echo "error: build finished but $JAR_PATH is missing or empty" >&2
exit 1
fi
echo "Built $JAR_PATH ($(wc -c <"$JAR_PATH" | tr -d ' ') bytes)"