You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "J.C. Hamlin (JIRA)" <ji...@apache.org> on 2012/08/01 01:16:34 UTC

[jira] [Created] (IVY-1367) Support Conditional Setting of a Property

J.C. Hamlin created IVY-1367:
--------------------------------

             Summary: Support Conditional Setting of a Property
                 Key: IVY-1367
                 URL: https://issues.apache.org/jira/browse/IVY-1367
             Project: Ivy
          Issue Type: New Feature
          Components: Core
    Affects Versions: 2.2.0
            Reporter: J.C. Hamlin
            Priority: Minor


Please allow a way to make conditional use of environment variables in ivysettings.xml. If the environment variable is set, then set the property, otherwise, don't set the property. This can be generalized into a general test to set a property only if another property is set.

Something like this, where the "ifset" is the new attribute of the property element.

  <properties environment="env"/>
  <property name="ivy.repos.server" value="${env.IVY_SERVER}" override="false" ifset="env.IVY_SERVER" />
  <property name="ivy.repos.server" value="http://ivy:8081" override="false"/>

In ant, you do something like this, which is very similar (but more verbose):

  <condition property="ivy.repos.server" value="${env.IVY_SERVER}">
    <isset property="env.IVY_SERVER"/>
  </condition>
  <property name="ivy.repos.server" value="http://ivy:8081"/>

So, if a user defines an environment variable it will override the default value provided by the system. And if the environment variable is not defined in the environment, then the system default value can apply.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (IVY-1367) Support Conditional Setting of a Property

Posted by "Nicolas Lalevée (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVY-1367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Lalevée resolved IVY-1367.
----------------------------------

       Resolution: Fixed
    Fix Version/s: trunk
         Assignee: Nicolas Lalevée
    
> Support Conditional Setting of a Property
> -----------------------------------------
>
>                 Key: IVY-1367
>                 URL: https://issues.apache.org/jira/browse/IVY-1367
>             Project: Ivy
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.2.0
>            Reporter: J.C. Hamlin
>            Assignee: Nicolas Lalevée
>            Priority: Minor
>             Fix For: trunk
>
>
> Please allow a way to make conditional use of environment variables in ivysettings.xml. If the environment variable is set, then set the property, otherwise, don't set the property. This can be generalized into a general test to set a property only if another property is set.
> Something like this, where the "ifset" is the new attribute of the property element.
>   <properties environment="env"/>
>   <property name="ivy.repos.server" value="${env.IVY_SERVER}" override="false" ifset="env.IVY_SERVER" />
>   <property name="ivy.repos.server" value="http://ivy:8081" override="false"/>
> In ant, you do something like this, which is very similar (but more verbose):
>   <condition property="ivy.repos.server" value="${env.IVY_SERVER}">
>     <isset property="env.IVY_SERVER"/>
>   </condition>
>   <property name="ivy.repos.server" value="http://ivy:8081"/>
> So, if a user defines an environment variable it will override the default value provided by the system. And if the environment variable is not defined in the environment, then the system default value can apply.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira