Skip to content

Commit

Permalink
Delete sourcemap files during maven initialization
Browse files Browse the repository at this point in the history
Due to a defect in minify-maven-plugin source maps are not regenerated
if they already exist. This pr moves the workaround from the build
script to the "official" build tool, ensuring it happens for all builds
that generate javascript
  • Loading branch information
mchenryc committed Sep 16, 2018
1 parent ceae329 commit 06df2b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 0 additions & 4 deletions freeciv-web/build-js.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

FCW_DEST=/var/lib/tomcat8/webapps/freeciv-web

# workaround for https://github.com/samaxes/minify-maven-plugin/issues/142
rm -rf target/freeciv-web/javascript/webclient.min.js.map
rm -rf target/freeciv-web/javascript/webgl/libs/webgl-client.min.js.map

mvn compile && \
echo "Copying target/javascript/webclient.* to ${FCW_DEST}/javascript" && \
cp target/freeciv-web/javascript/webclient.* "${FCW_DEST}"/javascript/ && \
Expand Down
16 changes: 16 additions & 0 deletions freeciv-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,21 @@ Rerun the sync-js-hand.js script.
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<!-- workaround for https://github.com/samaxes/minify-maven-plugin/issues/142 -->
<id>source-mapping-fix</id>
<phase>initialize</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete quiet="true">
<fileset dir="${project.build.directory}/freeciv-web/javascript" includes="**/*.map"/>
</delete>
</target>
</configuration>
</execution>
<execution>
<id>create-generated-javascript-dir</id>
<phase>generate-sources</phase>
Expand All @@ -259,6 +274,7 @@ Rerun the sync-js-hand.js script.
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand Down

0 comments on commit 06df2b2

Please sign in to comment.