ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: Problems with <import>
Date Fri, 19 Jul 2002 22:26:32 GMT

costinm@covalent.net wrote:
> On Fri, 19 Jul 2002, Nicola Ken Barozzi wrote:
> 
> 
>>I still prefer explicit <init> and <destroy> targets to be executed 
>>befor and after every build...
> 
> That's a bit orthogonal - whatever is at top level has allways been
> executed before anything else. 
> 
> If we add explicit init/destroy - different issue.

?

I mean that it's sensible to deprecate IMHO amy top-level task being 
run, and have them in <init>.

<project default="whatever">

  <init> <dothisBEFOREanytargeteverytime/> </init>

  <target name="whatever" depends="whatever2"> ... </target>
  <target name="whatever2"> ... </target>

  <destroy> <dothisAFTERanytargeteverytime/> </destroy>

</project>

Running the build will do:

dothisBEFOREanytargeteverytime
whatever2
whatever
dothisAFTERanytargeteverytime

now we would do:

<project default="destroy">

  <dothisBEFOREanytargeteverytime/>

  <target name="whatever" depends="whatever2"> ... </target>
  <target name="whatever2"> ... </target>
  <target name="destroy" depends="whatever">
        <dothisAFTERanytargeteverytime/> </target>

</project>

Which completely hides the semantics, since "destroy" is not 
conceptually what we want to run.

>>Anyway, I really cannot say anything of your solution, if not that 
>>making it a task makes more use-cases possible, and is cool.
>>Commit, man, lemme see the code :-)
> 
> 
> It is checked in ( proposals/sandbox/embed ). I also checked in a binary
> ( ant-sax2.jar ) - just place it in jakarta-ant-1.5/lib. 
> ( works with 1.6 as well ).

ok, cool :-)

> It works fine - except for the super, which I don't even understand.
> In your sample build.xml, mb2 depends on super.mb2. What does it
> means ??? 

in java:

class mybuild extends mybuild2
{
   public void mb2()
   {
     super();
     dostuff();
   }

...

>I would understand an imported file like build2,3,4.xml
> to refer to 'super.mb2'.

eh?

> If I change super.mb2, everything else works as I expect it ( but that 
> may not be what you want ).
> 
> BTW, the code needs more refactoring and <description> is still
> broken. I'll implement it as a top-level task, similar with 
> import - and any other task that operates on project 
> before execution will be possible, so if you want something else
> a normal task can be used. 
> 
> Finding the right hooks is the only problem, I don't want to 
> expose too much SAX.

In which sense it may be a problem?

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message