You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Todd Wells <to...@wrq.com> on 2004/10/29 19:14:29 UTC

apply task appends source even when not specified?

I've been wrestling with the apply task and trying to figure out why
this behavior is exhibited and how I can prevent it.

The task: [using ant 1.5.1]

    <target name="undeploy">
        <apply executable="${vhi.dir}\bin\deactivatemodel.bat"
               vmlauncher="false" dest="" relative="true">
            <arg value="-m"/>
            <targetfile/>
            <arg value="-s"/>
            <arg value="${vhiServer}"/>
            <fileset dir="${package.dir}" includes="*.zip"/>
            <mapper type="regexp" from="^(.*)\.zip$$" to="\1"/>
        </apply>
    </target>

There are a bunch of zip files in a directory, I'm stripping the ".zip"
extension and just using the extensionless name (target) as an argument
to a batch file.  I have no need to use the source file name in this
apply.  And yet, ant appends it as the last argument!  Example:

    [apply] Executing 'c:\Program Files\VHI\bin\deactivatemodel.bat'
with arguments:
    [apply] '-m'
    [apply] 'sonic5250_Connector_55'
    [apply] '-s'
    [apply] 'toddw-xp'
    [apply] 'sonic5250_Connector_55.zip'        <---   WHY DOES THIS
APPEAR AND HOW DO I STOP IT?
    [apply]
    [apply] The ' characters around the executable and arguments are
    [apply] not part of the command.
    [apply] Error: switch expected at: sonic5250_Connector_55.zip
    [apply] deactivatemodel -model, -m model_name
    [apply]               [ -server, -s vhi_server ]
    [apply]               [ -user, -u username  with  -password, -w
password ]
    [apply] deactivatemodel -help, -?
    [apply] Result: 1

The problem here is the "sonic5250_Connector_55.zip".  I don't believe
that my apply task specifies for this to appear, but it does and so the
batch file fails, not understanding the argument.



Re: apply task appends source even when not specified?

Posted by Matt Benson <gu...@yahoo.com>.
--- Todd Wells <to...@wrq.com> wrote:
> I've been wrestling with the apply task and trying
> to figure out why
> this behavior is exhibited and how I can prevent it.

Todd:  Since Ant 1.6, <apply> has had a new attribute
"addsourcefile" that you can set to "false" to avoid
this behavior.

HTH,
Matt


		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

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