ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shunhui Zhu" <shun...@netvmg.com>
Subject parsing targets
Date Wed, 23 May 2001 21:56:21 GMT
Hi, I have a few applications,  say "foo1" and "foo2", all needs to be
build in the .war directory structure. I'd like to be able to type
"build foo1.compile", "build foo2.clean", etc. Since the tasks are all
the same, I managed to create a general "app.compile" target that relies
on the
property "app.name" to be set. But in order to do the above, I have the
following block in build.xml

 <target name="foo1.compile">
    <antcall target="app.compile">
      <param name="app.name" value="foo1"/>
    </antcall>    
  </target>

 <target name="foo2.compile">
    <antcall target="app.compile">
      <param name="app.name" value="foo2"/>
    </antcall>    
  </target>

and similarly for other targets and applications. This is fine, but I'm
wondering whether ant can parse the target when I type "build
foo.compile", it automatically extracts the app name as "foo" and make a
call to 
	<antcall target="app.compile">
      <param name="app.name" value="foo"/>
    	</antcall>    

I can write the parsing in the build.bat/build.sh, but can one do it
inside ant?

Thanks.

Shunhui

Mime
View raw message