SlideShare a Scribd company logo
An Introduction to Ant Bryan G. Hutchinson preEmptive Solutions, Inc.
An Introduction to Ant What is Ant? How do you use it? Why would you want to?
What is Ant? “crawling insect living in colonies: an insect that lives in complex well-organized colonies and is noted for …” Encarta World English Dictionary
What is Ant? According to Ant’s web site, ant is “ Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make's wrinkles.”   I’ve called Ant  “Make on Steroids!”
Make Limitations Shell-based: tied to a particular OS Makefile issues: tab vs. space
Ant Advantages Platform independent - thanks to Java! XML config files Tasks run by object implementing Task Interface
How to use Ant Install Ant Get It from the Ant home page Install It (Optional) Build It Check Library Dependancies and Platform-dependant issues
How to Use Ant Configured using an XML buildfile Buildfile contains one  project  and at least one  target Targets  contain  Tasks
Ant Buildfile Projects  have three attributes Optional name - name of project Required default - task to perform Optional basedir - base directory used for path calculation <project name=”JavaSig&quot; default=&quot;deploy&quot; basedir=&quot;.&quot;>
Ant Buildfile A  project  defines one or more  targets A  target  is a set of  tasks  to execute The default target is executed unless a target is specified when executing Ant
Ant Buildfile - Target <target name=&quot;deploy&quot; depends=&quot;dist&quot;> <!-- Copy jars to the weblogic instance --> <copy preservelastmodified=&quot;yes&quot;    todir=&quot;${deploy_dir}&quot;> <fileset dir=&quot;${dist}&quot;> <include name=&quot;*.jar&quot;/> <exclude name=”TestClients.jar&quot;/> </fileset> </copy> </target>
Ant Buildfile - Targets Can depend on other targets Gets executed only once Can determine execution based on a property
Ant Buildfile - Tasks Code that can be executed Can have multiple attributes Ant includes built-in tasks and optional tasks Can write your own tasks in Java  <javac srcdir=&quot;${src}&quot; destdir=&quot;${build}&quot;> <classpath refid=”compile.class.path&quot;/> </javac>
Ant Buildfile - Properties Properties can be set for a project Setup using the <property> task Setup in an external properties file Case-sensitive name / value Can be reference in task attributes using “${ propertyName }” System properties and Ant built-in properties available
Ant Buildfile - Properties <!-- set global properties for this build --> <property name=&quot;src&quot; value=&quot;src&quot;/> <property name=&quot;build&quot; value=&quot;build&quot;/> <property name=&quot;dist&quot; value=&quot;dist&quot;/> <property name=&quot;lib&quot; value=&quot;lib&quot;/> <property name=&quot;archive&quot; value=&quot;archive&quot;/> <property name=&quot;weblogic.home&quot; value=&quot;c:\weblogic&quot;/> <property name=&quot;wl_lib&quot; value=&quot;${weblogic.home}/myserver/lib&quot;/>
Ant Buildfile - PatternSets Patterns can be grouped in sets and referenced by id Defined by <patternset> element nested in a FileSet directory-based task stand alone element at target level
Ant Buildfile - PatternSets <patternset> has the following attributes: includes: list of patterns/files to include includesfile: name of file listing includes excludes: list of patterns/files to exclude excludesfile: name of file listing excludes Can also use nested <include> and <exclude> elements to specify patterns
Ant Buildfile - FileSets Groups of files Used by many tasks Files are found in a directory tree starting in a base directory and matching any number of PatternSets Can use nested <patternset> elements Also holds an implicit PatternSet
Ant Buildfile - FileSets <fileset dir=&quot;${build}&quot; includesfile=&quot;browseQueues.txt&quot;/> <fileset dir=&quot;${lib}/resources&quot; includes=&quot;**/BrowseQueues.properties&quot;/> <fileset dir=&quot;${dist}&quot;> <include name=&quot;*.jar&quot;/> <exclude name=&quot;GrinderTests.jar&quot;/> <exclude name=&quot;SystemTest.jar&quot;/> <exclude name=&quot;BrowseQueues.jar&quot;/> </fileset>
Why Use Ant? Ease of Use/Configuration Extensibility Standardized Platform Independent It’s Java It’s Open Source
Ant Resources Ant home page http://jakarta.apache.org/ant/index.html Ant User Manual http://jakarta.apache.org/ant/manual/index.html Ant Resources http://jakarta.apache.org/ant/resources.html “ Ant in Anger” http://jakarta.apache.org/ant/ant_in_anger.html

