SlideShare une entreprise Scribd logo
1  sur  18
Puneet SHARMA
 Introduction – What & Why
 Installing and Executing ANT
 ANT Terminologies and Concepts
 Core ANT tasks
 Creating a build file
 Execute an executable
 Executing SQL queries
 DEMO
 Queries
 Apache Ant (Ant) is a general purpose build tool. Ant
is an abbreviation for Another Neat Tool.
 Ant is primarily used for building and deploying Java
projects but can be used for every possible repetitive
tasks.
 ANT is Operating System and Language Neutral.
 ANT is implemented in Java.
 Ant can get source code from version control
 CVS, Subversion, Synergy, Perforce, ClearCase and many
more
 Ant can compile source code
 Ant can run unit tests
 JUnit3, JUnit4, TestNG, or any arbitrary test application
 Ant can package compiled code and resources
 jars, wars, ears, tars, zips, whatever
 Download latest stable zip file
from http://ant.apache.org/bindownload.cgi
 Unzip downloaded file into a directory
 Setup Environment Variables
 Define ANT_HOME to be the location where Ant was
unzipped
 Define JAVA_HOME to be the location where the JDK is
installed
 Add %ANT_HOME%bin to the PATH
 Check your installation by opening a command line
and typing ant -version into the commend line.
 Ant Project – a collection of named targets that can
run in any order. Each build file contains one project.
 Ant Target – a fixed series of ant tasks in a specified
order that can depend on other named targets. Targets
can depend only on other targets, not on projects or
tasks. A target represents a particular item to be
created, it can be a single item like a jar, or a group of
items, like classes.
 Ant Task – something that ant can execute such as a
compile, copy or replace. Most tasks have very
convenient default values.
 Each build file should contains one project which contains
the targets and the tasks to perform.
 A project has three attributes:
 Each project defines one or more targets. A target is a set
of tasks you want to be executed. When starting Ant, you
can select which target(s) you want to have executed.
When no target is given, the project's default is used.
Attribute Description Required
name The name of the project. No
default The default target to use when no target is supplied. No
basedir The base directory from which all path calculations are done. No
 A target is a container of tasks that cooperate to reach
a desired state during the build process.
 Targets can depend on other targets and Apache Ant
ensures that these other targets have been executed
before the current target.
 A target has the following attributes:
Attribute Description Required
name The name of the target. Yes
depends A comma-separated list of names of targets on
which this target depends.
No
if The name of the property that must be set in
order for this target to execute.
No
unless The name of the property that must not be set in
order for this target to execute.
No
description A short description of this target's function. No
 A task is a piece of code that can be executed.
 We have inbuilt tasks available for all the basic functions
needed for the build creation and automation.
 File Tasks:
<copy>, <concat>, <delete>, <filter>, <fixcrlf>, <get>
 Compile Tasks:
<javac>, <apt>,<rmic>
 Archive Tasks:
<zip>, <unzip>,<war>,<unwar>,<ear>
 Testing Tasks:
<junit>,<junitreport>
 Miscelleneous Tasks:
<echo>,<javadoc>,<sql>
Ant AntCall ANTLR AntStructure AntVersion Apply/ExecOn Apt Attrib Augment Avail
Basename Bindtargets BuildNumber BUnzip2 BZip2 Cab Continuus/Synergy Tasks CvsChangeLog Checksum Chg
Chmod Chown Clearcase Tasks Componentdef Concat Condition Supported conditions Copy Copydir Cop
Cvs CVSPass CvsTagDiff CvsVersion Defaultexcludes Delete Deltree Depend Dependset Diagn
Dirname Ear Echo Echoproperties EchoXML EJB Tasks Exec Fail Filter FixC
FTP GenKey Get GUnzip GZip Hostinfo Image Import Include Inp
Jar Jarlib-available Jarlib-display Jarlib-manifest Jarlib-resolve Java Javac JavaCC Javadoc/Javadoc2 Jav
JDepend JJDoc JJTree Jlink JspC JUnit JUnitReport Length LoadFile LoadPro
LoadResource Local MacroDef Mail MakeURL Manifest ManifestClassPath MimeMail Mkdir Mo
Native2Ascii NetRexxC Nice Parallel Patch PathConvert
PropertyFile
PreSetDef ProjectHelper Prop
PropertyHelper Pvcs Record Rename RenameExtensions Replace ReplaceRegExp ResourceCount Retry REx
Rmic Rpm SchemaValidate Scp Script Scriptdef Sequential ServerDeploy Setproxy Sign
Sleep SourceOffSite Sound Splash Sql Sshexec Sshsession Subant Symlink Sy
Tar Taskdef Telnet Tempfile Touch Translate Truncate TStamp Typedef Un
Unwar
Untar
Unzip Uptodate VerifyJar
Microsoft
Visual
SourceSafe
Tasks Waitfor War WhichResource
Weblo
Com
XmlProperty
XmlValidate XSLT/Style Zip
 Build File is an XML file which contains all the
