Yeah i thought of that too, though it isn't that clear for users that has been using ant earlier and got a list of targets.
But I guess that's the last out come. Thanks! -----Original Message----- From: lt...@talk21.com [mailto:lt...@talk21.com] Sent: den 15 december 2010 09:55 To: Ant Users List Subject: Re: Fixed default target How about treating 'target' as command parameter, then do recursive ant call using param as target. Sent from my BlackBerry(r) wireless device -----Original Message----- From: "Roos Tomas" <tomas.r...@mpsbroadband.com> Date: Wed, 15 Dec 2010 09:48:31 To: Ant Users List<user@ant.apache.org> Reply-To: "Ant Users List" <user@ant.apache.org> Subject: RE: Fixed default target Well the thing is we have a multi build file system and in the root i just want to relay the targets that were chosen by the commandline down to root\module\build.xml. But the thing it is not possible to get the ${ant.project.invoked-targets} before entering a target, which you mentioned. Therefore it isn't possible to invoke with subant in an initializer. So I guess there is no workaround for this ? Tomas -----Original Message----- From: David Weintraub [mailto:qazw...@gmail.com] Sent: den 14 december 2010 14:45 To: Ant Users List Subject: Re: Fixed default target On Tue, Dec 14, 2010 at 3:47 AM, Roos Tomas <tomas.r...@mpsbroadband.com> wrote: > I'm wondering if it's possible to have a fixed default target, which > always executes instead of what's put on the command-line? > > The reason for this is we use the depends feature of ant to be able to > for instance publish to an ivy repository with a better flow. ant > local milestone publish. You could start all of the other target names with dashes. This makes them impossible to execute on the command line. It's a common tactic to make internal targets start with a dash for this reason. If this is for initialization purposes, you can have non-targeted tasks at the beginning of your Ant build.xml file. All of those tasks will be executed no matter what target is selected. Unfortunately, you can't use the "Ant" or "Antcall" task in this section. These will only be executed if they're inside of an Ant target. Otherwise, you could put these as part of the preliminary stuff and prevent people from executing other tasks directly. If you need to hit a preliminary task, you can make all other tasks in your Antfile depend upon that task. This request is a bit "unusual" because you're basically preventing the developer from using Ant to its fullest. -- David Weintraub qazw...@gmail.com --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org