Perhaps something such as

    <j:choose>
      <j:when test="${systemScope['os.name'].startsWith('Windows')}">
        <j:set var="isWindows" value="true"/>
        <j:set var="isUnix" value="false"/>
        <ant:echo>The operating system is Windows</ant:echo>
      </j:when>
      <j:otherwise>
        <j:set var="isWindows" value="false"/>
        <j:set var="isUnix" value="true"/>
        <ant:echo>The operating system is Unix</ant:echo>
      </j:otherwise>
    </j:choose>



-----Original Message-----
From: Erik Husby [mailto:[EMAIL PROTECTED]
Sent: 24 March 2004 16:37
To: [EMAIL PROTECTED]
Subject: Determining current OS


I am trying to convert an Ant script that I have that needs to know 
which OS it is currently running on. I took the statements
    condition property="isUnix">
        <os family="unix"/>
    </condition>

    <condition property="isWindows">
            <os family="windows"/>
        </condition>
   
and put them in my maven.xml as
 
          <ant:condition property="isUnix">
              <ant:os family="unix"/>
          </ant:condition>

          <ant:condition property="isWindows">
              <ant:os family="windows"/>
              </ant:condition>

But when I run, neither property is being set.

I've scanned the plugin.jelly files and none are using this condition. 
Is there a better way to determine what
OS is being used?

The reason for the test is that I need to run the Ant task pathconvert 
which needs to know the target OS.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to