https://issues.apache.org/bugzilla/show_bug.cgi?id=50553
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
AssignedTo: [email protected]
ReportedBy: [email protected]
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="${db.name}" />
</apply>
What would be simply awesome is if you could do something like this:
<apply executable="${psql.bin}" srcfileproperty="sqlinput"
addsourcefile="false">
<fileset dir="${sqlscripts.home}" includes="**/*.sql" />
<arg value="-f${sqlinput}" />
<arg value="${db.name}" />
</apply>
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: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.