ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 16799] New: - cope with (un-)set environment variables when setting properties to them
Date Wed, 05 Feb 2003 11:31:06 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16799>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16799

cope with (un-)set environment variables when setting properties to them

           Summary: cope with (un-)set environment variables when setting
                    properties to them
           Product: Ant
           Version: 1.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: Michael.Brinkmann@materna.de


in /bin/sh, it is possible to do this:

VAR=${ENV:-"default-value"}

A feature like this would be very useful in ANT, too, when trying to set
properties (and not knowing whether the env-variable is set or not):

<property name="VAR" value="${env.ENV}" />

Or, when "if/unless" would be permitted for properties, the feature can
be emulated:

<property name="VAR" value="${env.ENV}" if="env.ENV"/>
<property name="VAR" value="default-value" unless="env.ENV"/>

Mime
View raw message