From 33340e1d7a25e05c7996cca90abff30ba8c2635c Mon Sep 17 00:00:00 2001
From: Olivier Maury <Olivier.Maury@inrae.fr>
Date: Fri, 5 Jul 2024 17:37:38 +0200
Subject: [PATCH] =?UTF-8?q?Pr=C3=A9ciser=20la=20documentation=20de=20d?=
 =?UTF-8?q?=C3=A9veloppement.=20fixes=20#48?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 bin/start_codeserver.sh          |  4 ++++
 src/site/markdown/development.md | 10 +++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/bin/start_codeserver.sh b/bin/start_codeserver.sh
index f48b6df..25eaaca 100755
--- a/bin/start_codeserver.sh
+++ b/bin/start_codeserver.sh
@@ -1,5 +1,6 @@
 #!/bin/bash
 DIR=$(dirname $0)
+VERSION=$(xml_grep --nb_results 1 --text_only version $POM)
 cd $DIR/..
 mvn clean install --projects=.,www-shared
 if [ "$1" == "" ]; then
@@ -9,5 +10,8 @@ else
 		echo "Directory $1 does not exist!"
 		exit 1
 	fi
+	(cd www-client/; mvn gwt:compile)
+	rm -fr $1/app
+	cp -r target/www-client-$version/app $1/
 	mvn gwt:codeserver -pl *-client -am -Dgwt.codeServer.launcherDir=$1
 fi
diff --git a/src/site/markdown/development.md b/src/site/markdown/development.md
index 29141c6..6fcdf9e 100644
--- a/src/site/markdown/development.md
+++ b/src/site/markdown/development.md
@@ -69,13 +69,16 @@ Ensure JVM args contains in the server launch configuration:
 --add-opens=java.sql/java.sql=ALL-UNNAMED
 ```
 
-If CodeServer fails to launch in Eclipse, use the script
+### If CodeServer fails to launch in Eclipse
+
+1. use the script
 
 ```
 bin/start_codeserver.sh /path/to/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp*/wtpwebapps/agrometinfo-www-server/
 ```
 
-Then browse <http://localhost:8080/www-server/>.
+2. launch the Tomcat server in Eclipse
+3. browse <http://localhost:8080/www-server/>.
 
 You can edit Java files, CodeServer will recompile on page reloading (`F5` key).
 
@@ -97,4 +100,5 @@ To reflect on Tomcat, run `mvn package -DskipTests`.
 
 To run static analyses: `mvn checkstyle:checkstyle pmd:pmd pmd:cpd`.
 
-To run one test class: `mvn test -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -Dtest=fr.agrometinfo.www.server.rs.IndicatorResourceTest`.
\ No newline at end of file
+To run one test class: `mvn test -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -Dtest=fr.agrometinfo.www.server.rs.IndicatorResourceTest`.
+
-- 
GitLab