You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2009/02/19 16:22:38 UTC
DO NOT REPLY [Bug 46737] New: Extend documentation of
echo/java-when-forked tasks
https://issues.apache.org/bugzilla/show_bug.cgi?id=46737
Summary: Extend documentation of echo/java-when-forked tasks
Product: Ant
Version: 1.7.1
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Other
AssignedTo: notifications@ant.apache.org
ReportedBy: lzap@seznam.cz
Please extend documentation of echo/java-when-forked tasks. The problem is with
special characters of the arg elements. Its not documented what should be
output of this simple test:
<project name="test" default="test">
<target name="test">
<property name="a" value=""src"" />
<echo>Variable is ${a}</echo>
<echo>Now lets see what exec do with quotes</echo>
<exec executable="echo">
<arg value="${a}" />
</exec>
<echo>It removes quotes - even when entered directly</echo>
<exec executable="echo">
<arg value=""src"" />
</exec>
</target>
</project>
On some systems it prints:
test:
[echo] Variable is "src"
[echo] Now lets see what exec do with quotes
[exec] src
[echo] It removes quotes - even when entered directly
[exec] src
on others
test:
[echo] Variable is "src"
[echo] Now lets see what exec do with quotes
[exec] "src"
[echo] It removes quotes - even when entered directly
[exec] "src"
It varies from different Java versions or platforms.
The very same for JAVA TASK when fork is set to "true"! A little bit dangerous.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 46737] Extend documentation of
echo/java-when-forked tasks
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46737
Stefan Bodewig <bo...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WONTFIX
--- Comment #1 from Stefan Bodewig <bo...@apache.org> 2009-05-07 02:42:20 PST ---
ant doesn't, Runtime.exec does - and there isn't much Ant can do.
If you run Ant in verbose mode you'll see
[echo] Variable is "src"
[echo] Now lets see what exec do with quotes
[exec] Current OS is Windows XP
[exec] Executing 'echo' with arguments:
[exec] '"src"'
[exec]
[exec] The ' characters around the executable and arguments are
[exec] not part of the command.
[exec] src
[echo] It removes quotes - even when entered directly
[exec] Current OS is Windows XP
[exec] Executing 'echo' with arguments:
[exec] '"src"'
[exec]
[exec] The ' characters around the executable and arguments are
[exec] not part of the command.
[exec] src
even on Windows where echo swallows the quotes.
Ant uses the String[] version of Runtime.exec and passes down the quotes, it's
just that they get swallowed later either inside the class libraries
implementation of exec or inside the OS.
CANTFIX rather than WONTTFIX
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 46737] Extend documentation of
echo/java-when-forked tasks
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46737
--- Comment #2 from Lukas Zapletal <lz...@seznam.cz> 2009-05-07 03:02:55 PST ---
Thanks but this issue was not about fixing an software issue but the
documentation. It would be great to mention this. Thanks anyway.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 46737] Extend documentation of
echo/java-when-forked tasks
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46737
--- Comment #3 from Lukas Zapletal <lz...@seznam.cz> 2009-05-07 03:05:33 PST ---
I mean - its hard to write once run everywhere (Ant script) when fork=true. It
should be documented.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.