ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Galen Boyer <galenboyer...@hotpop.com>
Subject Templates?
Date Sat, 05 Feb 2005 23:09:17 GMT
Are these being thought of?  I have a macro that resolves its
attributes to calls to targets.  (A very simplistic version of this
macro follows:
       
  <macrodef name="OBJECTS">
    <attribute name="objecttype"/>
    <attribute name="dmltype"/>
    <sequential>
       <antcall target="@{dmltype}-@{objecttype}"/>
    </sequential>
  </macrodef>

I have maybe ten objecttypes while 3 dmltypes.

I therefore have multitudes of targets that look like the following
(primarykey is an example of just one of objecttype).

  <!-- ######################################## -->
  <target name="drop-primarykeys" depends="init">
    <OBJECTS dmltype="drop" objecttype="PRIMARYKEY"/>
  </target>
  <target name="create-primarykeys" depends="init">
    <OBJECTS dmltype="create" objecttype="PRIMARYKEY" objectdir="${PRIMARYKEYS.dir}"/>
  </target>
  <target name="refresh-primarykeys" depends="init">
    <OBJECTS dmltype="refresh" objecttype="PRIMARYKEY" objectdir="${PRIMARYKEYS.dir}"/>
  </target>

A template of the above would simplify my ant files in a tremendous fashion.

-- 
Galen Boyer


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message