Using FilterSet to generate a file from a template with Ant

See:

Copy a template file to a directory, replacing @TOKENS@ with build.properties values:

<copy file="template.conf" tofile="config.conf" overwrite="true">
  <filterset>
    <filter token="USERNAME" value="${auth.username}"/>
    <filter token="PASSWORD" value="${auth.password}"/>
  <filterset>
</copy>

The template file:

username=DavidKeen
password=@PASSWORD@

The build.properties file:

auth.username=my_username
auth.password=my_password


CategoryProgramming

AntCopyFilterSet (last edited 2008-10-28 23:21:45 by DavidKeen)