Skip to content

Instantly share code, notes, and snippets.

@rafaeljesus
Created August 12, 2013 12:18
Show Gist options
  • Save rafaeljesus/6210351 to your computer and use it in GitHub Desktop.
Save rafaeljesus/6210351 to your computer and use it in GitHub Desktop.
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<target name="building">
<echo>
---------------------------------------------------
-- NPM INSTALL --
---------------------------------------------------
</echo>
<exec executable="cmd" dir="${project.basedir}" osfamily="windows" failonerror="true">
<arg line="/c npm config set color false"/>
</exec>
<exec executable="bash" dir="${project.basedir}" osfamily="unix" failonerror="true">
<arg line="npm config set color false"/>
</exec>
<exec executable="cmd" dir="${project.basedir}" osfamily="windows" failonerror="true">
<arg line="/c npm install"/>
</exec>
<exec executable="bash" dir="${project.basedir}" osfamily="unix" failonerror="true">
<arg line="npm install"/>
</exec>
<echo>
---------------------------------------------------
-- GRUNT --
---------------------------------------------------
</echo>
<exec executable="cmd" dir="${project.basedir}" osfamily="windows" resultproperty="cmdresult">
<arg line="/c grunt --no-color > grunt.status "/>
</exec>
<exec executable="bash" dir="${project.basedir}" osfamily="unix" resultproperty="cmdresult">
<arg line="grunt --no-color > grunt.status"/>
</exec>
<loadfile property="grunt.status" srcFile="grunt.status"/>
<echo>${grunt.status}</echo>
<delete file="grunt.status" quiet="true"/>
<condition property="cmdsuccess">
<equals arg1="${cmdresult}" arg2="0"/>
</condition>
<fail unless="cmdsuccess"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment