SlideShare a Scribd company logo
1 of 23
CodeIgniter
Ant Scripting
Topic
• What is Ant?
• Why use Ant?
• How can we use Ant?
• How to stream development with Ant?
What Is Ant?
• Ant is a Java-based build tool. In theory, it is kind
of like make, without make's wrinkles.
• Ant is different. Instead of a model where it is
extended with shell-based commands, Ant is
extended using Java classes. Instead of writing
shell commands, the configuration files are XML-
based, calling out a target tree where various
tasks get executed. Each task is run by an object
that implements a particular Task interface.
So If Ant is Java why do we want to use
it for PHP
• Well Ideally Ant was used to stream line build
and compilation with Java in response to
Make.
• With the way Ant is, it can be used in any
automation we want as long as all the
requirements used in the automation are
already installed
– We can’t use something we don’t have ;-)
Installing Ant
• Ant can be downloaded from:
http://ant.apache.org
• Most Current IDE come with Ant Pre-installed
– My Personal Preference NETBEANS IDE
– Other’s like Eclipse …. (WHY????)
• MAC OS ant is pre-installed, UBUNTU also, but
always update ;-) …
Ant Task… huh?
• Ant has a ton of task both built in and
downloadable.
• Ant Task are “actions” to be done in the Ant
Script.
Ant Task Buckets:
Archive Tasks
Audit/Coverage Tasks
Compile Tasks
Deployment Tasks
Documentation Tasks
EJB Tasks
Execution Tasks
File Tasks
Java2 Extensions Tasks
Logging Tasks
Mail Tasks
Miscellaneous Tasks
Pre-process Tasks
Property Tasks
Remote Tasks
SCM Tasks
Testing Tasks
The Ant Build File
<!-- this is an ant script to build the project and
information -->
<project name=”Demo" default="freshBuild"
basedir=".">
<description>
This is the ant script to build demo this has the
ability to clean the build, create a Code Report,
Run Unit Tests and Build Documentation
</description>
Ant Properties…
• <property name="docs" location="docs" />
• <property name="applicationDocs" location="${docs}/application"/>
• <property name="libraryDocs" location="${docs}/library" />
• <property name="reports" location="reports"/>
• <property name="sniffer" location="${reports}/sniffer" />
• <property name="applicationReports" location="${reports}/application" />
• <property name="libraryReports" location="${reports}/library" />
• <property name="build" location="build" />
• <property name="tests" location="tests" />
Ant Cleaning…
• <!-- this will create a clean working environment -->
• <target name="clean">
• <echo message="Clearing the folders"/>
• <delete dir="${applicationDocs}"/>
• <delete dir="${libraryDocs}" />
• <delete dir="${reports}" />
• <delete dir="${build}" />
• <echo message="Creating the folders" />
• <mkdir dir="${applicationDocs}" />
• <mkdir dir="${libraryDocs}" />
• <mkdir dir="${reports}" />
• <mkdir dir="${sniffer}" />
• <mkdir dir="${applicationReports}" />
• <mkdir dir="${libraryReports}" />
• <mkdir dir="${build}" />
• </target>
Ant Clean Cont….
• <target name="cleanProject">
• <echo message="Clearing the folders"/>
• <delete dir="${applicationDocs}"/>
• <delete dir="${libraryDocs}" />
• <delete dir="${reports}" />
• <delete dir="${build}" />
• </target>
Ant Code Sniffing…
• <!-- code sniffer -->
• <target name="codeSniff">
• <echo message="Started Sniffing code" />
• <echo message="Sniffing Library" />
• <exec executable="phpcs" output="${sniffer}/library.sniffer.txt">
• <arg value="${NoteLib}"/>
• <arg value="--standard=ZEND"/>
• <arg value="--report=full" />
• <arg value="-n"/>
• </exec>
• <echo message="Sniffing Application" />
• <exec executable="phpcs" output="${sniffer}/application.sniffer.txt">
• <arg value="${application}" />
• <arg value="--standard=ZEND" />
• <arg value="--report=full" />
• <arg value="-n" />
• </exec>
• <echo message="Finished Sniffing the Code" />
• </target>
Ant Documenting …
• <!-- PHP DOCUMENTATION -->
• <target name="document">
• <echo message="Started Documenting the code" />
• <echo message="Documenting the Application" />
• <exec executable="phpdoc" output="${docs}/application.doc.result.txt">
• <arg line="
• --target ${applicationDocs}
• --directory ${application}
• --title 'Note In A Bottle Application Documentation'
• --undocumentedelements on
• -i *.phtml
• --defaultpackagename 'NoteInBottleApp'
• "/>
• </exec>
Ant Documenting cont…
• <echo message="Documenting the Application's Library" />
• <exec executable="phpdoc"
output="${docs}/application.doc.result.txt">
• <arg line="
• --target ${libraryDocs}
• --directory ${NoteLib}
• --title 'Note In A Bottle Library Documentation'
• --undocumentedelements on
• --defaultpackagename 'NoteInBottle'
• "/>
• </exec>
• <echo message="Finished Documenting the code" />
• </target>
Ant Fresh Build….
• <target name="freshBuild" depends="clean,
codeSniff, unitTesting, document”>
• </target>
Ant Copy to Server…
• <target name="copyToTestServer">
• <exec executable="cp" output="${docs}/cp.result.txt">
• <arg line="
• -R
• /Users/albertrosa/Sites/Demo/
/Volumes/www/Demo/
• "/>
• </exec>
• <echo message="copied"/>
• </target>
UMMM…. Ok but how does it work…
• So you see how the ant xml file looks, you know
the buckets that are included with Ant and you
have an idea of how you want your build to go ….
SO how do you use it?
• Simple… in your Terminal / command prompt /
console navigate to the build file ohh wait I didn’t
tell you where the build file should go huh…. Well
I always place it at the root of the site so all my
paths are relative to that root.
But really now how to build it….
• Once you have navigated to the desired location
all that is left to do is run the command as follows
ant <target name>
Yep that’s all … so each target is an “task” you can
do. But recall the freshBuild target .. That had
depends as an attribute. Well those depends are
all ran when you execute “ant freshBuild”
Basic errors most commonly found
• Ant depends orders – if some targets need
something to happen first that should happen
before that task is executed
• You are using a ant task that isn’t installed
• You action is producing an error and causes
the execution to terminate
• You run out of memory :-D rare but possible
on many large scale projects.
THANKS
• Thanks go to ROKKAN for providing us with
the Conference space.
General Info
• My Email: albert@albert-rosa.com
• AIM: albertrosa2000
• Meetup: www.meetup.com/codeigniter/
• Rokkan: www.rokkan.com
Sources
• http://ant.apache.org/

