Henrik Bærbak Christensen1 Build Management Clean environment that works...

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 4 Writing Java Applications, Java Development Tools.
Advertisements

Introduction to Java 2 Programming Lecture 3 Writing Java Applications, Java Development Tools.
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Packages Sudhir Talasila Preeti Navale. Introduction Packages are nothing more than the way we organize files into different directories according to.
•7/12 /07 F-1 © 2010 T. Horton CS 4240 Principles of SW Design Packages in Java and UML.
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.
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.
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.
DAIMI(c) Henrik Bærbak Christensen1 JUnit A tool for test case management.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
1 Chapter 3 Programs and Packages. 2 Java Virtual Machine (JVM) Java programs execute on the JVM. The JVM is a virtual rather than a physical machine,
Unit 051 Packages What is a Package? Why use Packages? Creating a Package Naming a Package Using Package Members Managing Source and Class Files Visibility.
Applying OO Concepts Using Java. In this class, we will cover: Overriding a method Overloading a method Constructors Mutator and accessor methods The.
Using Ant to build J2EE Applications Kumar
Introduction to ant Guy Rixon AstroGrid Consortium Meeting
Java™ How to Program, 9/e © Copyright by Pearson Education, Inc. All Rights Reserved.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA ‏ Packages.
Maven & Bamboo CONTINUOUS INTEGRATION. QA in a large organization In a large organization that manages over 100 applications and over 20 developers, implementing.
A Simplified Approach to Web Service Development Peter Kelly Paul Coddington Andrew Wendelborn.
Apache Ant Java-Based Build Tool. Making your builds boring… Building projects should be easy and standardized. You should not be spending a substantial.
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat
Dale Roberts Object Oriented Programming using Java - Packages Dale Roberts, Lecturer Computer Science, IUPUI Department.
© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures for Java William H. Ford William R. Topp Appendix E The EZJava.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
July 2011CMSC 341 CVS/Ant 1 CMSC 341 Java Packages Ant CVS Project Submission.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Java programming Package. A package is a group of similar types of classes, interfaces and sub-packages. Package can be categorized in two form, built-
4/1/05F-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Packages and Components in Java and UML.
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.
1 JAVA API & Packages Starring: Java Documentation Co-Starring: BlueJ IDE.
Programmeren 1 6 september 2010 HOORCOLLEGE 2: INTERACTIE EN CONDITIES PROGRAMMEREN 1 6 SEPTEMBER 2009 Software Systems - Programming1 Programming.
Distributed Java Programming Build Management  A repeatable build management process allows you to integrate the development efforts of your team.
9.1 Java Packages A collection of classes Allows classes to be grouped arbitrarily Hierarchical structure independent of inheritance Classes can.
Summing Up Object Oriented Design. Four Major Components: Abstraction modeling real-life entities by essential information only Encapsulation clustering.
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.
22-July-2002cse142-13B-Development © 2002 University of Washington1 Development Tools CSE 142, Summer 2002 Computer Programming 1
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.
KING SAUD UNIVERSITY – COLLAGE OF COMPUTER AND INFORMATION SCIENCES CSC 113 JAVA ONLINE DOCUMENTATION.
Building Packages BCIS 3680 Enterprise Programming.
HotCiv Project Starting up!. Henrik Bærbak Christensen2 HotCiv = Agile development Iterations of –product development –learning increments.
All the dSoftArk Tools Getting started!. Tools dSoftArk is a semi-realistic, agile, development project –Industrial strength software (programming, TDD,
Packages. Access Specifications Public Available anywhere (public keyword) Only one public class per file allowed Protected Available in subclasses, and.
CSI 3125, Preliminaries, page 1 Packages. CSI 3125, Preliminaries, page 2 Packages Packages are containers for classes Collection of classes Packages.
Refactoring and Integration Testing or Strategy, introduced reliably by TDD The power of automated tests.
Working with Packages BCIS 3680 Enterprise Programming.
Java Package Advantage of Java Package
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
SG Introduction to ANT scmGalaxy Author: Rajesh Kumar
Software Development COMP220 Seb Coope Ant: Structured Build These slides are mainly based on “Java Development with Ant” - E. Hatcher & S.Loughran. Manning.
Java Packages - allow you to group classes as a collection Standard Java library has packages: java.lang and java.util … Also hierarchical: java and javax.
Java Interview Questions
Packages When we name a program , we name it by class name…
HotCiv Project Starting up!.
Java Basics Packages.
Ant.
Packages and Interfaces
From C++ to Java Java history: Oak, toaster-ovens, internet language, panacea What it is O-O language, not a hybrid (cf. C++) compiled to byte-code, executed.
Nilanjan Banerjee Java Packages Ant CVS Project Submission
Software Engineering and Architecture
Software Engineering and Architecture
Software Engineering and Architecture
Presentation transcript:

Henrik Bærbak Christensen1 Build Management Clean environment that works...

Henrik Bærbak Christensen2 Motivation Sun provides Java SDK free of charge –provides standard command line tools: javac, java,... These are sufficient only for very small systems –javac only compile one directory at a time –javac recompiles everything everytime Large systems require many tasks –manage resources (graphics, sound, config files) –deployment (making jars, copying files) –management (javadoc, coverage, version control)

Henrik Bærbak Christensen3 Build-Management This problem is denoted: Computer Scientists’ standard solution: a tool... The tool read a build-description Example: Make (Feldmann, 1979)

Henrik Bærbak Christensen4 Script Parts

Henrik Bærbak Christensen5 Exercise I want to run my Java system that is made of 500 sources files –target? –dependencies? –procedure? –properties?

Henrik Bærbak Christensen6 Apache Ant Ant is a young build-management tool geared towards Java – has some strong build-in behaviour javac on source trees and does smart recompile – independent of large IDEs easy for TA to unzip your submission and test it –  on the XML buzzword wave so it is verbose

Pay Station using Ant

Henrik Bærbak Christensen8 The TDD again In my mind, TDD’s principles can be applied more widely than just developing code. Basically I want a refactoring process –from a windows.BAT development environment –to an Ant based development environment –... but the external behaviour is the same: compile it, test it

Henrik Bærbak Christensen9 Test List I start out (of course) with the test list

Java Packages... in a minute or two...

Henrik Bærbak Christensen11 Abstraction Abstraction is the most important principle in computer science –lower cognitive load on our poor mind by –hide large amounts of details behind meaningful named entities Examples: –method (name a large and complex set of statements) –class (name a large and complex set of methods)

Henrik Bærbak Christensen12 Package The Java package is the next level above classes. Definition: A package is a collection of related classes and interfaces providing access protection and namespace management.

Henrik Bærbak Christensen13 Declaration A class declares that it belongs to a package by a statement: package myPackage; public class mySuperDuperClass { … } Pretty weird! Compare C# –namespace myPackage { class... }

Henrik Bærbak Christensen14 Access To use a class in a package you must either –qualify its name completely (package names are part of the class name) java.util.List l = new java.util.ArrayList(); –or once and for all import the class import java.util.List; import java.util.ArrayList; –or get all the classes import java.util.*;

Henrik Bærbak Christensen15 Physical Structure Java is peculiar in that it insists on a one-to-one match between package structure and physical storage structure of the binary.class files: –java.util.List –must be stored in a directory structure –(something)/java/util/List.class –(something)/java/util/List.java I like the correspondence as it helps me locate the source files!

Henrik Bærbak Christensen16 Classpath You must tell where the compiler and JVM must start searching for the files: –(something)/java/util/List.class The CLASSPATH tells where ‘something’ is. –javac –classpath src;lib\myutil.jar myclass.java –means: search in folder ‘src’ and in the named jar file. jar files are simply zip archives that obey the folder hierarchical structure.

Iteration 1 Packages

Henrik Bærbak Christensen18 Pay Station [iteration-1 in chapter/build-management in the FSE source code zip]

Iteration 2 Make a compile target

Henrik Bærbak Christensen20 Hitting Ant Take small steps! Target Procedure

Henrik Bærbak Christensen21 javac task javac does –recursive descent in full source code tree –smart compilation

Henrik Bærbak Christensen22 Smart Compilation

Iteration 3 Running the tests

Henrik Bærbak Christensen24 java task

Iteration 4 Split Build Tree

Henrik Bærbak Christensen26 Avoid pollution I like to keep things separate! –source code trees should not contain.class files

Henrik Bærbak Christensen27 Dependencies It however fails because no ‘build’ directory exists. Let us resolve that using a prepare target.

Henrik Bærbak Christensen28 Refactoring Refactor to clean up! –‘build’ as string literal all over the place (I think build-tools compete to introduce really weird syntax!!!)

Henrik Bærbak Christensen29 Cleaning up classpath

Iteration 6 Split production and test tree

Henrik Bærbak Christensen31 Splitting the trees Advantages –Make javadoc without refering to unit test –Make jar of production code without unit test

Henrik Bærbak Christensen32 Require New Task Have to build the test tree as well

Summary

Henrik Bærbak Christensen34 Summary Build-management automates many ‘house- hold’ tasks Build-management = tool + build script Build scripts are documentation! –tell me how to run servers and clients even when names and topologies have changed as long as we agree on the task names, like “run-server”