aboutsummaryrefslogtreecommitdiffstats
path: root/tools/_util.sh
diff options
context:
space:
mode:
authorKostya <mail@sartin.in>2026-10-13 19:19:40 +0300
committerKostya <mail@sartin.in>2026-10-13 19:20:05 +0300
commitda4f3ceb1fc1f317a3cca788b6c9b78ffab12de2 (patch)
treee8c70414409640309461c1b7fabbd084c892eb03 /tools/_util.sh
parent4edb27d378e8b79931ef6a6abebfda66f894d538 (diff)
downloadguess-market-da4f3ceb1fc1f317a3cca788b6c9b78ffab12de2.tar.gz
guess-market-da4f3ceb1fc1f317a3cca788b6c9b78ffab12de2.tar.xz
guess-market-da4f3ceb1fc1f317a3cca788b6c9b78ffab12de2.zip
tools: package the server as a WAR and the client as a directory
The Ex3 submission is exactly one WAR for Tomcat's webapps/ plus a directory holding the client, its jars and its batch file. package.sh now stages both under build/dist/ex3. The WAR is named guess-market.war after the context path the client expects, and carries the api and service jars with gson and JAXB; Tomcat only has to provide the servlet API. The client directory holds ui-client, api, ui-fx, gson, OkHttp and JavaFX, and nothing of the engine. An executable's Class-Path used to name every module. List only the modules it depends on, so the client jar no longer points at service.jar, and stop producing a plain jar for the server module. Add tomcat.sh to try the result by hand: it copies the packaged WAR into a local Tomcat ($CATALINA_HOME, or the newest C:\tomcat\apache-tomcat-*) and runs it in the foreground.
Diffstat (limited to 'tools/_util.sh')
-rw-r--r--tools/_util.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/_util.sh b/tools/_util.sh
index 65cba8c..8323c61 100644
--- a/tools/_util.sh
+++ b/tools/_util.sh
@@ -22,6 +22,14 @@ MAINCLASS_ui_console="market.guess.ui.console.App"
22MAINCLASS_ui_desktop="market.guess.ui.desktop.Launcher" 22MAINCLASS_ui_desktop="market.guess.ui.desktop.Launcher"
23MAINCLASS_ui_client="market.guess.ui.client.Launcher" 23MAINCLASS_ui_client="market.guess.ui.client.Launcher"
24 24
25# Exercise 3 submission: one WAR for Tomcat's webapps/ and a self-contained client directory.
26# The WAR is named after the context path the client expects (/guess-market).
27WAR_MODULE="server"
28WAR_NAME="guess-market"
29WAR_LIB_DIRS="gson jaxb"
30CLIENT="ui-client"
31CLIENT_LIB_DIRS="gson openjfx okhttp"
32
25JAVA_HOME_DIR=$(java -XshowSettings:properties -version 2>&1 | tr -d '\r' | sed -n 's/^ *java\.home = //p') 33JAVA_HOME_DIR=$(java -XshowSettings:properties -version 2>&1 | tr -d '\r' | sed -n 's/^ *java\.home = //p')
26case "$(uname -s)" in 34case "$(uname -s)" in
27 CYGWIN*|MINGW*|MSYS*) 35 CYGWIN*|MINGW*|MSYS*)