CSC 395 – Software Engineering Lecture 24: Apache Ant –or– Programming the results of programming Based upon a talk by Anthony Wat.

Slides:



Advertisements
Similar presentations
ANT Another Neat Tool. What is ANT? What is Apache Ant? Ant is a Java-based build tool. In theory, it is kind of like Make, without Make's wrinkles and.
Advertisements

Software Development Tools COMP220/COMP285 Seb Coope Ant and XML: Getting Started These slides are mainly based on “Java Development with Ant” - E. Hatcher.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
ANT – Another Neat Tool Representation and Management of Data on the Internet.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
MC365 Ant. Today We Will Cover: Overview of Ant Installing Ant Using the Ant command line tool Various Ant commands available Using Ant in Eclipse.
11 WORKING WITH GROUPS Chapter 7. Chapter 7: WORKING WITH GROUPS2 CHAPTER OVERVIEW  Understand the functions of groups and how to use them.  Understand.
1 Ant – Another Neat Tool Representation and Management of Data on the Internet.
© S Ramakrishnan1 Systems V & V, Quality and Standards Dr Sita Ramakrishnan School CSSE Monash University.
1 Introduction to ANT Written by James Duncan Davidson Like GNU Make but specifically for Java Good for bundling and delivery of groups of classes, jars,
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Java Development Tools project.
Winter 2005Jason Prideaux1 Apache ANT A platform independent build tool for Java programs.
The Internet. Telnet Telnet means using your computer as a terminal. All commands you type are sent to the host computer you are connected to and executed.
Introduction to Ant David Rabinowitz. March 3rd, 2004 Object Oriented Design Course 2 Ant Yet another build tool? Why do we need one where there are make,
Introduction to CVS 7/3/20151UMBC CMSC 341. Outline Introduction to Source Code Management What is CVS? CVS for Project Submission Basic commands Checkout,
OCT Information Systems Management 1 Lecture 2A Introduction to ANT Written by James Duncan Davidson. Like GNU Make but specifically for Java. Good.
Automating the Build Process using ANT SE-2030 Dr. Mark L. Hornick 1.
1 Chapter Overview Creating User and Computer Objects Maintaining User Accounts Creating User Profiles.
2007 Adobe Systems Incorporated. All Rights Reserved. 1 Joe Berkovitz VP Engineering Allurent, Inc. Continuous Integration with Flex, FlexUnit, and Ant.
Using Ant to build J2EE Applications Kumar
Introduction to ant Guy Rixon AstroGrid Consortium Meeting
Module 2 Creating Active Directory ® Domain Services User and Computer Objects.
Version Control with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
CMSC 341 – Data Structures Spring 2012 University of Maryland, Baltimore County ANT, CVS and CVS Utilities Slides prepared by Prajit Kumar Das – Summarized.
1 Guide to Novell NetWare 6.0 Network Administration Chapter 12.
Java Programming, 3e Concepts and Techniques Chapter 2 - Part 2 Creating a Java Application and Applet.
Automating the Build Process using Ant SE-2030 Dr. Rob Hasker 1 Based on material by Dr. Mark L. Hornick.
COMP-14: Automating your deployments using ANT Gary S Clink Business Consultant.
Conditions and Terms of Use
Chapter 9 Scripting RMAN. Background Authors felt that scripting was a topic not covered well Authors wanted to cover both Unix/Linux and Windows environments.
Apache Ant Java-Based Build Tool. Making your builds boring… Building projects should be easy and standardized. You should not be spending a substantial.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Apache Ant A gateway to test-driven Java development.
SAN DIEGO SUPERCOMPUTER CENTER Working with Inca Reporters Jim Hayes Inca Workshop September 4-5, 2008.
TEAM Basic TotalElectrostatic ManagementAwareness&
Ant Build Tools.  Creating a product from source may take several steps: Compile Link Copy files to various directories Remove intermediate files Generate.
Linux Operations and Administration
IBM Software Group ® Overview of SA and RSA Integration John Jessup June 1, 2012 Slides from Kevin Cornell December 2008 Have been reused in this presentation.
July 2011CMSC 341 CVS/Ant 1 CMSC 341 Java Packages Ant CVS Project Submission.
Oracle Data Integrator Procedures, Advanced Workflows.
Ant Presentation by: Bart Taylor. What is Ant? The simple definition: A Java-based build tool The Official Definition: “Apache Ant is a Java-based build.
Ant & Jar Ant – Java-based build tool Jar – pkzip archive, that contains metadata (a manifest file) that the JRE understands.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
Ibm.com /redbooks © Copyright IBM Corp All rights reserved. WP07 ITSO iSeries Technical Forum WebSphere Portal Express– Installation, Configuration.
Live and Learn – ant. Resources  Ant User Manual  Skip the book, most of the material is right here  Apache.
Chapter 3 Understanding Ant datatypes and properties.
Overview of the Automated Build & Deployment Process Johnita Beasley Tuesday, April 29, 2008.
Software Development COMP220/COMP285 Seb Coope Introducing Ant These slides are mainly based on “Java Development with Ant” - E. Hatcher & S.Loughran.
1 Chapter Overview Managing Object and Container Permissions Locating and Moving Active Directory Objects Delegating Control Troubleshooting Active Directory.
Chapter 1 Introducing Ant. What is ant? Ant is a build tool  Automate the tasks of compiling code, running test, and packaging the results for redistribution.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
Hyperion Artifact Life Cycle Management Agenda  Overview  Demo  Tips & Tricks  Takeaways  Queries.
Build Tools 1. Building a program for a large project is usually managed by a build tool that controls the various steps involved. These steps may include:
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Interactions & Automations
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
Active-HDL Server Farm Course 11. All materials updated on: September 30, 2004 Outline 1.Introduction 2.Advantages 3.Requirements 4.Installation 5.Architecture.
Using Ant in Eclipse Dwight Deugo Nesa Matic
Software Development Tools COMP220 Seb Coope Ant: Datatypes and Properties These slides are mainly based on “Java Development with Ant” - E. Hatcher &
SG Introduction to ANT scmGalaxy Author: Rajesh Kumar
Software Development Tools COMP220 Seb Coope Ant: Datatypes and Properties These slides are mainly based on “Java Development with Ant” - E. Hatcher &
An Introduction to Ant. What is Ant? How do you use it? Why would you want to?
Ant Presented by: Mindaugas Idzelis Tatum Krawczyk.
SQL Database Management
Build and Test system for FairRoot
Compilers, Make and SubVersion
Nilanjan Banerjee Java Packages Ant CVS Project Submission
Intro to PHP.
Presentation transcript:

