ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50553] Apply task should make srcfile/targetfile available as a property
Date Thu, 06 Jan 2011 19:30:12 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50553

--- Comment #1 from Jan Mat <jan@materne.de> 2011-01-06 14:30:09 EST ---
Using properties is not possible because they are immutable.
Having that said, the "valid" alternative would be attributes like in
<macrodef>. So your example would look like

  <apply executable="${psql.bin}" srcfileproperty="sqlinput"
        addsourcefile="false">
    <fileset dir="${sqlscripts.home}" includes="**/*.sql" />
    <arg value="-f@{sqlinput}" /> <!-- see the @ instead the $ here -->
    <arg value="${db.name}" />
  </apply>

Or with standard names

  <apply executable="${psql.bin}" addsourcefile="false">
    <fileset dir="${sqlscripts.home}" includes="**/*.sql" />
    <arg value="-f@{srcfile}" /> <!-- the same name as the tag -->
    <arg value="${db.name}" />
  </apply>

But I am not sure if you can't achieve your goal with the current
implementation:

  <apply executable="${psql.bin}">
    <fileset dir="${sqlscripts.home}" includes="**/*.sql" />
    <arg value="-f"/>
    <srcfile/>
    <arg value="${db.name}" />
  </apply>

(Haven't tested that ... but that's what I read in the manual)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message