configuration which is executed by ANT to create
build and performing other Tasks.
 The Sample Build file to create a build is attached
below:
 EXEC is an inbuilt task in Ant which helps us to run
any executable through ANT.
 Sample Execution of MQL
<target name="exec-mql">
<exec executable="mql -c">
<arg value="set context user creator;compile prog
* force update;"/>
</exec>
</target>
 Sometimes executing SQL queries also is a part of
application build. In that case ANT can help you to
automate the SQL execution as a part of ANT build.
 Connecting to Database:
<sql
driver="org.database.jdbcDriver”
url="jdbc:database-url”
userid="sa”
password="pass”
src="data.sql”
/>
 Here src conatins the sql script to be executed.
 Executing Query:
<sql
driver="org.database.jdbcDriver”
url="jdbc:database-url”
userid="sa”
password="pass”>
truncate table some_other_table;
</sql>
 Executing Query:
<sql
driver="org.database.jdbcDriver”
url="jdbc:database-url”
userid="sa”
password="pass” >
<transaction src="data1.sql"/>
<transaction src="data2.sql"/>
<transaction src="data3.sql"/>
<transaction>
truncate table some_other_table;
</transaction>
</sql>
ANT
Puneet Sharma.

Contenu connexe

Tendances

Interpreter RPG to Java
Interpreter RPG to JavaInterpreter RPG to Java
Interpreter RPG to Javafarerobe
 
How to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsHow to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsJarrod Overson
 
EclipseMAT
EclipseMATEclipseMAT
EclipseMATAli Bahu
 
Effective testing with pytest
Effective testing with pytestEffective testing with pytest
Effective testing with pytestHector Canto
 
Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat ToolKanika2885
 
Python testing using mock and pytest
Python testing using mock and pytestPython testing using mock and pytest
Python testing using mock and pytestSuraj Deshmukh
 
Apache ant
Apache antApache ant
Apache antkoniik
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkArulalan T
 
Unit Testing from Setup to Deployment
Unit Testing from Setup to DeploymentUnit Testing from Setup to Deployment
Unit Testing from Setup to DeploymentMark Niebergall
 
Puppet Systems Infrastructure Construction Kit
Puppet Systems Infrastructure Construction KitPuppet Systems Infrastructure Construction Kit
Puppet Systems Infrastructure Construction KitAlessandro Franceschi
 
Testing Django Applications
Testing Django ApplicationsTesting Django Applications
Testing Django ApplicationsHonza Král
 
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalksSelenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalksLohika_Odessa_TechTalks
 

Tendances (20)

Interpreter RPG to Java
Interpreter RPG to JavaInterpreter RPG to Java
Interpreter RPG to Java
 
How to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsHow to Reverse Engineer Web Applications
How to Reverse Engineer Web Applications
 
EclipseMAT
EclipseMATEclipseMAT
EclipseMAT
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
Apache ant
Apache antApache ant
Apache ant
 
Effective testing with pytest
Effective testing with pytestEffective testing with pytest
Effective testing with pytest
 
Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat Tool
 
Modern Python Testing
Modern Python TestingModern Python Testing
Modern Python Testing
 
Ant tutorial
Ant tutorialAnt tutorial
Ant tutorial
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
Beyond Unit Testing
Beyond Unit TestingBeyond Unit Testing
Beyond Unit Testing
 
Automation patterns on practice
Automation patterns on practiceAutomation patterns on practice
Automation patterns on practice
 
Python testing using mock and pytest
Python testing using mock and pytestPython testing using mock and pytest
Python testing using mock and pytest
 
Apache ant
Apache antApache ant
Apache ant
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-framework
 
Maven 3.0 at Øredev
Maven 3.0 at ØredevMaven 3.0 at Øredev
Maven 3.0 at Øredev
 
