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 2019/04/16 06:06:18 UTC

[Bug 63351] New: not working!

https://bz.apache.org/bugzilla/show_bug.cgi?id=63351

            Bug ID: 63351
           Summary: <property name="environment" value="env" /> not
                    working!
           Product: Ant
           Version: 1.10.5
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Core tasks
          Assignee: notifications@ant.apache.org
          Reporter: MaassG@web.de
  Target Milestone: ---

The Ant welcome page says: 1.10.x requires Java8 at runtime.
The manual says in the help section for the property task concerning
attribute "environment":

This functionality is currently only implemented on select platforms.
Ant runs on Java 1.2 therefore it cannot use Java 5 features for accessing
environment variables.

But Java8 has: 
public static Map<String,String> System.getenv()

I was using ant version 1.9.6 for years now and this feature worked perfectly.

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

[Bug 63351] not working!

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63351

--- Comment #4 from Stefan Bodewig <bo...@apache.org> ---
No reason to apologize. you've helped us finding an outdated piece of
documentation :-)

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

[Bug 63351] not working!

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63351

--- Comment #1 from Stefan Bodewig <bo...@apache.org> ---
I think this tickets subject is wrong.

    <property name="environment" value="env" />

sets a property with name environment to the value env - i.e. ${envitonment}
expands to env.

The environment attribute on the other hand sets a whole bunch of properties

    <property environment="env"/>

makes ${env.PATH} on Unix or ${env.Path} on Windows expand to yout PATH/Path
environment variable.

Bot of these still work in Ant 1.10, the code hasn't really changed.

$ cat > /tmp/test.xml
<project>
    <property environment="env"/>
    <echo>${env.HOME}</echo>
</project>
$ ant -f /tmp/test.xml
Buildfile: /tmp/test.xml
     [echo] /home/stefan

BUILD SUCCESSFUL
Total time: 0 seconds

The manual page is a bit odd, the paragraph you quote stems from Ant 1.2 or
earlier. It has been in the manual for many many years and is outdated. I'll
remove it,

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

[Bug 63351] not working!

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63351

--- Comment #2 from Stefan Bodewig <bo...@apache.org> ---
Actually the paragraph ismn't that wrong, we still use an OS specific command.
We have deliberately chose to not switch to getEnv when Java 5 became the
baseline for Ant 1.9.x as getEnv and the OS command returned slightly different
results.

I hope this change
https://gitbox.apache.org/repos/asf?p=ant.git;a=commitdiff;h=40eacefd8afe50bd10ac074391c7387ad202c233
makes things a bit clearer.

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

[Bug 63351] not working!

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63351

gm <Ma...@web.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from gm <Ma...@web.de> ---
High Stefan,
thanks a lot for your quick reply.
Your absolutely right. - My mistake.
Sorry for that.
Best regards!
gm

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