Simple ant

   

 

Hello-ant stores two folders and one build.xml.

HelloAnt.java stores at main folder.

 

Build.xml

 

<?xml version="1.0"  encoding="GB2312" ?>

 

<!-- 一个项目,可包含很多任务组(target) -->

<project default="main" basedir=".">

 

    <!-- 项目中的一个任务组,可包含很多任务(task:javac,java...) -->

    <target name="main">

 

        <!--编译-->

        <javac srcdir="src/main" destdir="build/classes"/>

 

        <!--运行-->

        <java classname="HelloAnt">

            <classpath>

                <pathelement path="build/classes"/>

            </classpath>

        </java>

 

    </target>

</project>

 

HelloAnt.java

public class HelloAnt {

        public static void main(String[] args){

            System.out.println("hello ant, successfull. :)");

        }

}

 

你可能感兴趣的:(ant,String,Class,Path,任务,encoding)