From d2688a197bd680580699f05e8194f9180e4832fa Mon Sep 17 00:00:00 2001 From: Kostya Date: Tue, 18 Aug 2026 06:52:47 +0000 Subject: 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. --- tools/_util.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tools/_util.sh (limited to 'tools/_util.sh') 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 @@ +JAVA_RELEASE=25 + +case "$(uname -s)" in + CYGWIN*|MINGW*|MSYS*) SEP=";" ;; + *) SEP=":" ;; +esac + +MODULES="api service ui-console" + +DEPS_api="" +DEPS_service="api" +DEPS_ui_console="api service" + +RUNTIME_LIB_DIRS="pico jaxb gson" + +MAIN_CLASS="market.guess.ui.console.App" + +JAVA_HOME_DIR=$(java -XshowSettings:properties -version 2>&1 | sed -n 's/^ *java\.home = //p') +JAR="$JAVA_HOME_DIR/bin/jar" +[ -x "$JAR" ] || JAR="$JAVA_HOME_DIR/bin/jar.exe" +if [ ! -x "$JAR" ]; then + echo "Could not locate the 'jar' tool under $JAVA_HOME_DIR" >&2 + exit 1 +fi + +is_shippable_jar() { + case "$1" in *-sources.jar | *-javadoc.jar) return 1 ;; *) return 0 ;; esac +} +LIBCP="" +for j in lib/*/*.jar; do + is_shippable_jar "$j" || continue + LIBCP="$LIBCP${LIBCP:+$SEP}$j" +done + +TMP="${TMPDIR:-/tmp}/gm-build" +mkdir -p "$TMP" + +deps_of() { + local v="DEPS_$(echo "$1" | tr '-' '_')" + eval "printf '%s' \"\${$v}\"" +} + +module_cp() { + local cp="" + for d in "$@"; do cp="$cp${cp:+$SEP}build/classes/$d"; done + printf '%s' "$cp" +} -- cgit v1.2.3