diff options
| author | Kostya <mail@sartin.in> | 2026-08-18 06:52:47 +0000 |
|---|---|---|
| committer | Kostya <mail@sartin.in> | 2026-08-18 06:52:47 +0000 |
| commit | d2688a197bd680580699f05e8194f9180e4832fa (patch) | |
| tree | 0531ef505b0637c9c4bcc17ab6183a6089e26889 /tools/_util.sh | |
| parent | 13a221ffaefc169d028c7eab6f21ac88052d1d40 (diff) | |
| download | guess-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.sh | 47 |
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 @@ | |||
| 1 | JAVA_RELEASE=25 | ||
| 2 | |||
| 3 | case "$(uname -s)" in | ||
| 4 | CYGWIN*|MINGW*|MSYS*) SEP=";" ;; | ||
| 5 | *) SEP=":" ;; | ||
| 6 | esac | ||
| 7 | |||
| 8 | MODULES="api service ui-console" | ||
| 9 | |||
| 10 | DEPS_api="" | ||
| 11 | DEPS_service="api" | ||
| 12 | DEPS_ui_console="api service" | ||
| 13 | |||
| 14 | RUNTIME_LIB_DIRS="pico jaxb gson" | ||
| 15 | |||
| 16 | MAIN_CLASS="market.guess.ui.console.App" | ||
| 17 | |||
| 18 | JAVA_HOME_DIR=$(java -XshowSettings:properties -version 2>&1 | sed -n 's/^ *java\.home = //p') | ||
| 19 | JAR="$JAVA_HOME_DIR/bin/jar" | ||
| 20 | [ -x "$JAR" ] || JAR="$JAVA_HOME_DIR/bin/jar.exe" | ||
| 21 | if [ ! -x "$JAR" ]; then | ||
| 22 | echo "Could not locate the 'jar' tool under $JAVA_HOME_DIR" >&2 | ||
| 23 | exit 1 | ||
| 24 | fi | ||
| 25 | |||
| 26 | is_shippable_jar() { | ||
| 27 | case "$1" in *-sources.jar | *-javadoc.jar) return 1 ;; *) return 0 ;; esac | ||
| 28 | } | ||
| 29 | LIBCP="" | ||
| 30 | for j in lib/*/*.jar; do | ||
| 31 | is_shippable_jar "$j" || continue | ||
| 32 | LIBCP="$LIBCP${LIBCP:+$SEP}$j" | ||
| 33 | done | ||
| 34 | |||
| 35 | TMP="${TMPDIR:-/tmp}/gm-build" | ||
| 36 | mkdir -p "$TMP" | ||
| 37 | |||
| 38 | deps_of() { | ||
| 39 | local v="DEPS_$(echo "$1" | tr '-' '_')" | ||
| 40 | eval "printf '%s' \"\${$v}\"" | ||
| 41 | } | ||
| 42 | |||
| 43 | module_cp() { | ||
| 44 | local cp="" | ||
| 45 | for d in "$@"; do cp="$cp${cp:+$SEP}build/classes/$d"; done | ||
| 46 | printf '%s' "$cp" | ||
| 47 | } | ||