SlideShare una empresa de Scribd logo
1 de 31
Apache Ant K. M. Fazle Azim Babu [email_address]
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is Ant ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Installing Ant ,[object Object],[object Object],[object Object],[object Object],[object Object]
Getting Started With Ant ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Writing Ant build File Create a file build.xml containing only one target: <?xml version=&quot;1.0&quot;?>  <project name=&quot;firstbuild&quot; default=&quot;compile&quot; > <target name=&quot;compile&quot;> <javac srcdir=&quot;.&quot; /> <echo>compilation complete!</echo> </target> </project> It compiles all Java source code in and below  the current directory  &quot;.&quot;  according to Ant task <javac srcdir=&quot;.&quot; />
Running Your First build ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Running Your First build ,[object Object],[object Object],[object Object]
Anatomy of A build File ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Anatomy of A build File.... ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Project  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Project Element Attribute  Description  name  the name of the project.  default *  the default target to use when no target is  supplied. basedir  the base directory from which all path calculations  are done.
Build File Example (Project)  <project name=&quot;Sample Project&quot; default=&quot;compile&quot; basedir=&quot;.&quot;> <description> A sample build file for this project </description> </project>
Target ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Target element Attribute  Description  name *   the name of the target.  depends   a comma-separated list of names of targets on  which this target depends. if   the name of the property that must be set in order  for this target to execute.  unless  name of the property that must not be set in order for this target to execute. description   a short description of this target's function.
Build File Example (Target) <project name=&quot;Sample Project&quot; default=&quot;compile&quot; basedir=&quot;.&quot;> ...  <!-- set up some directories used by this project --> <target name=&quot;init&quot; description=&quot;setup project directories&quot;> </target>  <!-- Compile the java code in src dir into build dir --> <target name=&quot;compile&quot; depends=&quot;init&quot; description=&quot;compile java sources&quot;> </target> <!-- Generate javadocs for current project into docs dir --> <target name=&quot;doc&quot; depends=&quot;init&quot; description=&quot;generate documentation&quot;> </target> <!-- Delete the build & doc directories and Emacs backup (*~) files --> <target name=&quot;clean&quot; description=&quot;tidy up the workspace&quot;> </target> </project>
Task  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Task element ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Properties ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Build File Example (Properties) <project name=&quot;Sample Project&quot; default=&quot;compile&quot; basedir=&quot;.&quot;> <description> A sample build file for this project </description> <!-- global properties for this build file --> <property name=&quot;source.dir&quot; location=&quot;src&quot;/> <property name=&quot;build.dir&quot; location=&quot;bin&quot;/> <property name=&quot;doc.dir&quot; location=&quot;doc&quot;/>  </project>
Initialization Target & Tasks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Compilation Target & Tasks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Javadoc Target & Tasks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Cleanup Target & Tasks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Completed Build File (1 of 3) <project name=&quot;Sample Project&quot; default=&quot;compile&quot; basedir=&quot;.&quot;> <description> A sample build file for this project </description>  <!-- global properties for this build file --> <property name=&quot;source.dir&quot; location=&quot;src&quot;/> <property name=&quot;build.dir&quot; location=&quot;bin&quot;/> <property name=&quot;doc.dir&quot; location=&quot;doc&quot;/>  <!-- set up some directories used by this project -->
Completed Build File (2 of 3) <!-- set up some directories used by this project --> <target name=&quot;init&quot; description=&quot;setup project directories&quot;> <mkdir dir=&quot;${build.dir}&quot;/> <mkdir dir=&quot;${doc.dir}&quot;/> </target> <!-- Compile the java code in ${src.dir} into ${build.dir} --> <target name=&quot;compile&quot; depends=&quot;init&quot; description=&quot;compile java sources&quot;> <javac srcdir=&quot;${source.dir}&quot; destdir=&quot;${build.dir}&quot;/> </target>
Completed Build File (3 of 3) <!-- Generate javadocs for current project into ${doc.dir} --> <target name=&quot;doc&quot; depends=&quot;init&quot; description=&quot;generate documentation&quot;> <javadoc sourcepath=&quot;${source.dir}&quot; destdir=&quot;${doc.dir}&quot;/> </target> <!-- Delete the build & doc directories and Emacs backup (*~) files --> <target name=&quot;clean&quot; description=&quot;tidy up the workspace&quot;> <delete dir=&quot;${build.dir}&quot;/> <delete dir=&quot;${doc.dir}&quot;/> <delete> <fileset defaultexcludes=&quot;no&quot; dir=&quot;${source.dir}&quot; includes=&quot;**/*~&quot;/> </delete> </target> </project>
Running Ant – Command Line ,[object Object],[object Object],[object Object]
Running Ant – Eclipse ,[object Object],[object Object],[object Object],[object Object],[object Object]
References ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object]

Más contenido relacionado

La actualidad más candente

Apache Ant
Apache AntApache Ant
Apache AntAli Bahu
 
Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3Matthew McCullough
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using DjangoNathan Eror
 
Python & Django TTT
Python & Django TTTPython & Django TTT
Python & Django TTTkevinvw
 
Best Practices for Front-End Django Developers
Best Practices for Front-End Django DevelopersBest Practices for Front-End Django Developers
Best Practices for Front-End Django DevelopersChristine Cheung
 
Django app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh AgarwalDjango app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh Agarwalratneshsinghparihar
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorialsunniboy
 
Django Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python DevelopersDjango Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python DevelopersRosario Renga
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for BeginnersJason Davies
 
Getting started with Django 1.8
Getting started with Django 1.8Getting started with Django 1.8
Getting started with Django 1.8rajkumar2011
 
Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIsDmitry Buzdin
 

La actualidad más candente (18)

Apache Ant
Apache AntApache Ant
Apache Ant
 
Ant tutorial
Ant tutorialAnt tutorial
Ant tutorial
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using Django
 
Introduction to Apache Ant
Introduction to Apache AntIntroduction to Apache Ant
Introduction to Apache Ant
 
Python & Django TTT
Python & Django TTTPython & Django TTT
Python & Django TTT
 
Maven 3.0 at Øredev
Maven 3.0 at ØredevMaven 3.0 at Øredev
Maven 3.0 at Øredev
 
Best Practices for Front-End Django Developers
Best Practices for Front-End Django DevelopersBest Practices for Front-End Django Developers
Best Practices for Front-End Django Developers
 
Django app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh AgarwalDjango app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh Agarwal
 
Writing Pluggable Software
Writing Pluggable SoftwareWriting Pluggable Software
Writing Pluggable Software
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorial
 
Django Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python DevelopersDjango Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python Developers
 
Django
DjangoDjango
Django
 
Deploy Flex with Apache Ant
Deploy Flex with Apache AntDeploy Flex with Apache Ant
Deploy Flex with Apache Ant
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for Beginners
 
Getting started with Django 1.8
Getting started with Django 1.8Getting started with Django 1.8
Getting started with Django 1.8
 
Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIs
 

Destacado (11)

Using Ant To Build J2 Ee Applications
Using Ant To Build J2 Ee ApplicationsUsing Ant To Build J2 Ee Applications
Using Ant To Build J2 Ee Applications
 
LatJUG Java Build Tools
LatJUG Java Build ToolsLatJUG Java Build Tools
LatJUG Java Build Tools
 
Ant
AntAnt
Ant
 
Basics of ANT
Basics of ANTBasics of ANT
Basics of ANT
 
Maven 2 Introduction
Maven 2 IntroductionMaven 2 Introduction
Maven 2 Introduction
 
D Space Installation
D Space InstallationD Space Installation
D Space Installation
 
ANT
ANTANT
ANT
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
Apache ANT vs Apache Maven
Apache ANT vs Apache MavenApache ANT vs Apache Maven
Apache ANT vs Apache Maven
 
Manen Ant SVN
Manen Ant SVNManen Ant SVN
Manen Ant SVN
 
The Ant Story
The Ant StoryThe Ant Story
The Ant Story
 

Similar a Apache ant

Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat ToolKanika2885
 
Introduction To Ant1
Introduction To  Ant1Introduction To  Ant1
Introduction To Ant1Rajesh Kumar
 
Ant_quick_guide
Ant_quick_guideAnt_quick_guide
Ant_quick_guideducquoc_vn
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipseMike Slinn
 
Autoconf&Automake
Autoconf&AutomakeAutoconf&Automake
Autoconf&Automakeniurui
 
Automating API Documentation
Automating API DocumentationAutomating API Documentation
Automating API DocumentationSelvakumar T S
 
Advanced Rational Robot A Tribute (http://www.geektester.blogspot.com)
Advanced Rational Robot   A Tribute (http://www.geektester.blogspot.com)Advanced Rational Robot   A Tribute (http://www.geektester.blogspot.com)
Advanced Rational Robot A Tribute (http://www.geektester.blogspot.com)raj.kamal13
 
Spring hibernate tutorial
Spring hibernate tutorialSpring hibernate tutorial
Spring hibernate tutorialRohit Jagtap
 
Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Michiel Rook
 
Lec 4 06_aug [compatibility mode]
Lec 4 06_aug [compatibility mode]Lec 4 06_aug [compatibility mode]
Lec 4 06_aug [compatibility mode]Palak Sanghani
 

Similar a Apache ant (20)

Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat Tool
 
Introduction To Ant1
Introduction To  Ant1Introduction To  Ant1
Introduction To Ant1
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 
Ant_quick_guide
Ant_quick_guideAnt_quick_guide
Ant_quick_guide
 
Java ant tutorial
Java ant tutorialJava ant tutorial
Java ant tutorial
 
Intro to-ant
Intro to-antIntro to-ant
Intro to-ant
 
Ant
Ant Ant
Ant
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipse
 
Build Scripts
Build ScriptsBuild Scripts
Build Scripts
 
Ibm
IbmIbm
Ibm
 
Autoconf&Automake
Autoconf&AutomakeAutoconf&Automake
Autoconf&Automake
 
HTML5
HTML5HTML5
HTML5
 
Automating API Documentation
Automating API DocumentationAutomating API Documentation
Automating API Documentation
 
Advanced Rational Robot A Tribute (http://www.geektester.blogspot.com)
Advanced Rational Robot   A Tribute (http://www.geektester.blogspot.com)Advanced Rational Robot   A Tribute (http://www.geektester.blogspot.com)
Advanced Rational Robot A Tribute (http://www.geektester.blogspot.com)
 
vitepress-en.pdf
vitepress-en.pdfvitepress-en.pdf
vitepress-en.pdf
 
Spring hibernate tutorial
Spring hibernate tutorialSpring hibernate tutorial
Spring hibernate tutorial
 
Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)
 
Basic Make
Basic MakeBasic Make
Basic Make
 
Ext 0523
Ext 0523Ext 0523
Ext 0523
 
Lec 4 06_aug [compatibility mode]
Lec 4 06_aug [compatibility mode]Lec 4 06_aug [compatibility mode]
Lec 4 06_aug [compatibility mode]
 

Apache ant

  • 1. Apache Ant K. M. Fazle Azim Babu [email_address]
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. Writing Ant build File Create a file build.xml containing only one target: <?xml version=&quot;1.0&quot;?> <project name=&quot;firstbuild&quot; default=&quot;compile&quot; > <target name=&quot;compile&quot;> <javac srcdir=&quot;.&quot; /> <echo>compilation complete!</echo> </target> </project> It compiles all Java source code in and below the current directory &quot;.&quot; according to Ant task <javac srcdir=&quot;.&quot; />
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. Project Element Attribute Description name the name of the project. default * the default target to use when no target is supplied. basedir the base directory from which all path calculations are done.
  • 13. Build File Example (Project) <project name=&quot;Sample Project&quot; default=&quot;compile&quot; basedir=&quot;.&quot;> <description> A sample build file for this project </description> </project>
  • 14.
  • 15. Target element Attribute Description name * the name of the target. depends a comma-separated list of names of targets on which this target depends. if the name of the property that must be set in order for this target to execute. unless name of the property that must not be set in order for this target to execute. description a short description of this target's function.
  • 16. Build File Example (Target) <project name=&quot;Sample Project&quot; default=&quot;compile&quot; basedir=&quot;.&quot;> ... <!-- set up some directories used by this project --> <target name=&quot;init&quot; description=&quot;setup project directories&quot;> </target> <!-- Compile the java code in src dir into build dir --> <target name=&quot;compile&quot; depends=&quot;init&quot; description=&quot;compile java sources&quot;> </target> <!-- Generate javadocs for current project into docs dir --> <target name=&quot;doc&quot; depends=&quot;init&quot; description=&quot;generate documentation&quot;> </target> <!-- Delete the build & doc directories and Emacs backup (*~) files --> <target name=&quot;clean&quot; description=&quot;tidy up the workspace&quot;> </target> </project>
  • 17.
  • 18.
  • 19.
  • 20. Build File Example (Properties) <project name=&quot;Sample Project&quot; default=&quot;compile&quot; basedir=&quot;.&quot;> <description> A sample build file for this project </description> <!-- global properties for this build file --> <property name=&quot;source.dir&quot; location=&quot;src&quot;/> <property name=&quot;build.dir&quot; location=&quot;bin&quot;/> <property name=&quot;doc.dir&quot; location=&quot;doc&quot;/> </project>
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. Completed Build File (1 of 3) <project name=&quot;Sample Project&quot; default=&quot;compile&quot; basedir=&quot;.&quot;> <description> A sample build file for this project </description> <!-- global properties for this build file --> <property name=&quot;source.dir&quot; location=&quot;src&quot;/> <property name=&quot;build.dir&quot; location=&quot;bin&quot;/> <property name=&quot;doc.dir&quot; location=&quot;doc&quot;/> <!-- set up some directories used by this project -->
  • 26. Completed Build File (2 of 3) <!-- set up some directories used by this project --> <target name=&quot;init&quot; description=&quot;setup project directories&quot;> <mkdir dir=&quot;${build.dir}&quot;/> <mkdir dir=&quot;${doc.dir}&quot;/> </target> <!-- Compile the java code in ${src.dir} into ${build.dir} --> <target name=&quot;compile&quot; depends=&quot;init&quot; description=&quot;compile java sources&quot;> <javac srcdir=&quot;${source.dir}&quot; destdir=&quot;${build.dir}&quot;/> </target>
  • 27. Completed Build File (3 of 3) <!-- Generate javadocs for current project into ${doc.dir} --> <target name=&quot;doc&quot; depends=&quot;init&quot; description=&quot;generate documentation&quot;> <javadoc sourcepath=&quot;${source.dir}&quot; destdir=&quot;${doc.dir}&quot;/> </target> <!-- Delete the build & doc directories and Emacs backup (*~) files --> <target name=&quot;clean&quot; description=&quot;tidy up the workspace&quot;> <delete dir=&quot;${build.dir}&quot;/> <delete dir=&quot;${doc.dir}&quot;/> <delete> <fileset defaultexcludes=&quot;no&quot; dir=&quot;${source.dir}&quot; includes=&quot;**/*~&quot;/> </delete> </target> </project>
  • 28.
  • 29.
  • 30.
  • 31.