Hi! Thank you for your help, even though I don't know how it helps me since my problem is kind of different then the one your solution solves.
So let me clarify the problem. I'm trying to solv the problem that results in that a build file with more then one target with the same name results in a error in Ant. This prohibits the build designer (like me) to create a standard build file with solutions for the default targets (i.e. compile, jar, build and so on) and include this in all project. Since if the compile target for one of all the projects (in my case about 80) differs from the "normal" compile target all "normal" targets would have to be written in this specific build file. So the result for this is that the overhead work to change a task increases a lot for every " special" case. Any good ideas for how to solv this is apprichiated.... /Christian > -----Ursprungligt meddelande----- > Fr�n: Shackelford, John-Mason [mailto:[EMAIL PROTECTED]] > Skickat: den 17 september 2002 16:10 > Till: 'Ant Users List' > �mne: RE: Overload?! > > > Christian, > > You are on the right track. The only reason you have a > problem is that you > include the target twice in build1.xml and build2.xml. > > I use a similar approach to manage build files for a project > with multiple > versions. Use one entity (your include.xml) for targets common across > versions and another set of entities for the targets that are version > specific. Then write a build-1.xml and build-2.xml, > build-3.xml, etc.for > each version doing two entity includes in each: one for > common targets, and > another for version specific targets. You can then launch ant > using the > -buildfile option or write your own ant runner to make the > switch for you on > the basis of a property file. (I have enclosed an example.) > > John-Mason Shackelford > > Software Developer > NCS Pearson - Measurement Services > 2510 North Dodge St. > Iowa City, IA 52245 > 319-354-9200x6214 > [EMAIL PROTECTED] > > > > -----Original Message----- > From: Christian Holmqvist, IT, Posten > [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, September 17, 2002 4:53 AM > To: 'Ant Users List' > Subject: Overload?! > > > Hi > > My situation is that I have made a include.xml file with a > number of targets > that is correct for 95% of our projects. The problem is the last 5%. > > So my question is: Is there any way to overload a target with Ant? > > This is how I would like it to work: > > ---- include.xml -------- > > <target name="compile"> > <echo message="foo"/> > </target> > > ---- build.xml ---- > > <!DOCTYPE project [ > <!ENTITY include SYSTEM "file:./include.xml"> > ]> > > <project name="test" default="compile" basedir="."> > &include; > </project> > <!-- in this file the compile in include.xml will be executed --> > > ----- build1.xml ----- > > <!DOCTYPE project [ > <!ENTITY include SYSTEM "file:./include.xml"> > ]> > > <project name="test" default="compile" basedir="."> > &include; > > <target name="compile"> > <echo message="bar"/> > </target> > </project> > <!-- in this file the compile in include.xml will be executed --> > > ------- build2.xml -------------- > <!DOCTYPE project [ > <!ENTITY include SYSTEM "file:./include.xml"> > ]> > > <project name="test" default="compile" basedir="."> > <target name="compile" > <echo message="bar"/> > </target> > > &include; > </project> > <!-- in this file the compile in build2.xml will be executed --> > -------------------------------------- > > When this is done today ant tells med that compile is duplicated (or > something like that). > > Is there a way around this?? > > Thanks for your time! > > Cheers Christian > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > ************************************************************** > ************** > This email may contain confidential material. > If you were not an intended recipient, > Please notify the sender and delete all copies. > We may monitor email to and from our network. > ************************************************************** > ************** > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
