18
Visual Ant Editor Ximing Yu 12/04/2008

Visual Ant Editor

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Visual Ant EditorXiming Yu

12/04/2008

What is Ant?Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make’s wrinkle.

Ant is extended using Java classes and 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.

What can Ant do?

Ant can get source code from CVS, SVN, CC.

Ant can compile source code.

Ant can run unit tests and generate report.

Ant can package compiled code and resources to jars, wars, ears, whatever.

Ant can be extended to do other specific tasks.

How to use Ant?

Place the build.xml file in project root folder.

In cmd or bash, go to the project root folder and type: “ant”

What is build.xml?

Why a Visual Ant Editor?

It is hard to remember all the task names.

It is even harder to remember all the attributes of each task.

A visual editor makes it easier to figure out the dependency among targets.

Metamodel

An easier interpretation

A build file corresponds to a “project”

A “project” contains several “targets”

A “target” contains several “tasks”

There’s dependency among “targets”

There’s underlying dependency among “tasks”

Quiz: What’s this?

Answer: Directed Acyclic Graph (DAG)

Topological Sort

Definition: An ordering of the vertices such that each vertex comes before all vertices it has edges to.

Think of taking a course. The prerequisite of ECE 505 is ECE 373. So one is supposed to take ECE 373 first.

Algorithm for sorting

Indegree: The number of edges to a vertex.

Algorithm:

1. Pop out vertices with indegree 0

2.Adjust the indegree of vertices remained

3.Go to phase 1 there’s still vertex remained

New problem

Now we have the algorithm to sort vertices in a DAG. But what we are to sort are MgaModel objects. How to solve it?

Adapter Pattern

Recommendation

Book:

Design Patterns: Elements of Reusable Object-Oriented Software

by “Gang of Four”

Demonstration

Questions to solve

Constraints

Auto generation of metamodel

Deal with possible extensions of Ant

Questions?