Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 41936 invoked from network); 25 Apr 2006 19:57:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Apr 2006 19:57:36 -0000 Received: (qmail 36006 invoked by uid 500); 25 Apr 2006 19:57:25 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 35936 invoked by uid 500); 25 Apr 2006 19:57:24 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 35899 invoked by uid 99); 25 Apr 2006 19:57:24 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Apr 2006 12:57:24 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of Andrew.Goodnough@wicourts.gov designates 165.219.244.99 as permitted sender) Received: from [165.219.244.99] (HELO gwmta.wicourts.gov) (165.219.244.99) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Apr 2006 12:57:23 -0700 Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Tue, 25 Apr 2006 14:57:03 -0500 Message-Id: <444E38B7.954F.0081.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Beta Date: Tue, 25 Apr 2006 14:56:55 -0500 From: "Andrew Goodnough" To: "Ant Users List" Subject: Re: Building from a list... References: <444E0B4A.954F.0081.0@wicourts.gov> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N >>> On Tue, Apr 25, 2006 at 12:52 pm, in message , "Andrew Close" wrote: > On 4/25/06, Andrew Goodnough wrote: >> >>> On Tue, Apr 25, 2006 at 11:13 am, in message >> , "Andrew >> Close" >> wrote: >> > hello, >> > >> > i'm having a bit of a brain- fart coming up with a solution to this >> > situation. we have about 130 JAR files that we are building for a >> > particular project. most of these JARs are dependent on each other >> so >> > they require a specific build order. i was hoping to create a list >> of >> > the projects that compose each JAR and feed this list to ANT to >> build >> > one at a time. i know the Ant- Contrib project has a tag >> > that allows for iteration, but i'm a bit stumped on how to build >> > everything from a properties file. is this possible? or is there a >> > better way to approach this? >> > >> > we're using VSS as source control and have several projects that are >> > composed of several (130+) products/JARs in VSS. so i'd like to >> make >> > a list of Project.Product that i can iterate through and >> > build/JAR/deploy in order. >> > so in VSS we may have Project1 that contains ProductA, ProductB & >> > ProductC and Project2 that contains ProductD & ProductE and Project3 >> > that contains ProductF, ProductG & ProductH. the build order may >> end >> > up being: >> > ProductB, ProductG, ProductA, ProductC, ProductD, ProductF, >> ProductE... >> > so my initial idea was to create a master list that contains these >> > products in their proper build order: >> > Project1.ProductB >> > Project3.ProductG >> > Project1.ProductA >> > Project1.ProductC >> > Project2.ProductD >> > Project3.ProductF >> > Project2.ProductE >> > >> > our ANT build file is currently set up to build products >> individually. >> > so typically we'd pass in the ProjectName, ProductName, Branch, >> > DeliverableType and DeploymentDest to build one product/JAR/etc. to >> > build all applications (build world) we have to either type this in >> > manually 130+ times or we use a .bat file that makes 130+ calls. >> the >> > problem with the .bat file is that if product 15 fails a bunch of >> > builds that follow will fail due to dependency. there is no good >> way >> > to stop the build process on error. so i was hoping ANT would be >> able >> > to come to the rescue. :) >> > hopefully this is enough background to either come up with a >> solution >> > or generate some discussion that will lead to a solution. >> > thanks for any help you can offer. >> > >> > >> --------------------------------------------------------------------- >> > To unsubscribe, e- mail: user- unsubscribe@ant.apache.org >> > For additional commands, e- mail: user- help@ant.apache.org >> >> We have a large amount of projects with interdependencies, too. Our >> process sets up a set of files (with pre- defined names) which allow the >> project owner to configure dependencies, including triggering >> sub- builds, in any. First, here's how the classpath is setup for the >> compile. The "includesfile" property includes from the files. >> >> >> >> >> > includesfile="${sharedjars.depend.file}"/> >> >> >> A typical jars.depend file looks like this: >> >> ===jars.depend=== >> xml- apis.jar >> xerces- 2_0_1.jar >> xalan- j_2_3_1.jar >> ============= >> >> and >> >> ===classes.depend=== >> Global- Utils/build/classes >> Parent- Proj/build/classes >> =============== >> >> >> Second, if in addition to including the classes from Global- Utils and >> Parent- Proj, you want this project to build both projects before >> building itself, then have your compile target depend on sub- compile >> target like: >> >> >> >> >> >> >> >> > description="Compiles the source files"> >> > destdir="${build.classes}"> >> >> >> >> >> >> where you put the 2 projects in the projects.depend: >> >> ===projects.depend=== >> Global- Utils >> Parent- Proj >> =============== >> >> >> Each project must have standard target names to use this scheme, but it >> scales well. We use Entity references to gain a type of inheritance in >> Ant to reuse common targets but that's another topic. Good luck! > > > Andy, > > thanks for your reply. > so do you have a single task/target that you kick off that builds > everything for you? would i end up with 130+ individual targets > that depend on each other in your scenario? > i.e: > > > > > > > > > > > > > > > > > > this scenario is what i was hoping to avoid by building a list of > projects to be build in the correct order. maybe i'm missing > something though... > > --------------------------------------------------------------------- > To unsubscribe, e- mail: user- unsubscribe@ant.apache.org > For additional commands, e- mail: user- help@ant.apache.org Yeah, I forgot that part of what you were looking for. The closest I've come is this, using a separate "branch-build" file located at the root of your local workspace (same level with the projects): ===branch-build.xml=== ....etc.... ..etc.. ================================== now I can issue the command: ant -f branch-build.xml compile jar You only have to maintain one main list of projects. You might be able to get this into an external file, too. So, if you set up the dependencies on a per project basis (from previous email) all dependencies will be satisfied. Because this branch-build.xml file calls project builds in order, many popular dependent projects will get called multiple times. This is not horrible (unless you call clean on every project) because each project will only have to compile once. Andy --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org