ant脚本忽略xml的某些部分

时间:2011-04-20 03:27:46

标签: ant

在下面的xml文件中,在运行ant脚本时,我收到错误C:\ Work \ 6.70_Extensions \ ANTScripts_Check_IN.xml:134:无法创建任务或类型类型:buildmachine4。

<?xml version="1.0"?>

<project name="TrueCM_Checks" default="help">
        <taskdef name="CFileEdit" classname="com.ANT_Tasks.CFileEdit"/>


<!-- ========================================================== -->
<!--  init                                                      -->
<!-- ========================================================== -->
    <target name="init">
        <property file="..\Master Build.properties"/>
        <property file="TrueCM.properties"/>
    </target>


<!-- ========================================================== -->
<!--  main                                                      -->
<!-- ========================================================== -->
        <target name="main" depends="init">

            <ant antfile="..\Master Build.xml" target="Print Properties"/>

            <tstamp>
                <format property="BUILD_DATE" pattern="d-MMMM-yyyy hh:mm aa" locale="US"/>
            </tstamp>

            <echo message="BUILD START: ${BUILD_DATE}"/>

            <parallel>
                <antcall target="Check IN Master Build.xml"/>
                <antcall target="Check IN Master Build.properties"/>
                <antcall target="Check IN TrueCM_Check_INOUT.xml"/>
                <antcall target="Check IN TrueCM.properties"/>
                <antcall target="Check IN TrueCM_SnapShots.xml"/>
                <antcall target="Check IN TrueCM_Update.xml"/>
                <antcall target="Check IN ANTScripts_Check_IN.xml"/>
            </parallel>


            <tstamp>
                <format property="BUILD_DATE" pattern="d-MMMM-yyyy hh:mm aa" locale="US"/>
            </tstamp>

            <echo message="BUILD END: ${BUILD_DATE}"/>

        </target>


        <target name="Check IN Master Build.xml">
            <echo>Checking IN Master Build.xml;</echo>
            <exec executable="${TrueCM_App}\${TrueCM_Mode}"   failonerror="true">

                <arg line='-I "C:/Work/${TrueCM_Tip}/release/SASE Lab Tools/ANT Builds/Master Build.xml"'/>
            </exec>

        </target>

...
...



<!-- ========================================================== -->
<!--  Check Out                                                 -->
<!-- ========================================================== -->
    <buildmachine4>
        <checkout1 exe="wco" folder='-f -R "C:/Work/6.70_Extensions/ANT Builds/"'/>
        <checkout2 exe="wco" folder='-f -R "C:/Work/7.00_Extensions/ANT Builds/"'/> 
    </buildmachine4>
    <buildmachine5> 
        <checkout3 exe="wco" folder='-f -R "C:/Work/7.10.00_Tip/ANT Builds/"'/>
    </buildmachine5>    
</project>

错误是由于<buildmachine4><buildmachine5>造成的。如何确保忽略<buildmachine4><buildmachine5>?这些包含我的用户界面的参数。

1 个答案:

答案 0 :(得分:1)

buildmachine标记未在构建文件中定义..

如果你想制作buildmachine有效的ant任务,你需要将它们定义为一个任务(http://ant.apache.org/manual/Tasks/taskdef.html)并在目标中使用它们。

  <taskdef name="buildmachine4" classname="com.mydomain.BuildmachineTask"/>

否则您可能必须取消注释这些行

<!--buildmachine4>
        <checkout1 exe="wco" folder='-f -R "C:/Work/6.70_Extensions/ANT Builds/"'/>
        <checkout2 exe="wco" folder='-f -R "C:/Work/7.00_Extensions/ANT Builds/"'/> 
    </buildmachine4>
    <buildmachine5> 
        <checkout3 exe="wco" folder='-f -R "C:/Work/7.10.00_Tip/ANT Builds/"'/>
    </buildmachine5-->  

这就是我能想到的全部。