Unit Testing from Setup to Deployment
Unit Testing from Setup to DeploymentUnit Testing from Setup to Deployment
Unit Testing from Setup to Deployment
 
Puppet Systems Infrastructure Construction Kit
Puppet Systems Infrastructure Construction KitPuppet Systems Infrastructure Construction Kit
Puppet Systems Infrastructure Construction Kit
 
Testing Django Applications
Testing Django ApplicationsTesting Django Applications
Testing Django Applications
 
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalksSelenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
 

Similaire à Basics of ANT

Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologieselliando dias
 
Introduction To Ant1
Introduction To  Ant1Introduction To  Ant1
Introduction To Ant1Rajesh Kumar
 
Java/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBCJava/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBCFAKHRUN NISHA
 
Building JBoss AS 7 for Fedora
Building JBoss AS 7 for FedoraBuilding JBoss AS 7 for Fedora
Building JBoss AS 7 for Fedorawolfc71
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidenceJohn Congdon
 
Build, logging, and unit test tools
Build, logging, and unit test toolsBuild, logging, and unit test tools
Build, logging, and unit test toolsAllan Huang
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellBoulos Dib
 
Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suiteericholscher
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy Systemadrian_nye
 
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongJDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongPROIDEA
 
Unit Testing RPG with JUnit
Unit Testing RPG with JUnitUnit Testing RPG with JUnit
Unit Testing RPG with JUnitGreg.Helton
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To AntRajesh Kumar
 
Learn you some Ansible for great good!
Learn you some Ansible for great good!Learn you some Ansible for great good!
Learn you some Ansible for great good!David Lapsley
 

Similaire à Basics of ANT (20)

Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologies
 
Java ant tutorial
Java ant tutorialJava ant tutorial
Java ant tutorial
 
Introduction To Ant1
Introduction To  Ant1Introduction To  Ant1
Introduction To Ant1
 
Java/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBCJava/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBC
 
Building JBoss AS 7 for Fedora
Building JBoss AS 7 for FedoraBuilding JBoss AS 7 for Fedora
Building JBoss AS 7 for Fedora
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
 
Introduction java programming
Introduction java programmingIntroduction java programming
Introduction java programming
 
Build, logging, and unit test tools
Build, logging, and unit test toolsBuild, logging, and unit test tools
Build, logging, and unit test tools
 
1.introduction to java
1.introduction to java1.introduction to java
1.introduction to java
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suite
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
Basic java part_ii
Basic java part_iiBasic java part_ii
Basic java part_ii
 
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongJDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
 
Unit Testing RPG with JUnit
Unit Testing RPG with JUnitUnit Testing RPG with JUnit
Unit Testing RPG with JUnit
 
Java Basic PART I
Java Basic PART IJava Basic PART I
Java Basic PART I
 
basic_java.ppt
basic_java.pptbasic_java.ppt
basic_java.ppt
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
 
Java basic
Java basicJava basic
Java basic
 
Learn you some Ansible for great good!
Learn you some Ansible for great good!Learn you some Ansible for great good!
Learn you some Ansible for great good!
 

Dernier

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Dernier (20)

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

