diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-04-13 11:25:19 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-04-13 11:27:09 +0200 |
commit | 7f4daccab9dc21cfd95be219e5c8c86545d47125 (patch) | |
tree | aca1894a42342ab965092d3b9a589c9c4bc88bdf | |
parent | 699e9abdd5e19ca25e24c5c5044f5593c9668fda (diff) |
Copy web resource build steps into an Ant script, integrate into POM.
Change-Id: I1a0d2309bb35264350ecf2a49e79398a31610cba
-rw-r--r-- | build.xml | 73 | ||||
-rw-r--r-- | pom.xml | 19 |
2 files changed, 92 insertions, 0 deletions
diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..f2ffccc --- /dev/null +++ b/build.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="utf-8"?> + +<project default="package"> + + <property name="web-dir" location="src/main/resources/META-INF/resources"/> + + <target name="yarn" depends="yarn.check" if="yarn.run"> + <exec executable="yarn" dir="${web-dir}"> + <arg value="install"/> + </exec> + </target> + + <target name="yarn.check"> + <condition property="yarn.run"> + <not> + <available file="${web-dir}/node_modules"/> + </not> + </condition> + </target> + + <target name="snowpack" depends="snowpack.check,yarn" if="snowpack.run"> + <exec executable="yarn" dir="${web-dir}"> + <arg value="run"/> + <arg value="snowpack"/> + <arg value="--optimize"/> + </exec> + </target> + + <target name="snowpack.check"> + <condition property="snowpack.run"> + <not> + <available file="${web-dir}/web_modules"/> + </not> + </condition> + </target> + + <target name="flow" depends="snowpack"> + <exec executable="yarn" dir="${web-dir}"> + <arg value="run"/> + <arg value="flow"/> + <arg value="--color=always"/> + </exec> + </target> + + <target name="eslint" depends="snowpack"> + <exec executable="yarn" dir="${web-dir}"> + <arg value="run"/> + <arg value="eslint"/> + <arg value="cms2"/> + <arg value="bookmarks"/> + <arg value="--color"/> + </exec> + </target> + + <target name="web.resources" depends="snowpack" unless="skip-web"/> + <target name="web.check" unless="skip-web" depends="web.resources,flow,eslint"/> + <target name="web" unless="skip-web" depends="web.resources,web.check"/> + + <target name="package"> + <exec executable="./mvnw"> + <arg value="package"/> + </exec> + </target> + + <target name="clean"> + <exec executable="./mvnw"> + <arg value="clean"/> + </exec> + <delete dir="${web-dir}/node_modules"/> + <delete dir="${web-dir}/web_modules"/> + </target> + +</project> @@ -21,6 +21,7 @@ <quarkus-plugin.version>1.3.1.Final</quarkus-plugin.version> <surefire-plugin.version>3.0.0-M4</surefire-plugin.version> <spotless-plugin.version>1.30.0</spotless-plugin.version> + <antrun-plugin.version>1.8</antrun-plugin.version> <!-- <quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id> --> <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id> @@ -366,6 +367,24 @@ </configuration> </plugin> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <version>${antrun-plugin.version}</version> + <executions> + <execution> + <phase>generate-resources</phase> + <configuration> + <target> + <ant target="web.resources" /> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> <resources> |