How to run a Nant task with Ant?

后端 未结 1 756
忘掉有多难
忘掉有多难 2021-01-23 16:54

I am looking to do something that seems feasible, but searches on Google do not return something as precise as what I need.

We inherited Nant scripts from a previous com

相关标签:
1条回答
  • 2021-01-23 17:45

    You call put your ant scripts in a batch file (ant_tasks.bat) and then execute it from nant using exec.
    Something like that:

    <target name="run-command">
       <exec program="ant_tasks.bat" basedir="${test.dir}">
         <arg value="${args}" />
       </exec>
     </target>
    

    Docs

    Or you can put your nant scripts in a batch file and then execute it from ant using exec.

    Example:

    <existing ant task>
    
    <target name="help">
      <exec executable="cmd">
        <arg value="/c"/>
        <arg value="nant-scripts.bat"/>
        <arg value="-p"/>
      </exec>
    </target>
    
    <another existing ant task>
    

    Docs

    0 讨论(0)
提交回复
热议问题