The Artima Developer Community
Sponsored Link

Java Buzz Forum
Implementing Modular Build Systems

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
dion

Posts: 5028
Nickname: dion
Registered: Feb, 2003

Dion Almaer is the Editor-in-Chief for TheServerSide.com, and is an enterprise Java evangelist
Implementing Modular Build Systems Posted: Sep 8, 2004 12:48 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by dion.
Original Post: Implementing Modular Build Systems
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)

Advertisement
We definitely don't seem to talk too much about build systems, which is something that all software developers have to deal with. I am working on a project at the moment that really needs a nice modular design. The goal is to have a central driver build file, which passes on sub builds to submissions which match a given interface. In the Java world, we could have a nice interface, submissions would just implement that interface, and a Factory would be able to instantiate them and delegate over. However, if you are working with something like Ant how can you get this done? With Ant 1.6 we have more tools available: Using "subant": <target name="build"> <subant target="build"> <fileset dir="."> <file name="${subA}/build.xml"/> <file name="${subB}/build.xml"/> ... </fileset> </subant> </target> Macro's: <macrodef name="deploy"> <attribute name="descriptor"/> <attribute name="destfile"/> <attribute name="infiles"/> <sequential> <jar destfile="@{destfile}" webxml="@{descriptor}"> <lib refid="support-libraries"/> <lib file="${jar.name}"/> <fileset dir="@{infiles}"/> </jar> </sequential> </macrodef> Import: The new import task allows us to seperate out our build.xml files nicely (nicer than using XML entities!) Groovy Everything seems like a hack though. Maybe it would be nicer to use Groovy+Ant: ant = new AntBuilder() // lets just call one task ant.echo("hello") // here"s an example of a block of Ant inside GroovyMarkup ant.sequential { echo("inside sequential") myDir = "target/AntTest/" mkdir(dir:myDir) copy(todir:myDir) { fileset(dir:"src/test") { include(name:"**/*.groovy") } } echo("done") } If we use Groovy, then we can create a nice object model, with interfaces, and abstract methods which "do the default thing". Then a new module would just extend the base and override anything that it needs. Have you run into any nice clean solutions with Ant itself? Or something else?

Read: Implementing Modular Build Systems

Topic: Acronym Anarchy Previous Topic   Next Topic Topic: The Joy of Bombast

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use