ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Problem with quoted argument value
Date Mon, 25 Mar 2002 17:53:50 GMT
I'm not sure it works with 1.4.1, but Diane gave an example for 1.5a that
put the double-quotes inside the single-quoted attribute value. So you might
be able to use:

<echo>Deploying EJB JAR file</echo>
<exec executable="${global.was.dir}/bin/ejbdeploy.bat">
  <arg value="${ejb.jar.file}"/>
  <arg value="${global.temp.dir}"/>
  <arg value="${global.temp.dir}/${ejb.jar.name}"/>
  <arg value='-cp "c:/mypath"'/>
  <arg value="-quiet"/>
</exec>

Strange that you use the BAT directly rather than thru cmd.exe... But using
it adds even more quotes! --DD

Diane's example:

<target name="doConditionalTarget" depends="chkTarget" if="target.found">
  <ant ... />
</target>

<target name="chkTarget">
  <exec executable="sh" dir="subdir"
        resultproperty="grep.rc" os="FreeBSD">
    <arg line='-c "ant -projecthelp -verbose|grep -q findit"'/>
  </exec>
  <exec executable="cmd" dir="subdir"
        resultproperty="grep.rc" os="Windows NT">
    <arg line='/c "ant -projecthelp -verbose|findstr 1>nul 2>nul findit"'/>
  </exec>
  <condition property="target.found">
    <equals arg1="${grep.rc}" arg2="0"/>
  </condition>
</target>


 -----Original Message-----
From: 	Timothy Fisher [mailto:trfishermi@yahoo.com] 
Sent:	Monday, March 25, 2002 10:39 AM
To:	'Ant Users List'
Subject:	Problem with quoted argument value

Hello,

I'm writing a task in an Ant script that will deploy
an EJB module.
Part of this task makes a call to the ejbdeploy.bat
script for generating ejb deployment code.
This script can take a class path as an argument as
follows:
	-cp "classpath here separated by semicolons"
Note that the double quotes must surround this
argument.   (I am using the Websphere ejbdeploy
script, not sure if others behave differently)

My problem is this.  There is a known, reported, bug
in Ant that prevents the &quot entity from working. 
If you use the &quot entity in a arg value, it gets
stripped
off and you end up with no quotes.

A portion of my script is shown below:

	<echo>Deploying EJB JAR file</echo>
	<exec
executable="${global.was.dir}/bin/ejbdeploy.bat">
		<arg value="${ejb.jar.file}"/>
		<arg value="${global.temp.dir}"/>
		<arg value="${global.temp.dir}/${ejb.jar.name}"/>
		<arg value="-cp &quot;c:/mypath&quot;"/>
		<arg value="-quiet"/>
	</exec>


Unfortunately this does not work, because Ant strips
off the double quotes that I specifically requested be
present.

Can anyone either suggest a solution as to how I can
pass this argument to ejbdeploy?
or
tell me when a version of Ant might be released that
fixes the quotation problem?

Note the quotation bug is in bugzilla as bug #: 5906

Thanks,
Timothy Fisher
trfishermi@yahoo.com

__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards(r)
http://movies.yahoo.com/

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

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


Mime
View raw message