More Related Content

What's hot

Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JSMichael Haberman
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Cogapp
 
Test automation with php codeception
Test automation with php codeceptionTest automation with php codeception
Test automation with php codeceptionbuddhieash
 
Unit testing for WordPress
Unit testing for WordPressUnit testing for WordPress
Unit testing for WordPressHarshad Mane
 
Effective testing with pytest
Effective testing with pytestEffective testing with pytest
Effective testing with pytestHector Canto
 
Test-Driven JavaScript Development (JavaZone 2010)
Test-Driven JavaScript Development (JavaZone 2010)Test-Driven JavaScript Development (JavaZone 2010)
Test-Driven JavaScript Development (JavaZone 2010)Christian Johansen
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Ondřej Machulda
 
CI / CD w/ Codeception
CI / CD w/ CodeceptionCI / CD w/ Codeception
CI / CD w/ CodeceptionTudor Barbu
 
Selenium Open Source Tool
Selenium Open Source ToolSelenium Open Source Tool
Selenium Open Source Toolonlinemindq
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Adam Štipák
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmineTimothy Oxley
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsSeth McLaughlin
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testingEngineor
 
Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011Yuriy Gerasimov
 
Painless JavaScript Testing with Jest
Painless JavaScript Testing with JestPainless JavaScript Testing with Jest
Painless JavaScript Testing with JestMichał Pierzchała
 
Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScriptSimon Guest
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Ondřej Machulda
 

