Created
September 26, 2019 01:37
-
-
Save waghcwb/5833ab5534c912683eabfeadd1ca999f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- i needed to run webpack from ant build, so this was the solution --> | |
<macrodef name="nodejs"> | |
<attribute name="module" description="The name of the NodeJS module to execute" /> | |
<attribute name="failonerror" default="true" description="Fail if the exit code is not 0" /> | |
<attribute name="dir" description="Directory to execute task" /> | |
<element name="args" implicit="yes" description="Argument to pass to the exec task" /> | |
<sequential> | |
<exec executable="cmd.exe" dir="@{dir}" failonerror="@{failonerror}" osfamily="winnt"> | |
<arg line="/c @{module}" /> | |
<args /> | |
</exec> | |
<exec executable="@{module}" dir="@{dir}" failonerror="@{failonerror}" osfamily="unix" logError="true"> | |
<args /> | |
</exec> | |
</sequential> | |
</macrodef> | |
<nodejs dir="${pathToPackageJson}" module="npm" failonerror="true" > | |
<arg value="run" /> | |
<arg value="build" /> | |
</nodejs> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment