ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 50553] New: Apply task should make srcfile/targetfile available as a property
Date Thu, 06 Jan 2011 18:36:04 GMT

           Summary: Apply task should make srcfile/targetfile available as
                    a property
           Product: Ant
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks

For some situations, it is insufficient to have srcfile (and probably also
targetfile) available only as a tag in the arguments to the apply executable.  

For example: if the source file is a sql script, and my executable is psql, I
need to pass an argument -f sourcefile.sql like so:

psql -f sourcefile.sql dbname

The following does not work, because there is no way to make srcfile the optarg
to -f.

  <apply executable="${psql.bin}">
    <fileset dir="${sqlscripts.home}" includes="**/*.sql" />
    <!-- whoops, this doesn't work -->
    <srcfile />
    <arg value="${}" />

What would be simply awesome is if you could do something like this:

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

This would follow the existing convention for outputproperty and errorproperty,
and make apply much more flexible.

The workaround I've been using in the meantime is to apply a shell script which
can put the -f and the source file together before calling psql.  This is kind
of gross and kind of defeats the purpose of using ant in the first place.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message