More Related Content

PPT
Hack in the Box Keynote 2006
PPTX
Php on the desktop and php gtk2
PDF
Php go vrooom!
PDF
SPL to the Rescue - Tek 09
PPTX
Zephir - A Wind of Change for writing PHP extensions
PPTX
Let's write secure Drupal code! DUG Belgium - 08/08/2019
PPTX
New in php 7
PPTX
Php on the Web and Desktop
Hack in the Box Keynote 2006
Php on the desktop and php gtk2
Php go vrooom!
SPL to the Rescue - Tek 09
Zephir - A Wind of Change for writing PHP extensions
Let's write secure Drupal code! DUG Belgium - 08/08/2019
New in php 7
Php on the Web and Desktop

What's hot (20)

ODP
Symfony CMF - PHP Conference Brazil 2011
PPTX
Let's write secure drupal code! - Drupal Camp Pannonia 2019
PPTX
Php string function
PPTX
PHP FUNCTIONS
PPT
PHP - Introduction to PHP Functions
PDF
Introduction To Django (Strange Loop 2011)
PDF
PECL Picks - Extensions to make your life better
PDF
Django REST Framework
PDF
New Features in PHP 5.3
PPTX
Php 7 hhvm and co
PPT
Create a web-app with Cgi Appplication
PDF
Django - 次の一歩 gumiStudy#3
PPTX
RESTful API 제대로 만들기
PPTX
Let's write secure Drupal code! - Drupal Camp Poland 2019
KEY
PHP security audits
PDF
Demystifying Object-Oriented Programming - ZendCon 2016
PPTX
Let's write secure Drupal code! - DrupalCamp Oslo, 2018
PDF
Web Scraping with PHP
ODP
Zend Framework 1.9 Setup & Using Zend_Tool
Symfony CMF - PHP Conference Brazil 2011
Let's write secure drupal code! - Drupal Camp Pannonia 2019
Php string function
PHP FUNCTIONS
PHP - Introduction to PHP Functions
Introduction To Django (Strange Loop 2011)
PECL Picks - Extensions to make your life better
Django REST Framework
New Features in PHP 5.3
Php 7 hhvm and co
Create a web-app with Cgi Appplication
Django - 次の一歩 gumiStudy#3
RESTful API 제대로 만들기
Let's write secure Drupal code! - Drupal Camp Poland 2019
PHP security audits
Demystifying Object-Oriented Programming - ZendCon 2016
Let's write secure Drupal code! - DrupalCamp Oslo, 2018
Web Scraping with PHP
Zend Framework 1.9 Setup & Using Zend_Tool
Ad

Viewers also liked (20)

PPTX
Los Derechos de Autor en España
PPS
Derecho de Autor en España
PPT
Propiedad intelectual y derechos de autor - Algunas ideas
ODP
Rocio mascota
ODP
ODP
Roberto
PDF
Mesura i control de la humitat en biocombustibles forestals
ODP
Composition
PPTX
PPTX
Mi mascota tobby
ODP
Mi mascota por Andrea
PDF
composurefordogs
PPTX
Mi mascota por María G,
PPTX
Minecraft
PPT
Mc Curdy Austin D
PPT
Dogs
ODP
Juanito My Dog
PPTX
Mi mascota
PPTX
psicologiacanina.rd
ODP
Presentación de mi mascota María V.
Los Derechos de Autor en España
Derecho de Autor en España
Propiedad intelectual y derechos de autor - Algunas ideas
Rocio mascota
Roberto
Mesura i control de la humitat en biocombustibles forestals
Composition
Mi mascota tobby
Mi mascota por Andrea
composurefordogs
Mi mascota por María G,
Minecraft
Mc Curdy Austin D
Dogs
Juanito My Dog
Mi mascota
psicologiacanina.rd
Presentación de mi mascota María V.
Ad

Similar to Ant (20)

