What Stefan said is perfectly true - his point ( if I understand corectly ) was that the top level tasks will be executed: - on -projecthelp - if an invalid command is given ( like a wrong target name ).
In both cases the 'expected' behavior is to list the targets and report an error, not to execute the top level tasks ( you may have a <javac> there ). But I think what we should fix is -projecthelp and make clear that whatever is at top level will be executed after the xml file is read, regardless of the target name to be executed. ( in particular the target may be from an <imported> file ). And we should recommend that only 'initialization' tasks should be at top level - however I don't think we should enforce this too strongly, toplevel tasks is a valid use case and we shouldn't let '-projecthelp' drive the semantics of the build.xml file. Costin On Wed, 24 Jul 2002, Magesh Umasankar wrote: > > -<project> > > +<project default="foo"> > > <echo message="Called" /> > > + <target name="foo" /> > > </project> > > This doesn't make sense to me. Why force one > to define an empty target, assuming there is > consensus to allow tasks to exist outside > targets? Is it because we want to make > sure that <target> *is* the entry point, > whether it does something or not? > > In the above example, what will happen if > I invoke: > > ant xyz > > Will the <echo> task be invoked or not? > > Cheers, > Magesh > > PS: I did read the target-less thread. > > ************************************************ > * Criminal: A guy no different from the rest * > * ...except that he got caught. * > ************************************************ > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
