Browse Source

Add <os> and <exec> support for OS/400.

PR: 13047
Submitted by:	Brian Farrar <brian_farrar at countrywide.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273380 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
8e67850ad6
4 changed files with 18 additions and 2 deletions
  1. +7
    -0
      WHATSNEW
  2. +1
    -0
      docs/manual/CoreTasks/conditions.html
  3. +7
    -2
      src/main/org/apache/tools/ant/taskdefs/Execute.java
  4. +3
    -0
      src/main/org/apache/tools/ant/taskdefs/condition/Os.java

+ 7
- 0
WHATSNEW View File

@@ -37,6 +37,11 @@ Fixed bugs:
* <junitreport> created an empty junit-noframes.html if no format had
been specified.

* <basename> would remove more than it should if the file name
contained more than one dot.

* <property environment=... /> now works on OS/400.

Other changes:
--------------

@@ -81,6 +86,8 @@ Other changes:
* The SOS and VSS tasks will no longer unconditionally prepend a $ to
vsspath or projectpath.

* OS/400 now gets detected by the os condition.

Changes from Ant 1.5beta3 to Ant 1.5
====================================



+ 1
- 0
docs/manual/CoreTasks/conditions.html View File

@@ -94,6 +94,7 @@ the tests succeed.
<li>os/2 (for OS/2)</li>
<li>win9x for Microsoft Windows 95 and 98</li>
<li>z/os for z/OS and OS/390</li>
<li>os/400 for OS/400</li>
</ul>

<h4>equals</h4>


+ 7
- 2
src/main/org/apache/tools/ant/taskdefs/Execute.java View File

@@ -238,7 +238,7 @@ public class Execute {
// Alternatively one could use: /bin/sh -c env
String[] cmd = {"/usr/bin/env"};
return cmd;
} else if (Os.isFamily("netware")) {
} else if (Os.isFamily("netware") || Os.isFamily("os/400")) {
String[] cmd = {"env"};
return cmd;
} else {
@@ -259,7 +259,12 @@ public class Execute {
public static String toString(ByteArrayOutputStream bos) {
if (Os.isFamily("z/os")) {
try {
bos.toString("Cp1047");
return bos.toString("Cp1047");
} catch (java.io.UnsupportedEncodingException e) {
}
} else if (Os.isFamily("os/400")) {
try {
return bos.toString("Cp500");
} catch (java.io.UnsupportedEncodingException e) {
}
}


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

@@ -99,6 +99,7 @@ public class Os implements Condition {
* <li>windows</li>
* <li>win9x</li>
* <li>z/os</li>
* <li>os/400</li>
* </ul>
*/
public void setFamily(String f) {family = f.toLowerCase(Locale.US);}
@@ -224,6 +225,8 @@ public class Os implements Condition {
} else if (family.equals("z/os")) {
isFamily = osName.indexOf("z/os") > -1
|| osName.indexOf("os/390") > -1;
} else if (family.equals("os/400")) {
isFamily = osName.indexOf("os/400") > -1;
} else {
throw new BuildException(
"Don\'t know how to detect os family \""


Loading…
Cancel
Save