aboutsummaryrefslogtreecommitdiffstats
path: root/tools/_util.sh
diff options
context:
space:
mode:
authorKostya <mail@sartin.in>2026-08-18 06:52:47 +0000
committerKostya <mail@sartin.in>2026-08-18 06:52:47 +0000
commitd2688a197bd680580699f05e8194f9180e4832fa (patch)
tree0531ef505b0637c9c4bcc17ab6183a6089e26889 /tools/_util.sh
parent13a221ffaefc169d028c7eab6f21ac88052d1d40 (diff)
downloadguess-market-d2688a197bd680580699f05e8194f9180e4832fa.tar.gz
guess-market-d2688a197bd680580699f05e8194f9180e4832fa.tar.xz
guess-market-d2688a197bd680580699f05e8194f9180e4832fa.zip
Add XML schema validation, split build scripts by module, rename BuyMenuCommand to PlaceOrderMenuCommand
Introduces XMLValidatorV1 and deserializer/adapter classes for events, ledgers, markets, users, and trading mechanisms. Replaces the monolithic build.bat/run.sh scripts with per-module tools (_util.sh, build.sh, package.sh, test.sh) that compile in dependency order.
Diffstat (limited to 'tools/_util.sh')
-rw-r--r--tools/_util.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/tools/_util.sh b/tools/_util.sh
new file mode 100644
index 0000000..4650616
--- /dev/null
+++ b/tools/_util.sh
@@ -0,0 +1,47 @@
1JAVA_RELEASE=25
2
3case "$(uname -s)" in
4 CYGWIN*|MINGW*|MSYS*) SEP=";" ;;
5 *) SEP=":" ;;
6esac
7
8MODULES="api service ui-console"
9
10DEPS_api=""
11DEPS_service="api"
12DEPS_ui_console="api service"
13
14RUNTIME_LIB_DIRS="pico jaxb gson"
15
16MAIN_CLASS="market.guess.ui.console.App"
17
18JAVA_HOME_DIR=$(java -XshowSettings:properties -version 2>&1 | sed -n 's/^ *java\.home = //p')
19JAR="$JAVA_HOME_DIR/bin/jar"
20[ -x "$JAR" ] || JAR="$JAVA_HOME_DIR/bin/jar.exe"
21if [ ! -x "$JAR" ]; then
22 echo "Could not locate the 'jar' tool under $JAVA_HOME_DIR" >&2
23 exit 1
24fi
25
26is_shippable_jar() {
27 case "$1" in *-sources.jar | *-javadoc.jar) return 1 ;; *) return 0 ;; esac
28}
29LIBCP=""
30for j in lib/*/*.jar; do
31 is_shippable_jar "$j" || continue
32 LIBCP="$LIBCP${LIBCP:+$SEP}$j"
33done
34
35TMP="${TMPDIR:-/tmp}/gm-build"
36mkdir -p "$TMP"
37
38deps_of() {
39 local v="DEPS_$(echo "$1" | tr '-' '_')"
40 eval "printf '%s' \"\${$v}\""
41}
42
43module_cp() {
44 local cp=""
45 for d in "$@"; do cp="$cp${cp:+$SEP}build/classes/$d"; done
46 printf '%s' "$cp"
47}