Posts

Showing posts with the label Ant

How to upgrade ANT in Eclipse ?

To upgrade the ANT into the Eclipse, First you need to download the latest version of ANT anywhere on you machine. Once you are done with the download then go to Eclipse → Windows → Preferences → Ant → Runtime → Ant Home and Select the downloaded folder. Now your Eclipse will use the latest version of ANT :)

Some ANT task

1. How to build  project from another build. <target name="project2"             description="Builds project2 project, required depedency">         <!-- Build project2 first  -->         <subant target="dist" verbose="yes" inheritall="false">             <filelist dir="../com.waheed.project2"                       files="build.xml" />         </subant>     </target>   2. How to read SVN revision and write into some file <loadfile property="revision" srcFile="./.svn/entries">         <filterchain>           ...

How to read properties file using ANT

Suppose You have to access some properties (from a file), which are already defined in my build file. To be able to access the properties We can use the build attribute of the property task.  build.properties #Release information #Thu Oct 14 16:25:12 CEST 2004 build.number=115 release.version=0.4 release.name=framework   Ant Example Target <target name="read.properties"> <!-- Read the properties from the release of the framework --> <property file="build.properties" prefix="build"/> <echo message="${build.build.number}"/> <echo message="${build.release.version}"/> <echo message="${build.release.name}"/> </target>    Output Buildfile: C:\build.xml read.properties: [echo] 115 [echo] 0.4 [echo] framework BUILD SUCCESSFUL Total time: 3 seconds

Apache Ant - Tutorial

Image
Introduction: Ant (originally an acronym for Another Neat Tool), is a build tool with special support for the Java programming language but can be used for just about everything.Ant is platform-independent; it is written purely in Java. Ant is particularly good at automating complicated repetitive tasks e.g. compiling source code, running software tests, creating jar files, javadocs, etc. and thus is well suited for automating standardised build processes. A build process typically includes:      -the compilation of the Java source code into Java bytecode      -creation of the .jar file for the distribution of the code      -creation of the Javadoc documentation Ant accepts instructions in the form of XML documents("build.xml") thus is extensible and easy to maintain. Installation: Linux (Ubuntu / Debian) On Debian /Ubuntu use "apt-get install ant" to install it. Windows Download Apache Ant from http://ant.apache.org/ . Extra...