在 ANT 脚本中集成 NPM 构建

Integrate NPM build in ANT script

我有一个现有的 ANT 文件来构建 java 代码。我需要在构建中集成以下命令:

1) npm 安装

2) npm 运行 构建

如何整合?

我认为我需要向 运行 这些命令添加一个新目标,但不确定 code/xml 的确切更改。

<target name="npm-install">
        <exec dir="./web/public" executable="cmd.exe" output="npm-install.txt">
         <arg line="/c npm install"/>
        </exec>
</target>

<target name="npm-build">
    <exec dir="./web/public" executable="cmd.exe" output="npm-build.txt">
     <arg line="/c npm run build"/>
    </exec>
</target>