`

Apache Ant

    博客分类:
  • Java
阅读更多

1. Add additional command line arguments for <javac> task:

<javac srcdir="${dist}/trsWeb" destdir="${dist}/build/trsWeb"

    fork="true" classpath="${compile_classpath}" source="1.5" target="1.5"

    nowarn="true">

    <compilerarg value="-J-Duser.language=en"/>

</javac>

 

2. if...else...

<if>

    <equals arg1="${hello}" arg2="true"/>

    <then>

        <echo >${hello} value is true</echo>

    </then>

    <elseif>

        <equals arg1="${hello}" arg2="false"/>

        <then>

            <echo >${hello} value is false</echo>

        </then>

    </elseif>

    <else>

         <echo >${hello} value is unknowe</echo>

    </else>

</if>

 

3. placeholder variables in build.xml

build.properties

--------------------

key=value

 

build.xml

--------------------

<project name="TestAntPlaceHolder" default="echo" basedir=".">

<property file="build.properties" /> <---- mandatory, no default property file biult-in.

<target name="echo">

<echo message="I'm ${key}..."/>

</target>

</project>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics