我有一个ANT脚本通过命令行运行yuidoc,但是当我运行这个脚本时,它给了我下面的错误:
[exec] 'yuidoc' is not recognized as an internal or external command,
[exec] operable program or batch file.
和相同的命令-> yuidoc -c yuidoc。json。工作,然后我运行它通过cmd提示符。
My ANT Script:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="yuidoc">
<property name="appDir" value="" />
<target name="yuidoc">
<mkdir dir="docs.javascript"/>
<copy todir="docs.javascript/yuidoc.assets">
<fileset dir="yuidoc.assets" />
</copy>
<exec dir="${appDir}" executable="cmd">
<arg line="/K yuidoc -c ${appdir}${file.separator}yuidoc.json .">
</arg>
</exec>
</target>
Replace
executable="cmd"
executable="${pathto/yuidoc}/yuidoc.exe"
的例子:
executable="${mytooldir}/bin/mytool.exe"
尝试这样设置工作目录…
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="yuidoc">
<target name="yuidoc">
<echo>Generating JavaScript Docs...</echo>
<!-- Input JavaScript dir -->
<property name="parser_in" location="${basedir}/build/js" />
<!-- Output dir -->
<property name="generator_out" location="${basedir}/resources/doc/api" />
<!-- Theme template -->
<property name="template" location="${basedir}/resources/theme/default" />
<!-- Path YUIDoc -->
<property name="yui.doc" value="C:UsersaabanegasAppDataRoamingnpm" />
<exec dir="${basedir}" executable="${yui.doc}yuidoc.cmd">
<arg value="${parser_in}" />
<arg value="-o" />
<arg value="${generator_out}" />
<arg value="-t" />
<arg value="${template}" />
<!-- No code -->
<arg value="-C" />
</exec>
</target>