CSC 395 – Software Engineering Lecture 24: Apache Ant –or– Programming the results of programming Based upon a talk by Anthony Wat

In This Lecture Provide overview of using Apache Ant What does Ant do? How do we use it? Why should I care?

Ant in a Nutshell Java-based build tool Uses scripts to automate large processes Enables multiplatform actions Useful aspect of Java-based implementation Scripts must be written to take advantage Many built-in tasks available Javac, Copy, Delete, etc. Can write & import additional tasks

Sample Build Script

Properties Name-value pair used like variables in scripts Many ways of defining/importing Some properties automatically available basedir ant.file ant.version ant.project.name ant.java.version

Define In External File File written in plain text (usually XYZ.properties) Specify in file using name=value Example: bin.dir=${basedir}/bin HelloWorldStr=Hello world. Load file using task: Example:

Define Properties Other Ways Use name & value attributes of Example: Specify in command that calls Ant Example: ant -Ddate=050206

Using Properties Syntax similar to UNIX environment variables Examples: First line could do 1 of 2 things If HelloWorldStr defined, then ${HelloWorldStr} replaced by its value Otherwise, prints literal value “${HelloWorldStr}”

Caution! Characters must escaped in properties files Must escape ‘\’ in Windows-based directories: C:\tmp is bad (\t replaced to become “C:mp”) C:\\tmp is good Do NOT escape ‘\’ inside build script, but instead escape XML characters (e.g. ‘<’ becomes <) Properties like final variable in Java Once defined, cannot easily modify values

Filesets A fundamental structures in Ant Define rules including and/or excluding files: Include only.java files in build directory Delete backup files generated by a program Copy only files specified in a list

Using Filesets in Ant Use to delete.bak files: or Can often nest multiple

Implicit Filesets Some tasks define implicit filesets Include,, Treat task like genuine To compile Ant’s Java files:

Chaining Scripts Usually not necessary task calls another script Example: Runs Ant script named other.xml Called script inherits all defined properties New script can also define new properties Enables combining individual projects into single larger project

Helper Target Helper targets used like a method Can be called using different parameters task used to call targets Specify parameters using can also override global properties Initially set a default message globally Use to override message when needed

Helper Target (cont.) …

Building With Ant Run single script to build end-to-end Can also make daily builds Schedule daily builds to run automatically Send s when build available Send s whenever submission breaks build

One-Step Build Process Ant provides a lot of useful tasks: check out and update repository & rearrange files & compile and run Java programs executes program from command-line But this will be specific to the system and OS & helps package software Also provides ability to write your own tasks!

One-Step Build Process (cont.) Should be enough for end-to-end build Can fit everything into build.xml script Default name for Ant script Otherwise must use -buildfile parameter to run script Start build by running Ant Uses ant or ant.bat in ant\bin directory

Build Notification Send as part of build script sends Today’s build is done

Build Notification – Mail Logger Another way is to use the mail logger org.apache.tools.ant.listener.MailLogger Call Ant using the -logger option to specify the logger Example: ant -logger org.apache.tools.ant.listener.MailLogger –DMailLogger.properties.file=mail.properties All of the required properties for the mail logger (SMTP, addresses, etc.) are defined in mail.properties

Build Notification – Mail Logger (cont.) Instead of piping output to console, it will be cached and sent as when the build finishes successfully or fails The logs can be sent to developers Schedule Ant builds with cron (UNIX) or Task Scheduler (Windows)

Summary We’ve looked at: Properties and filesets Multiple build scripts and helper targets, which provide better maintainability of build scripts How to achieve one-step automated build process using Ant Ant is used everywhere – from open source projects to commercial software projects A good skill to have

For Next Lecture Read about SCM Change is inevitable SCM looks to control the results of changes that occur