Basics of ANT

  • 2.  Introduction – What & Why  Installing and Executing ANT  ANT Terminologies and Concepts  Core ANT tasks  Creating a build file  Execute an executable  Executing SQL queries  DEMO  Queries
  • 3.  Apache Ant (Ant) is a general purpose build tool. Ant is an abbreviation for Another Neat Tool.  Ant is primarily used for building and deploying Java projects but can be used for every possible repetitive tasks.  ANT is Operating System and Language Neutral.  ANT is implemented in Java.
  • 4.  Ant can get source code from version control  CVS, Subversion, Synergy, Perforce, ClearCase and many more  Ant can compile source code  Ant can run unit tests  JUnit3, JUnit4, TestNG, or any arbitrary test application  Ant can package compiled code and resources  jars, wars, ears, tars, zips, whatever
  • 5.  Download latest stable zip file from http://ant.apache.org/bindownload.cgi  Unzip downloaded file into a directory  Setup Environment Variables  Define ANT_HOME to be the location where Ant was unzipped  Define JAVA_HOME to be the location where the JDK is installed  Add %ANT_HOME%bin to the PATH  Check your installation by opening a command line and typing ant -version into the commend line.
  • 6.  Ant Project – a collection of named targets that can run in any order. Each build file contains one project.  Ant Target – a fixed series of ant tasks in a specified order that can depend on other named targets. Targets can depend only on other targets, not on projects or tasks. A target represents a particular item to be created, it can be a single item like a jar, or a group of items, like classes.  Ant Task – something that ant can execute such as a compile, copy or replace. Most tasks have very convenient default values.
  • 7.  Each build file should contains one project which contains the targets and the tasks to perform.  A project has three attributes:  Each project defines one or more targets. A target is a set of tasks you want to be executed. When starting Ant, you can select which target(s) you want to have executed. When no target is given, the project's default is used. Attribute Description Required name The name of the project. No default The default target to use when no target is supplied. No basedir The base directory from which all path calculations are done. No
  • 8.  A target is a container of tasks that cooperate to reach a desired state during the build process.  Targets can depend on other targets and Apache Ant ensures that these other targets have been executed before the current target.  A target has the following attributes: Attribute Description Required name The name of the target. Yes depends A comma-separated list of names of targets on which this target depends. No if The name of the property that must be set in order for this target to execute. No unless The name of the property that must not be set in order for this target to execute. No description A short description of this target's function. No
  • 9.  A task is a piece of code that can be executed.  We have inbuilt tasks available for all the basic functions needed for the build creation and automation.  File Tasks: <copy>, <concat>, <delete>, <filter>, <fixcrlf>, <get>  Compile Tasks: <javac>, <apt>,<rmic>  Archive Tasks: <zip>, <unzip>,<war>,<unwar>,<ear>  Testing Tasks: <junit>,<junitreport>  Miscelleneous Tasks: <echo>,<javadoc>,<sql>
  • 10. Ant AntCall ANTLR AntStructure AntVersion Apply/ExecOn Apt Attrib Augment Avail Basename Bindtargets BuildNumber BUnzip2 BZip2 Cab Continuus/Synergy Tasks CvsChangeLog Checksum Chg Chmod Chown Clearcase Tasks Componentdef Concat Condition Supported conditions Copy Copydir Cop Cvs CVSPass CvsTagDiff CvsVersion Defaultexcludes Delete Deltree Depend Dependset Diagn Dirname Ear Echo Echoproperties EchoXML EJB Tasks Exec Fail Filter FixC FTP GenKey Get GUnzip GZip Hostinfo Image Import Include Inp Jar Jarlib-available Jarlib-display Jarlib-manifest Jarlib-resolve Java Javac JavaCC Javadoc/Javadoc2 Jav JDepend JJDoc JJTree Jlink JspC JUnit JUnitReport Length LoadFile LoadPro LoadResource Local MacroDef Mail MakeURL Manifest ManifestClassPath MimeMail Mkdir Mo Native2Ascii NetRexxC Nice Parallel Patch PathConvert PropertyFile PreSetDef ProjectHelper Prop PropertyHelper Pvcs Record Rename RenameExtensions Replace ReplaceRegExp ResourceCount Retry REx Rmic Rpm SchemaValidate Scp Script Scriptdef Sequential ServerDeploy Setproxy Sign Sleep SourceOffSite Sound Splash Sql Sshexec Sshsession Subant Symlink Sy Tar Taskdef Telnet Tempfile Touch Translate Truncate TStamp Typedef Un Unwar Untar Unzip Uptodate VerifyJar Microsoft Visual SourceSafe Tasks Waitfor War WhichResource Weblo Com XmlProperty XmlValidate XSLT/Style Zip
  • 11.  Build File is an XML file which contains all the configuration which is executed by ANT to create build and performing other Tasks.  The Sample Build file to create a build is attached below:
  • 12.  EXEC is an inbuilt task in Ant which helps us to run any executable through ANT.  Sample Execution of MQL <target name="exec-mql"> <exec executable="mql -c"> <arg value="set context user creator;compile prog * force update;"/> </exec> </target>
  • 13.  Sometimes executing SQL queries also is a part of application build. In that case ANT can help you to automate the SQL execution as a part of ANT build.  Connecting to Database: <sql driver="org.database.jdbcDriver” url="jdbc:database-url” userid="sa” password="pass” src="data.sql” />  Here src conatins the sql script to be executed.
  • 15.  Executing Query: <sql driver="org.database.jdbcDriver” url="jdbc:database-url” userid="sa” password="pass” > <transaction src="data1.sql"/> <transaction src="data2.sql"/> <transaction src="data3.sql"/> <transaction> truncate table some_other_table; </transaction> </sql>
  • 16.
  • 17.