diff options
| author | Kostya <mail@sartin.in> | 2026-08-23 14:05:29 +0000 |
|---|---|---|
| committer | Kostya <mail@sartin.in> | 2026-08-23 14:05:29 +0000 |
| commit | 843820ea9f357220d69f3795f3289ee41eed355c (patch) | |
| tree | 57323a2e1cd4d4c0addd57eadc31d0f36c612e96 /tools/_util.sh | |
| parent | fbfd2e275e9d645e4ec8a1874bc57d98b1c38300 (diff) | |
| download | guess-market-843820ea9f357220d69f3795f3289ee41eed355c.tar.gz guess-market-843820ea9f357220d69f3795f3289ee41eed355c.tar.xz guess-market-843820ea9f357220d69f3795f3289ee41eed355c.zip | |
model: relocate market DTOs out of the flat api package
Move AccountDTO/MarketDTO/MarketStateDTO/PurchaseReceiptDTO/TradeRowDTO
out of the catch-all api package into model.market (and LedgerDTO into
model.ledger), matching the existing model.event convention so DTOs
live next to the domain they describe rather than in the interface
package. Relocate LedgerMapper from mapper.v2 to infrastructure.adapter
to match the module's established package layout, and update all call
sites and imports accordingly.
Also register the ui-desktop module in the build tooling: add it to
MODULES, add openjfx to the shipped runtime libs, and generalize
package.sh so each executable module (ui-console, ui-desktop) gets its
own Main-Class/Class-Path manifest and run script instead of
special-casing ui-console. Fold long Class-Path manifest lines at 72
bytes per the JAR spec, since adding ui-desktop's dependencies pushed
the line past the limit.
Diffstat (limited to 'tools/_util.sh')
| -rw-r--r-- | tools/_util.sh | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/tools/_util.sh b/tools/_util.sh index fde4797..a041f2d 100644 --- a/tools/_util.sh +++ b/tools/_util.sh | |||
| @@ -5,15 +5,18 @@ case "$(uname -s)" in | |||
| 5 | *) SEP=":" ;; | 5 | *) SEP=":" ;; |
| 6 | esac | 6 | esac |
| 7 | 7 | ||
| 8 | MODULES="api service ui-console" | 8 | MODULES="api service ui-console ui-desktop" |
| 9 | 9 | ||
| 10 | DEPS_api="" | 10 | DEPS_api="" |
| 11 | DEPS_service="api" | 11 | DEPS_service="api" |
| 12 | DEPS_ui_console="api service" | 12 | DEPS_ui_console="api service" |
| 13 | DEPS_ui_desktop="" | ||
| 13 | 14 | ||
| 14 | RUNTIME_LIB_DIRS="pico jaxb gson" | 15 | RUNTIME_LIB_DIRS="pico jaxb gson openjfx" |
| 15 | 16 | ||
| 16 | MAIN_CLASS="market.guess.ui.console.App" | 17 | EXECUTABLES="ui-console ui-desktop" |
| 18 | MAINCLASS_ui_console="market.guess.ui.console.App" | ||
| 19 | MAINCLASS_ui_desktop="market.guess.ui.desktop.Launcher" | ||
| 17 | 20 | ||
| 18 | JAVA_HOME_DIR=$(java -XshowSettings:properties -version 2>&1 | tr -d '\r' | sed -n 's/^ *java\.home = //p') | 21 | JAVA_HOME_DIR=$(java -XshowSettings:properties -version 2>&1 | tr -d '\r' | sed -n 's/^ *java\.home = //p') |
| 19 | case "$(uname -s)" in | 22 | case "$(uname -s)" in |
| @@ -45,6 +48,24 @@ deps_of() { | |||
| 45 | eval "printf '%s' \"\${$v}\"" | 48 | eval "printf '%s' \"\${$v}\"" |
| 46 | } | 49 | } |
| 47 | 50 | ||
| 51 | mainclass_of() { | ||
| 52 | local v="MAINCLASS_$(echo "$1" | tr '-' '_')" | ||
| 53 | eval "printf '%s' \"\${$v}\"" | ||
| 54 | } | ||
| 55 | |||
| 56 | # JAR manifest lines are capped at 72 bytes; a raw "Key: value" line trips | ||
| 57 | # `line too long` once enough jars are on the Class-Path (openjfx pushed us | ||
| 58 | # over it). Fold per spec: continuation lines start with a single space. | ||
| 59 | write_manifest_attr() { | ||
| 60 | local file="$1" line="$2: $3" | ||
| 61 | : >"$file" | ||
| 62 | while [ "${#line}" -gt 72 ]; do | ||
| 63 | printf '%s\n' "${line:0:72}" >>"$file" | ||
| 64 | line=" ${line:72}" | ||
| 65 | done | ||
| 66 | printf '%s\n\n' "$line" >>"$file" | ||
| 67 | } | ||
| 68 | |||
| 48 | module_cp() { | 69 | module_cp() { |
| 49 | local cp="" | 70 | local cp="" |
| 50 | for d in "$@"; do cp="$cp${cp:+$SEP}build/classes/$d"; done | 71 | for d in "$@"; do cp="$cp${cp:+$SEP}build/classes/$d"; done |