Saturday 20 August 2011

ANT

In this tutorial, we will introduce you to Apache's Ant technology, which is a mean to build java projects.

ANT Tutorials

  1. Apache Ant - Building Simple Java Projects In this tutorial, we will introduce you to Apache's Ant technology, which is a mean to build java projects. Ant is an open source tool that is easy to use and platform independent. This tutorial serves the purposes for both the beginners and experienced individuals.
      

  2. How to generate build.xml file This example shows how to generate the build.xml file. You may say that build.xml file is the backbone of ANT (Another Neat Tool) technology. Each build.xml file contains only one project name and at least one target.
     

  3. Ant built-in properties This is a simple example that illustrates how to find the basedir name, file name, project name, ant version, java version, operating system name, ant home directory name, java home directory name, user home directory name and user name.
      

  4. Using Ant to execute class file This build.xml file is used to compile and run the java file and print the value on command prompt.
     

  5. Executes a Java class within the Ant VM This example illustrates how to call class file through build.xml file. The build.xml file is used to compile and run the java file and print the calculated value on command prompt.
     

  6. Ant Script to Create Mysql Table This example illustrates how to create table through the build.xml file by simply running the ant command. In this build.xml file, we are using 4 property elements for connectivity of database.
      

  7. Ant Script to Insert Data in Mysql Table This example illustrates how to insert data in table through the build.xml file by simply running the ant command. In this build.xml file, we are using 4 property elements for connectivity from database.
      

  8. Ant Script to Update Mysql Table This example illustrates how to insert and update data in table through the build.xml file by simply running the ant command. In this build.xml file, we are using 4 property elements for connectivity from database.
       

  9. Using Ant Build Scripts to Drop Mysql Table
    This example illustrates how to drop table through the build.xml file by simply running the ant command. In this build.xml file, we are using 4 property elements for connectivity of database.
     

  10. Ant and JUnit This example illustrates how to implement junit test case with ant script. This is a basic tutorial to implement JUnit framework with ANT technology.
      

  11. Value in the properties file overwrite the value in the build.xml This example illustrates how to create a build.properties file in the C:\apache-tomcat-6.0.16\webapp\antBuild\build.properties and overwrite it's properties in the build.xml file.
        

  12. Built-In-Properties
    This example illustrates how to access various system properties using Ant. Ant provides access to all system properties as if they had been defined using a <property> task.
       

  13. Check Properties
    This example illustrates how to check properties using environment variable whether it is set or not. In this code, there are three properties; the first two are used to define source directory and destination directory.
       

  14. Ant make directory with relative path
    This example illustrates how to make directory, how to compile java file and how to create jar file. This is a simple program that uses <classpath refid="test.classpath"> to map with the jar file.
       

  15. Ant Customer Properties
    Setting properties in the build file is the first method of providing custom properties with <property> element in an ant build file.
      

  16. How to set memory used by JVM in Ant This example illustrates how to set memory size of JVM (java virtual machine), when ANT (another neat tool) is used outside of java virtual machine.
     

  17. Redefine property in the children target This example illustrates how to define the property file whether it is local or global. When you create build.properties on local target, then the echo message prints that this file is Local but when the file is not created on local target, then it shows the message Global file.
      

  18. Path Separator In this example, path.separator is used to separate the path and file by semicolon (;). When it is run, Ant checks for the path separator and directory separator characters provided by the underlying JVM and uses those values.
      

  19. Convert the path in to properties This example illustrates how to convert path in to properties. In this example, refid is a reference to an object defined elsewhere in the file. The reference allows you to reuse the chunks of the build file so that common classpath and path can be shared among targets.
      

  20. File Separator This example allows you to build platform-specific paths and directory hierarchies. When you build a path with any of ant's task, Ant is quite happy to convert the separators in to ones appropriate for the operating system on which it is running.

No comments:

Post a Comment