PPT
Apache Ant
ODP
Ant User Guide
PPT
Introduction To Ant
PPT
Ant - Another Neat Tool
PPT
Ant - Another Neat Tool
PPT
Using Ant To Build J2 Ee Applications
PPT
PPT
Demystifying Maven
PDF
Deploy Flex with Apache Ant
PPT
Migration testing framework
ODP
Phing - A PHP Build Tool (An Introduction)
PPTX
PPT
Ajax to the Moon
ODP
Why Python Web Frameworks Are Changing the Web
PPT
Ant Build Tool
PPTX
PHP North East Registry Pattern
PPTX
PHP North East - Registry Design Pattern
PPTX
สปริงเฟรมเวิร์ค4.1
PPT
Selenium RC Automation testing
PDF
Optaros Surf Code Camp Walkthrough 1
Apache Ant
Ant User Guide
Introduction To Ant
Ant - Another Neat Tool
Ant - Another Neat Tool
Using Ant To Build J2 Ee Applications
Demystifying Maven
Deploy Flex with Apache Ant
Migration testing framework
Phing - A PHP Build Tool (An Introduction)
Ajax to the Moon
Why Python Web Frameworks Are Changing the Web
Ant Build Tool
PHP North East Registry Pattern
PHP North East - Registry Design Pattern
สปริงเฟรมเวิร์ค4.1
Selenium RC Automation testing
Optaros Surf Code Camp Walkthrough 1

Recently uploaded (20)