What's hot (20)

Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JS
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
 
Test automation with php codeception
Test automation with php codeceptionTest automation with php codeception
Test automation with php codeception
 
Unit testing for WordPress
Unit testing for WordPressUnit testing for WordPress
Unit testing for WordPress
 
Effective testing with pytest
Effective testing with pytestEffective testing with pytest
Effective testing with pytest
 
Test-Driven JavaScript Development (JavaZone 2010)
Test-Driven JavaScript Development (JavaZone 2010)Test-Driven JavaScript Development (JavaZone 2010)
Test-Driven JavaScript Development (JavaZone 2010)
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
 
CI / CD w/ Codeception
CI / CD w/ CodeceptionCI / CD w/ Codeception
CI / CD w/ Codeception
 
PHP-VCR behat case study
PHP-VCR behat case studyPHP-VCR behat case study
PHP-VCR behat case study
 
Selenium Open Source Tool
Selenium Open Source ToolSelenium Open Source Tool
Selenium Open Source Tool
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmine
 
Laravel Unit Testing
Laravel Unit TestingLaravel Unit Testing
Laravel Unit Testing
 
Jasmine with JS-Test-Driver
Jasmine with JS-Test-DriverJasmine with JS-Test-Driver
Jasmine with JS-Test-Driver
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testing
 
Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011
 
Painless JavaScript Testing with Jest
Painless JavaScript Testing with JestPainless JavaScript Testing with Jest
Painless JavaScript Testing with Jest
 
Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScript
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
 

Similar to CodeIgniter Ant Scripting

Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014Miguel Zuniga
 
Apache ant
Apache antApache ant
Apache antkoniik
 
Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools Yulia Shcherbachova
 
Coding for production
Coding for productionCoding for production
Coding for productionjehiah
 
Node.js Development Workflow Automation with Grunt.js
Node.js Development Workflow Automation with Grunt.jsNode.js Development Workflow Automation with Grunt.js
Node.js Development Workflow Automation with Grunt.jskiyanwang
 
AWS Meet-up: Logging At Scale on AWS
AWS Meet-up: Logging At Scale on AWSAWS Meet-up: Logging At Scale on AWS
AWS Meet-up: Logging At Scale on AWSChris Riddell
 
BP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesBP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesAlfresco Software
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfO365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfNCCOMMS
 
Reactive summit 2020 microsoft orleans the easy way
Reactive summit 2020   microsoft orleans the easy wayReactive summit 2020   microsoft orleans the easy way
Reactive summit 2020 microsoft orleans the easy wayJohn Azariah
 
Intro To Node.js
Intro To Node.jsIntro To Node.js
Intro To Node.jsChris Cowan
 
Introduction To Ant1
Introduction To  Ant1Introduction To  Ant1
Introduction To Ant1Rajesh Kumar
 
Building Hermetic Systems (without Docker)
Building Hermetic Systems (without Docker)Building Hermetic Systems (without Docker)
Building Hermetic Systems (without Docker)William Farrell
 

Similar to CodeIgniter Ant Scripting (20)

Apache ant
Apache antApache ant
Apache ant
 
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
 
Apache ant
Apache antApache ant
Apache ant
 
Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools
 
.NET Debugging Workshop
.NET Debugging Workshop.NET Debugging Workshop
.NET Debugging Workshop
 
Coding for production
Coding for productionCoding for production
Coding for production
 
DevOps for database
DevOps for databaseDevOps for database
DevOps for database
 
Node.js Development Workflow Automation with Grunt.js
Node.js Development Workflow Automation with Grunt.jsNode.js Development Workflow Automation with Grunt.js
Node.js Development Workflow Automation with Grunt.js
 
