diff options
| author | Kostya <mail@sartin.in> | 2026-10-13 19:19:40 +0300 |
|---|---|---|
| committer | Kostya <mail@sartin.in> | 2026-10-13 19:20:05 +0300 |
| commit | da4f3ceb1fc1f317a3cca788b6c9b78ffab12de2 (patch) | |
| tree | e8c70414409640309461c1b7fabbd084c892eb03 /tools/_util.sh | |
| parent | 4edb27d378e8b79931ef6a6abebfda66f894d538 (diff) | |
| download | guess-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.sh | 8 |
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" | |||
| 22 | MAINCLASS_ui_desktop="market.guess.ui.desktop.Launcher" | 22 | MAINCLASS_ui_desktop="market.guess.ui.desktop.Launcher" |
| 23 | MAINCLASS_ui_client="market.guess.ui.client.Launcher" | 23 | MAINCLASS_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). | ||
| 27 | WAR_MODULE="server" | ||
| 28 | WAR_NAME="guess-market" | ||
| 29 | WAR_LIB_DIRS="gson jaxb" | ||
| 30 | CLIENT="ui-client" | ||
| 31 | CLIENT_LIB_DIRS="gson openjfx okhttp" | ||
| 32 | |||
| 25 | JAVA_HOME_DIR=$(java -XshowSettings:properties -version 2>&1 | tr -d '\r' | sed -n 's/^ *java\.home = //p') | 33 | JAVA_HOME_DIR=$(java -XshowSettings:properties -version 2>&1 | tr -d '\r' | sed -n 's/^ *java\.home = //p') |
| 26 | case "$(uname -s)" in | 34 | case "$(uname -s)" in |
| 27 | CYGWIN*|MINGW*|MSYS*) | 35 | CYGWIN*|MINGW*|MSYS*) |