PDF
Tata consultancy services case study shri Sharda college, basrur
PDF
NewBase 12 August 2025 Energy News issue - 1812 by Khaled Al Awadi_compresse...
PPTX
basic introduction to research chapter 1.pptx
PDF
ANALYZING THE OPPORTUNITIES OF DIGITAL MARKETING IN BANGLADESH TO PROVIDE AN ...
PPTX
Negotiation and Persuasion Skills: A Shrewd Person's Perspective
PPTX
svnfcksanfskjcsnvvjknsnvsdscnsncxasxa saccacxsax
PPTX
Principles of Marketing, Industrial, Consumers,
PPTX
TRAINNING, DEVELOPMENT AND APPRAISAL.pptx
PDF
Solara Labs: Empowering Health through Innovative Nutraceutical Solutions
PDF
Module 2 - Modern Supervison Challenges - Student Resource.pdf
PDF
Keppel_Proposed Divestment of M1 Limited
PDF
Booking.com The Global AI Sentiment Report 2025
DOCX
80 DE ÔN VÀO 10 NĂM 2023vhkkkjjhhhhjjjj
PPT
Lecture 3344;;,,(,(((((((((((((((((((((((
PDF
Satish NS: Fostering Innovation and Sustainability: Haier India’s Customer-Ce...
PDF
NEW - FEES STRUCTURES (01-july-2024).pdf
PDF
Blood Collected straight from the donor into a blood bag and mixed with an an...
PDF
NISM Series V-A MFD Workbook v December 2024.khhhjtgvwevoypdnew one must use ...
PDF
Charisse Litchman: A Maverick Making Neurological Care More Accessible
PDF
Introduction to Generative Engine Optimization (GEO)
Tata consultancy services case study shri Sharda college, basrur
NewBase 12 August 2025 Energy News issue - 1812 by Khaled Al Awadi_compresse...
basic introduction to research chapter 1.pptx
ANALYZING THE OPPORTUNITIES OF DIGITAL MARKETING IN BANGLADESH TO PROVIDE AN ...
Negotiation and Persuasion Skills: A Shrewd Person's Perspective
svnfcksanfskjcsnvvjknsnvsdscnsncxasxa saccacxsax
Principles of Marketing, Industrial, Consumers,
TRAINNING, DEVELOPMENT AND APPRAISAL.pptx
Solara Labs: Empowering Health through Innovative Nutraceutical Solutions
Module 2 - Modern Supervison Challenges - Student Resource.pdf
Keppel_Proposed Divestment of M1 Limited
Booking.com The Global AI Sentiment Report 2025
80 DE ÔN VÀO 10 NĂM 2023vhkkkjjhhhhjjjj
Lecture 3344;;,,(,(((((((((((((((((((((((
Satish NS: Fostering Innovation and Sustainability: Haier India’s Customer-Ce...
NEW - FEES STRUCTURES (01-july-2024).pdf
Blood Collected straight from the donor into a blood bag and mixed with an an...
NISM Series V-A MFD Workbook v December 2024.khhhjtgvwevoypdnew one must use ...
Charisse Litchman: A Maverick Making Neurological Care More Accessible
Introduction to Generative Engine Optimization (GEO)

Ant

  • 1. An Introduction to Ant Bryan G. Hutchinson preEmptive Solutions, Inc.
  • 2. An Introduction to Ant What is Ant? How do you use it? Why would you want to?
  • 3. What is Ant? “crawling insect living in colonies: an insect that lives in complex well-organized colonies and is noted for …” Encarta World English Dictionary
  • 4. What is Ant? According to Ant’s web site, ant is “ Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make's wrinkles.” I’ve called Ant “Make on Steroids!”
  • 5. Make Limitations Shell-based: tied to a particular OS Makefile issues: tab vs. space
  • 6. Ant Advantages Platform independent - thanks to Java! XML config files Tasks run by object implementing Task Interface
  • 7. How to use Ant Install Ant Get It from the Ant home page Install It (Optional) Build It Check Library Dependancies and Platform-dependant issues
  • 8. How to Use Ant Configured using an XML buildfile Buildfile contains one project and at least one target Targets contain Tasks
  • 9. Ant Buildfile Projects have three attributes Optional name - name of project Required default - task to perform Optional basedir - base directory used for path calculation <project name=”JavaSig&quot; default=&quot;deploy&quot; basedir=&quot;.&quot;>
  • 10. Ant Buildfile A project defines one or more targets A target is a set of tasks to execute The default target is executed unless a target is specified when executing Ant
  • 11. Ant Buildfile - Target <target name=&quot;deploy&quot; depends=&quot;dist&quot;> <!-- Copy jars to the weblogic instance --> <copy preservelastmodified=&quot;yes&quot; todir=&quot;${deploy_dir}&quot;> <fileset dir=&quot;${dist}&quot;> <include name=&quot;*.jar&quot;/> <exclude name=”TestClients.jar&quot;/> </fileset> </copy> </target>
  • 12. Ant Buildfile - Targets Can depend on other targets Gets executed only once Can determine execution based on a property
  • 13. Ant Buildfile - Tasks Code that can be executed Can have multiple attributes Ant includes built-in tasks and optional tasks Can write your own tasks in Java <javac srcdir=&quot;${src}&quot; destdir=&quot;${build}&quot;> <classpath refid=”compile.class.path&quot;/> </javac>
  • 14. Ant Buildfile - Properties Properties can be set for a project Setup using the <property> task Setup in an external properties file Case-sensitive name / value Can be reference in task attributes using “${ propertyName }” System properties and Ant built-in properties available
  • 15. Ant Buildfile - Properties <!-- set global properties for this build --> <property name=&quot;src&quot; value=&quot;src&quot;/> <property name=&quot;build&quot; value=&quot;build&quot;/> <property name=&quot;dist&quot; value=&quot;dist&quot;/> <property name=&quot;lib&quot; value=&quot;lib&quot;/> <property name=&quot;archive&quot; value=&quot;archive&quot;/> <property name=&quot;weblogic.home&quot; value=&quot;c:\weblogic&quot;/> <property name=&quot;wl_lib&quot; value=&quot;${weblogic.home}/myserver/lib&quot;/>
  • 16. Ant Buildfile - PatternSets Patterns can be grouped in sets and referenced by id Defined by <patternset> element nested in a FileSet directory-based task stand alone element at target level
  • 17. Ant Buildfile - PatternSets <patternset> has the following attributes: includes: list of patterns/files to include includesfile: name of file listing includes excludes: list of patterns/files to exclude excludesfile: name of file listing excludes Can also use nested <include> and <exclude> elements to specify patterns
  • 18. Ant Buildfile - FileSets Groups of files Used by many tasks Files are found in a directory tree starting in a base directory and matching any number of PatternSets Can use nested <patternset> elements Also holds an implicit PatternSet
  • 19. Ant Buildfile - FileSets <fileset dir=&quot;${build}&quot; includesfile=&quot;browseQueues.txt&quot;/> <fileset dir=&quot;${lib}/resources&quot; includes=&quot;**/BrowseQueues.properties&quot;/> <fileset dir=&quot;${dist}&quot;> <include name=&quot;*.jar&quot;/> <exclude name=&quot;GrinderTests.jar&quot;/> <exclude name=&quot;SystemTest.jar&quot;/> <exclude name=&quot;BrowseQueues.jar&quot;/> </fileset>
  • 20. Why Use Ant? Ease of Use/Configuration Extensibility Standardized Platform Independent It’s Java It’s Open Source
  • 21. Ant Resources Ant home page http://jakarta.apache.org/ant/index.html Ant User Manual http://jakarta.apache.org/ant/manual/index.html Ant Resources http://jakarta.apache.org/ant/resources.html “ Ant in Anger” http://jakarta.apache.org/ant/ant_in_anger.html