AWS Meet-up: Logging At Scale on AWS
AWS Meet-up: Logging At Scale on AWSAWS Meet-up: Logging At Scale on AWS
AWS Meet-up: Logging At Scale on AWS
 
BP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesBP-6 Repository Customization Best Practices
BP-6 Repository Customization Best Practices
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfO365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
 
[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions
 
Reactive summit 2020 microsoft orleans the easy way
Reactive summit 2020   microsoft orleans the easy wayReactive summit 2020   microsoft orleans the easy way
Reactive summit 2020 microsoft orleans the easy way
 
Intro To Node.js
Intro To Node.jsIntro To Node.js
Intro To Node.js
 
Introduction To Ant1
Introduction To  Ant1Introduction To  Ant1
Introduction To Ant1
 
Intro to-ant
Intro to-antIntro to-ant
Intro to-ant
 
Building Hermetic Systems (without Docker)
Building Hermetic Systems (without Docker)Building Hermetic Systems (without Docker)
Building Hermetic Systems (without Docker)
 
Node azure
Node azureNode azure
Node azure
 
Amazon EC2 Container Service
Amazon EC2 Container ServiceAmazon EC2 Container Service
Amazon EC2 Container Service
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 

Recently uploaded (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 

CodeIgniter Ant Scripting

  • 2. Topic • What is Ant? • Why use Ant? • How can we use Ant? • How to stream development with Ant?
  • 3.
  • 4. What Is Ant? • Ant is a Java-based build tool. In theory, it is kind of like make, without make's wrinkles. • Ant is different. Instead of a model where it is extended with shell-based commands, Ant is extended using Java classes. Instead of writing shell commands, the configuration files are XML- based, calling out a target tree where various tasks get executed. Each task is run by an object that implements a particular Task interface.
  • 5. So If Ant is Java why do we want to use it for PHP • Well Ideally Ant was used to stream line build and compilation with Java in response to Make. • With the way Ant is, it can be used in any automation we want as long as all the requirements used in the automation are already installed – We can’t use something we don’t have ;-)
  • 6. Installing Ant • Ant can be downloaded from: http://ant.apache.org • Most Current IDE come with Ant Pre-installed – My Personal Preference NETBEANS IDE – Other’s like Eclipse …. (WHY????) • MAC OS ant is pre-installed, UBUNTU also, but always update ;-) …
  • 7. Ant Task… huh? • Ant has a ton of task both built in and downloadable. • Ant Task are “actions” to be done in the Ant Script.
  • 8. Ant Task Buckets: Archive Tasks Audit/Coverage Tasks Compile Tasks Deployment Tasks Documentation Tasks EJB Tasks Execution Tasks File Tasks Java2 Extensions Tasks Logging Tasks Mail Tasks Miscellaneous Tasks Pre-process Tasks Property Tasks Remote Tasks SCM Tasks Testing Tasks
  • 9. The Ant Build File <!-- this is an ant script to build the project and information --> <project name=”Demo" default="freshBuild" basedir="."> <description> This is the ant script to build demo this has the ability to clean the build, create a Code Report, Run Unit Tests and Build Documentation </description>
  • 10. Ant Properties… • <property name="docs" location="docs" /> • <property name="applicationDocs" location="${docs}/application"/> • <property name="libraryDocs" location="${docs}/library" /> • <property name="reports" location="reports"/> • <property name="sniffer" location="${reports}/sniffer" /> • <property name="applicationReports" location="${reports}/application" /> • <property name="libraryReports" location="${reports}/library" /> • <property name="build" location="build" /> • <property name="tests" location="tests" />
  • 11. Ant Cleaning… • <!-- this will create a clean working environment --> • <target name="clean"> • <echo message="Clearing the folders"/> • <delete dir="${applicationDocs}"/> • <delete dir="${libraryDocs}" /> • <delete dir="${reports}" /> • <delete dir="${build}" /> • <echo message="Creating the folders" /> • <mkdir dir="${applicationDocs}" /> • <mkdir dir="${libraryDocs}" /> • <mkdir dir="${reports}" /> • <mkdir dir="${sniffer}" /> • <mkdir dir="${applicationReports}" /> • <mkdir dir="${libraryReports}" /> • <mkdir dir="${build}" /> • </target>
  • 12. Ant Clean Cont…. • <target name="cleanProject"> • <echo message="Clearing the folders"/> • <delete dir="${applicationDocs}"/> • <delete dir="${libraryDocs}" /> • <delete dir="${reports}" /> • <delete dir="${build}" /> • </target>
  • 13. Ant Code Sniffing… • <!-- code sniffer --> • <target name="codeSniff"> • <echo message="Started Sniffing code" /> • <echo message="Sniffing Library" /> • <exec executable="phpcs" output="${sniffer}/library.sniffer.txt"> • <arg value="${NoteLib}"/> • <arg value="--standard=ZEND"/> • <arg value="--report=full" /> • <arg value="-n"/> • </exec> • <echo message="Sniffing Application" /> • <exec executable="phpcs" output="${sniffer}/application.sniffer.txt"> • <arg value="${application}" /> • <arg value="--standard=ZEND" /> • <arg value="--report=full" /> • <arg value="-n" /> • </exec> • <echo message="Finished Sniffing the Code" /> • </target>
  • 14. Ant Documenting … • <!-- PHP DOCUMENTATION --> • <target name="document"> • <echo message="Started Documenting the code" /> • <echo message="Documenting the Application" /> • <exec executable="phpdoc" output="${docs}/application.doc.result.txt"> • <arg line=" • --target ${applicationDocs} • --directory ${application} • --title 'Note In A Bottle Application Documentation' • --undocumentedelements on • -i *.phtml • --defaultpackagename 'NoteInBottleApp' • "/> • </exec>
  • 15. Ant Documenting cont… • <echo message="Documenting the Application's Library" /> • <exec executable="phpdoc" output="${docs}/application.doc.result.txt"> • <arg line=" • --target ${libraryDocs} • --directory ${NoteLib} • --title 'Note In A Bottle Library Documentation' • --undocumentedelements on • --defaultpackagename 'NoteInBottle' • "/> • </exec> • <echo message="Finished Documenting the code" /> • </target>
  • 16. Ant Fresh Build…. • <target name="freshBuild" depends="clean, codeSniff, unitTesting, document”> • </target>
  • 17. Ant Copy to Server… • <target name="copyToTestServer"> • <exec executable="cp" output="${docs}/cp.result.txt"> • <arg line=" • -R • /Users/albertrosa/Sites/Demo/ /Volumes/www/Demo/ • "/> • </exec> • <echo message="copied"/> • </target>
  • 18. UMMM…. Ok but how does it work… • So you see how the ant xml file looks, you know the buckets that are included with Ant and you have an idea of how you want your build to go …. SO how do you use it? • Simple… in your Terminal / command prompt / console navigate to the build file ohh wait I didn’t tell you where the build file should go huh…. Well I always place it at the root of the site so all my paths are relative to that root.
  • 19. But really now how to build it…. • Once you have navigated to the desired location all that is left to do is run the command as follows ant <target name> Yep that’s all … so each target is an “task” you can do. But recall the freshBuild target .. That had depends as an attribute. Well those depends are all ran when you execute “ant freshBuild”
  • 20. Basic errors most commonly found • Ant depends orders – if some targets need something to happen first that should happen before that task is executed • You are using a ant task that isn’t installed • You action is producing an error and causes the execution to terminate • You run out of memory :-D rare but possible on many large scale projects.
  • 21. THANKS • Thanks go to ROKKAN for providing us with the Conference space.
  • 22. General Info • My Email: albert@albert-rosa.com • AIM: albertrosa2000 • Meetup: www.meetup.com/codeigniter/ • Rokkan: www.rokkan.com