I still think that using XSLT as a sort of "preprocessor" is the best way
to handle these kind of situations. You could define the structure of your
project in an XML file, using as simple a syntax as possible, then use XSL
to generate your Ant file. This keeps the Ant syntax small and clean, while
leveraging an already defined standard to automate the repetitive stuff...

Matt Foemmel
ThoughtWorks, Inc.


                                                                                
                                                                 
                    Jesse Glick                                                 
                                                                 
                    <[EMAIL PROTECTED]        To:     [EMAIL PROTECTED]         
                                                          
                    beans.com>              cc:                                 
                                                                 
                    Sent by:                Subject:     Re: Immutable 
Properties in 1.1?                                                        
                    [EMAIL PROTECTED]                                           
                                                                  
                    eans.com                                                    
                                                                 
                                                                                
                                                                 
                                                                                
                                                                 
                    07/20/2000 03:49                                            
                                                                 
                    PM                                                          
                                                                 
                    Please respond                                              
                                                                 
                    to ant-dev                                                  
                                                                 
                                                                                
                                                                 
                                                                                
                                                                 




Ken Liu wrote:
> BTW, the problem I see with using templated targets ala Jesse's patch is

"patch" -> "proposed patch" :-)

> that it would be difficult to define different "depends" for each
different
> target, no?

Well, I was assuming that you would be able to parametrize depends lists
as well:

<target pattern="prepare-dir-(.*)">
  <somehowCleanIt path="sources/$[1]"/>
</target>
<target pattern="build-dir-(.*)-with-libs-from-(.*)"
        depends="prepare-dir-$[1]">
  <compileIt path="sources/$[1]"
             pullInJars="$[2]/*.jar"/>
</target>

Something like that. Now run targets like
"build-dir-foo/bar-with-libs-from-miscutils". If you have different
*kinds* of dependencies for the different targets, you would need one
template per kind of dependency, I guess.

-Jesse

--
Jesse Glick   <mailto:[EMAIL PROTECTED]>
NetBeans, Open APIs  <http://www.netbeans.org/>
tel (+4202) 3300-9161 Sun Micro x49161 Praha CR



Reply via email to