Browse Source

properly detect MacOS X when running inside OpenJDK. Bugzilla Issue 44889

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@675623 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
6644eb5bbb
2 changed files with 15 additions and 2 deletions
  1. +4
    -0
      WHATSNEW
  2. +11
    -2
      src/main/org/apache/tools/ant/taskdefs/condition/Os.java

+ 4
- 0
WHATSNEW View File

@@ -106,6 +106,10 @@ Other changes:
* The <type> resource selector has had an "any" type added for better
configurability.

* Ant should detect the OS as both a Mac and a Unix system when
running on OpenJDK.
Bugzilla Report 44889.

Changes from Ant 1.7.0 TO Ant 1.7.1
=============================================



+ 11
- 2
src/main/org/apache/tools/ant/taskdefs/condition/Os.java View File

@@ -100,6 +100,13 @@ public class Os implements Condition {
/** OS family that can be tested for. {@value} */
public static final String FAMILY_OS400 = "os/400";

/**
* OpenJDK is reported to call MacOS X "Darwin"
* @see https://issues.apache.org/bugzilla/show_bug.cgi?id=44889
* @see https://issues.apache.org/jira/browse/HADOOP-3318
*/
private static final String DARWIN = "darwin";

/**
* Default constructor
*
@@ -276,13 +283,15 @@ public class Os implements Condition {
} else if (family.equals(FAMILY_DOS)) {
isFamily = PATH_SEP.equals(";") && !isFamily(FAMILY_NETWARE);
} else if (family.equals(FAMILY_MAC)) {
isFamily = OS_NAME.indexOf(FAMILY_MAC) > -1;
isFamily = OS_NAME.indexOf(FAMILY_MAC) > -1
|| OS_NAME.indexOf(DARWIN) > -1;
} else if (family.equals(FAMILY_TANDEM)) {
isFamily = OS_NAME.indexOf("nonstop_kernel") > -1;
} else if (family.equals(FAMILY_UNIX)) {
isFamily = PATH_SEP.equals(":")
&& !isFamily(FAMILY_VMS)
&& (!isFamily(FAMILY_MAC) || OS_NAME.endsWith("x"));
&& (!isFamily(FAMILY_MAC) || OS_NAME.endsWith("x")
|| OS_NAME.indexOf(DARWIN) > -1);
} else if (family.equals(FAMILY_ZOS)) {
isFamily = OS_NAME.indexOf(FAMILY_ZOS) > -1
|| OS_NAME.indexOf("os/390") > -1;


Loading…
Cancel
Save