Presentation is loading. Please wait.

Presentation is loading. Please wait.

Austin Java Users Group 2005-Feb-22 Presented by Matt Albrecht.

Similar presentations


Presentation on theme: "Austin Java Users Group 2005-Feb-22 Presented by Matt Albrecht."— Presentation transcript:

1 Austin Java Users Group 2005-Feb-22 Presented by Matt Albrecht

2 Quick Overview Helps organize libraries and inter- project dependencies in Ant build scripts. Requires Ant 1.6+, JDK 1.2+ Hosted on Sourceforge: http://antlion.sf.net http://antlion.sf.net Apache 2.0 License

3 Problem: Dependencies Build relies on external libraries, which need definitions in Ant: Properties Filesets Paths

4 Solutions Add and manage each type by hand. Wait for Ant 1.7, which has limited library support Use one of several Ant toolkits which gives Maven-like support

5 Solution in Antlion Antlion gives you: User-defined library repository structure Local and remote repositories Configurable generation of Ant references and properties Shorthand notation to keep builds simple and easy to read

6 Quick Look Define a policy for repository setup, library entry meta-data, and what to do with Ant. Declare library groups and their entries.

7 Policies - Repositories <format text= “[prj]/[version]/[name]-[version].[type]” /> <format text= “[prj]/[version]/[prj]-[version].[type]” /> <format text= “[prj]/[version]/[prj].[type]” />

8 Policies – Remote repositories <urlrepository cachedir=“${cache}” remote=“ftp://internal/repository” format=“[prj]/[name]-[version].[type]” />

9 Policies – Working with Libs <version-check versionAttribute=“version” matchAttributes=“prj, name, type” />

10 Policies – Populating Ant

11 Defining Libraries <library id=“lib.xerces” prj=“xerces” version=“2.6.2”>

12 Defining Libraries

13 Using the Libraries ${lib.xerces.xercesImpl}

14 Problem: Inter-build depends The build is divided into several “ modules, ” each with their own set of output files, called “ artifacts. ” Some modules depend upon other modules to be built. Dependencies upon dependencies. Build depends only when needed.

15 Solutions Hand code dependency building. Using ant-contrib with macrodefs can give you build-if-not-up-to-date functionality, but it can be tricky. Add paths within paths, but doesn ’ t scale to filesets.

16 Solution in Antlion defines an output of a build, the build file target, and can include all of its dependencies. file references are relative to the file containing the tag, not basedir. This makes it easy to import artifacts. can be added to a. allows for constructing targets with the correct should-build logic.

17 Quick Look: artifacts.xml <artifact id=“mybuild.jar” target=“jar” artifact=“export/mybuild.jar”>

18 Referencing Other Builds <subprojects UseArtifactTarget=“false” prefix=“SUB”> <project name=“module” targets=“main” antfile=“module/build.xml” /> <target name=“all” depends=“SUB::module::main, SUB::mybuild.jar”/>

19 Using Artifacts in Libraries <dependencies type=“build” artifactRefId=“mybuild.jar” />

20 Summary Antlion helps you: Get your libraries organized, and let the tool do the dirty work for you. Simplify management of inter-project dependencies.


Download ppt "Austin Java Users Group 2005-Feb-22 Presented by Matt Albrecht."

Similar presentations


Ads by Google