Nilanjan Banerjee Java Packages Ant CVS Project Submission

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

Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
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.
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,
CSC 395 – Software Engineering Lecture 24: Apache Ant –or– Programming the results of programming Based upon a talk by Anthony Wat.
Object-Oriented Enterprise Application Development Javadoc Last Updated: 06/30/2001.
Winter 2005Jason Prideaux1 Apache ANT A platform independent build tool for Java programs.
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.
Introduction to Ant- a framework example Amit Shabtay.
Automating the Build Process using ANT SE-2030 Dr. Mark L. Hornick 1.
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
CMSC 341 – Data Structures Spring 2012 University of Maryland, Baltimore County ANT, CVS and CVS Utilities Slides prepared by Prajit Kumar Das – Summarized.
Automating the Build Process using Ant SE-2030 Dr. Rob Hasker 1 Based on material by Dr. Mark L. Hornick.
Apache Ant Java-Based Build Tool. Making your builds boring… Building projects should be easy and standardized. You should not be spending a substantial.
Apache Ant A gateway to test-driven Java development.
Ant Build Tools.  Creating a product from source may take several steps: Compile Link Copy files to various directories Remove intermediate files Generate.
Git workflow and basic commands By: Anuj Sharma. Why git? Git is a distributed revision control system with an emphasis on speed, data integrity, and.
July 2011CMSC 341 CVS/Ant 1 CMSC 341 Java Packages Ant CVS Project Submission.
ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150.
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.
Distributed Java Programming Build Management  A repeatable build management process allows you to integrate the development efforts of your team.
Chapter 3 Understanding Ant datatypes and properties.
Software Development COMP220/COMP285 Seb Coope Introducing Ant These slides are mainly based on “Java Development with Ant” - E. Hatcher & S.Loughran.
CMSC 341 Java Packages, Classes, Variables, Expressions, Flow Control, and Exceptions.
Tools – Ant-MakeEtc 1 CSCE 747 Fall 2013 CSCE 747 Software Testing and Quality Assurance Tools 12 – Hamcrest 10/02/
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.
Henrik Bærbak Christensen1 Build Management Clean environment that works...
Ant / continuous integration. Turning Client Vision into Results 2 Outline presentation Introduction Ant –History –Concepts –Tasks –Examples –Extending.
All the dSoftArk Tools Getting started!. Tools dSoftArk is a semi-realistic, agile, development project –Industrial strength software (programming, TDD,
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
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:
(1) Code Walkthrough robocode-pmj-dacruzer Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of.
Brandon Packard. Why make? So far, you have probably worked on relatively small projects Coding projects can become huge My research consists of 1600.
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
RTLAB Real-Time System Build automation School of Electronics Engineering College of IT Engineering Kyungpook National University Jun Sang ho (Rm) IT1-501.
Using Ant in Eclipse Dwight Deugo Nesa Matic
July 2011UMBC CMSC 341 Intro 1 CMSC 341 Course Introduction.
SG Introduction to ANT scmGalaxy Author: Rajesh Kumar
An Introduction to Ant. What is Ant? How do you use it? Why would you want to?
Ant Presented by: Mindaugas Idzelis Tatum Krawczyk.
Advanced Topics in Concurrency and Reactive Programming: Build Tools
Doxygen.
NAnt Build Tool CSE784 : ProjectCentralNet Prof : Dr. Jim Fawcett
Introduction to Ant scmGalaxy Author: Rajesh Kumar
OFBiz Internals.
COMP220/COMP285 Seb Coope Ant: Structured Build
Brian Leonard ブライアン レオナルド
J2EE Application Development
Ant.
Summary: steps for Project 0 submission
CMSC 341 Course Introduction July 2011 UMBC CMSC 341 Intro.
< ant > nrg.
Overview Unit testing Building Version control.
Advanced Programming in Java
Summary: steps for Project 0 submission
Carthage ios 8 onwards Dependency manager that streamlines the process of integrating the libraries into the project.
Review of Previous Lesson
Software Engineering and Architecture
Presentation transcript:

Nilanjan Banerjee Java Packages Ant CVS Project Submission CMSC 341 Nilanjan Banerjee Java Packages Ant CVS Project Submission CMSC 341 CVS/Ant

Packages Java packages create libraries A group of classes organized together into a single namespace. Allows multiple classes with the same name MyPackage.Stack YourPackage.Stack CMSC 341 CVS/Ant

Packages A file may belong to only one package. Packages serve as a namespace in Java and create a directory hierarchy when compiled. Classes are placed in a package using the following syntax in the first line that is not a comment. package packagename; package packagename.subpackagename; CMSC 341 CVS/Ant

Multiple Stack Classes // My stack.java file package MyPackage; public class Stack { // … }; // Your stack.java file package YourPackage; public class Stack { // … }; CMSC 341 CVS/Ant

Packages (cont.) It is common practice to duplicate the package directory hierarchy in a directory named src and to compile to a directory named bin. Create this directory manually in your GL account Eclipse creates this directory structure for you Project1 proj1 src bin Example.java Example.class Package name Root of project directory tree The java compiler will build the directory hierarchy in the directory which you specify after the switch. Thus, in this example it is building the directory hierarchy in the ../bin directory. CMSC 341 CVS/Ant

What is Ant? Ant is a Java based tool for automating the build process Platform independent commands (works on Windows, Mac & Unix) XML based format Easily extendable using Java classes Ant is an open source (free) Apache project Ant files used in this course require the package directory structure described earlier Lets run through two examples CMSC 341 CVS/Ant

Anatomy of a Build File Ant’s build files are written in XML Convention is to call file build.xml Each build file contains A project At least 1 target Targets are composed of some number of tasks Build files may also contain properties Like macros in a make file Comments are within <!-- --> blocks CMSC 341 CVS/Ant

Projects The project tag is used to define the project to which the ANT file applies Projects tags typically contain 3 attributes name – a logical name for the project default – the default target to execute basedir – the base directory relative to which all operations are performed Additionally, a description for the project can be specified from within the project tag CMSC 341 CVS/Ant

Project tag <project name="Sample Project" default="compile" basedir="."> <description> A sample build file for this project Recall that “.” (dot) refers to the current directory </description> </project> CMSC 341 CVS/Ant

Properties Build files may contain constants (known as properties) to assign a value to a variable which can then be used throughout the project Makes maintaining large build files more manageable and easily changeable Projects can have a set of properties Property tags consist of a name/value pair Use the property names throughout the build file The value is substituted for the name when the build file is “executed” CMSC 341 CVS/Ant

Build File with Properties <project name="Sample Project" default="compile" basedir="."> <description> A sample build file for this project </description> <!-- global properties (constants) for this build file --> <property name="source.dir" location="src"/> <property name="build.dir" location="bin"/> <property name="doc.dir" location="doc"/> </project> CMSC 341 CVS/Ant

Tasks A task represents an action that needs execution Tasks have a variable number of attributes which are task dependant There are a number of built-in tasks, most of which are things which you would typically do as part of a build process mkdir - create a directory javac - compile java source code java - execute a Java .class file javadoc - run the javadoc tool over some files And many, many others… For a full list see: http://ant.apache.org/manual/tasksoverview.html CMSC 341 CVS/Ant

Targets The target tag has the following required attribute name – the logical name for a target Targets may also have optional attributes such as depends – a list of other target names for which this task is dependant upon, the specified task(s) get executed first description – a description of what a target does Targets in Ant can depend on some number of other targets For example, we might have a target to create a jarfile, which first depends upon another target to compile the code Targets contain a list of tasks to be executed CMSC 341 CVS/Ant

Build File with Targets <project name="Sample Project" default="compile" basedir="."> <!-- set up some directories used by this project --> <target name="init" description="setup project directories"> <!-- list of tasks to be executed --> </target> <!-- Compile the java code in src dir into build dir --> <target name="compile" depends="init" description="compile java sources"> <!-- Generate javadocs for current project into docs dir --> <target name="doc" depends="init" description="generate documentation"> <!-- Execute main in the specified class under ${build.dir} --> <target name=”run" depends=“compile” description=”run the application"> <!-- Delete the build & doc directories and Emacs backup (*~) files --> <target name="clean" description="tidy up the workspace"> </project> CMSC 341 CVS/Ant

Initialization Target & Tasks Our initialization target creates the build and documentation directories The mkdir task creates a directory <project name="Sample Project" default="compile" basedir="."> ... <!-- set up some directories used by this project --> <target name="init" description="setup project directories"> <mkdir dir="${build.dir}"/> <mkdir dir="${doc.dir}"/> </target> </project> CMSC 341 CVS/Ant

Compilation Target & Tasks Our compilation target will compile all java files in the source directory The javac task compiles sources into classes Note the dependence on the init task <project name="Sample Project" default="compile" basedir="."> ... <!-- Compile the java code in ${src.dir} into ${build.dir} --> <target name="compile" depends="init" description="compile java sources"> <javac srcdir="${source.dir}" destdir="${build.dir}"/> </target> </project> CMSC 341 CVS/Ant

Run Target & Tasks Our run target will execute main in the fully specified class Typically dependent on the compile task <project name="Sample Project" default="compile" basedir="."> ... <!-- Execute main in the fully qualified name under ${build.dir} --> <target name=”run" depends=”compile" description=“run the application"> <java directory=“${build.dir}” classname=“${main.class}” fork=“yes”> <arg line=“${args}” /> </java> </target> </project> July 2011 CMSC 341 CVS/Ant CMSC 341 CVS/Ant 17

Running Ant – Command Line Move into the directory which contains the build.xml file Type ant followed by the name of a target unix> ant run unix> ant compile Type ant at the unix prompt to run the project’s default target -- see screen shot on next page unix> ant CMSC 341 CVS/Ant

Ant screen snapshot CMSC 341 CVS/Ant

Project Submission Projects in this course will be submitted electronically and will not be using CVS as we did for the last incarnations of the course Lets see a demo of the submission system CMSC 341 CVS/Ant

What is CVS? Concurrent Versioning System (CVS) is one of the earlier SCM systems which gained wide adoption Open source Easy to install and use Simple command line client Wide integration in a lot of development tools Used for submitting projects in this course For good introduction on version control and CVS see the following book… Pragmatic Version Control using CVS CMSC 341 CVS/Ant

CVS Terminology Repository – the place where resources (files) are stored Checkout – copy resources from the repository and create a working copy Checkin/Commit – place resources from your working copy into the repository Add – place a resource under version control Remove – delete a resource from version control Update – pull down changes from the repository into your working copy Lets take an example CMSC 341 CVS/Ant

Take aways Compile your code using Ant Submit your projects using the submission system Be able to use CVS CMSC 341 CVS/Ant