1

I have a ANT script which runs yuidoc through command line, but when i run this script it gives me below error:

 [exec] 'yuidoc' is not recognized as an internal or external command,
 [exec] operable program or batch file.

and the same command -> yuidoc -c yuidoc.json . works then I run it through cmd prompt.

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>

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • Is `yuidoc` on the PATH? In a Command Prompt, what is the result of `where yuidoc`? – Chad Nouis Jun 07 '13 at 13:49
  • where yuidoc: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All righ C:\Users\Ajaydeep>where yuidoc C:\Users\Ajaydeep\AppData\Roaming\npm\yuidoc C:\Users\Ajaydeep\AppData\Roaming\npm\yuidoc.cmd – Simply Innovative Jun 07 '13 at 16:23

2 Answers2

1

Replace

executable="cmd"

with

executable="${pathto/yuidoc}/yuidoc.exe"

example:

executable="${mytooldir}/bin/mytool.exe"
Lynngineer
  • 56
  • 3
1

try to set the working directory like this...

<?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:\Users\aabanegas\AppData\Roaming\npm" />

<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>