Skip to content

Commit

Permalink
Add watcher for synapse-react-client to automatically copy & explode …
Browse files Browse the repository at this point in the history
…resources
  • Loading branch information
nickgros committed Jan 24, 2025
1 parent 908e027 commit 2b377d9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@
},
"scripts": {
"build": "mvn -B package --file pom.xml",
"dev": "concurrently -k -n \"CODESERVER,TOMCAT\" -c \"auto,auto\" \"yarn dev:codeserver\" \"yarn dev:tomcat\"",
"dev": "concurrently -k -n \"CODESERVER,WATCHER,TOMCAT\" -c \"auto,auto,auto\" \"yarn dev:codeserver\" \"yarn dev:watcher\" \"yarn dev:tomcat\"",
"dev:codeserver": "mvn clean gwt:run-codeserver",
"dev:tomcat": "wait-on tcp:9876 && docker pull tomcat:9.0; docker run --name swc-dev --rm -p 8888:8080 -v \"/$(pwd)/target/portal-develop-SNAPSHOT/:/usr/local/tomcat/webapps/ROOT/\" -v \"/$HOME/.m2/settings.xml\":/root/.m2/settings.xml tomcat:9.0",
"dev:watcher": "wait-on tcp:9876 && mvn fizzed-watcher:run",
"dev:tomcat": "wait-on tcp:9876 && docker pull tomcat:9.0; docker run --name swc-dev --rm -p 8888:8080 -v \"/$(pwd)/src/main/webapp/:/usr/local/tomcat/webapps/ROOT/\" -v \"/$HOME/.m2/settings.xml\":/root/.m2/settings.xml tomcat:9.0",
"docker:start": "docker pull tomcat:9.0; docker run --name swc-tomcat -d --rm -p 8888:8080 -v \"/$(pwd)/target/portal-develop-SNAPSHOT.war:/usr/local/tomcat/webapps/ROOT.war\" -v \"/$(pwd)/e2e_workflow/settings.xml\":/root/.m2/settings.xml tomcat:9.0",
"docker:stop": "docker stop swc-tomcat",
"prepare": "husky install",
Expand Down
25 changes: 24 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
<attachClasses>true</attachClasses>
</configuration>
</execution>
<!-- This next section is to copy the source maps into the WEB-INF directory
<!-- This next section is to copy the source maps into the WEB-INF directory
(during the package phase, from junit output) -->
<execution>
<id>execution2</id>
Expand All @@ -301,6 +301,29 @@
</executions>
</plugin>

<plugin>
<groupId>com.fizzed</groupId>
<artifactId>fizzed-watcher-maven-plugin</artifactId>
<version>1.0.6</version>
<!-- This configuration is used to watch the node_modules directory for changes and copy those to the static assets folder when they change -->
<!-- Then those assets are copied into the exploded WAR -->
<configuration>
<touchFile>target/classes/watcher_explode_war.txt</touchFile>
<watches>
<watch>
<directory>
${project.basedir}/node_modules/synapse-react-client/dist/umd
</directory>
<!-- <directory>${project.basedir}/node_modules</directory>-->
</watch>
</watches>
<goals>
<goal>process-resources</goal>
<goal>war:exploded</goal>
</goals>
</configuration>
</plugin>

<!-- We use this assembly to package the GWT RPC dependencies so they
are aviablible fore integration testing. -->
<plugin>
Expand Down

0 comments on commit 2b377d9

Please sign in to comment.