From 595133b251f6059e1b5240b522ac4a0ec3d00804 Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Tue, 22 Feb 2005 18:26:56 +0000 Subject: [PATCH] Pathconvert no longer requires that one of (targetos|pathsep|dirsep) be set; platform defaults are used when this is the case. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277715 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 3 +++ docs/manual/CoreTasks/pathconvert.html | 9 +++------ src/etc/testcases/taskdefs/pathconvert.xml | 4 ++++ .../org/apache/tools/ant/taskdefs/PathConvert.java | 10 ++-------- .../org/apache/tools/ant/taskdefs/PathConvertTest.java | 6 +++++- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index f0af8797e..a5bd88e92 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -220,6 +220,9 @@ Other changes: * Recursive token expansion in a filterset can now be disabled by setting its recurse attribute to false. +* Pathconvert no longer requires that one of (targetos|pathsep|dirsep) + be set; platform defaults are used when this is the case. + Fixed bugs: ----------- diff --git a/docs/manual/CoreTasks/pathconvert.html b/docs/manual/CoreTasks/pathconvert.html index b477da8e0..feb39ceb2 100644 --- a/docs/manual/CoreTasks/pathconvert.html +++ b/docs/manual/CoreTasks/pathconvert.html @@ -7,7 +7,7 @@ -

Pathconvert

+

Pathconvert

Description

Converts a nested <path> or reference to a Path, FileSet, DirSet, or FileList into a path @@ -40,10 +40,7 @@ drive letters to Unix paths, and vice-versa.

pathsep and dirsep according to the specified target architecture. - - Yes, unless pathsep and/or - dirsep are specified. - + No dirsep @@ -185,7 +182,7 @@ list of files.


-

Copyright © 2001-2004 The Apache Software Foundation. +

Copyright © 2001-2005 The Apache Software Foundation. All rights Reserved.

diff --git a/src/etc/testcases/taskdefs/pathconvert.xml b/src/etc/testcases/taskdefs/pathconvert.xml index c8798d08d..a71888568 100755 --- a/src/etc/testcases/taskdefs/pathconvert.xml +++ b/src/etc/testcases/taskdefs/pathconvert.xml @@ -18,4 +18,8 @@ + + + + diff --git a/src/main/org/apache/tools/ant/taskdefs/PathConvert.java b/src/main/org/apache/tools/ant/taskdefs/PathConvert.java index 3bcfca305..224048ff5 100644 --- a/src/main/org/apache/tools/ant/taskdefs/PathConvert.java +++ b/src/main/org/apache/tools/ant/taskdefs/PathConvert.java @@ -190,7 +190,7 @@ public class PathConvert extends Task { /** * Set targetos to a platform to one of * "windows", "unix", "netware", or "os/2"; - * defaults to the current platform. + * current platform settings are used by default. * @deprecated use the method taking a TargetOs argument instead. * @see #setTargetos(PathConvert.TargetOs) */ @@ -203,7 +203,7 @@ public class PathConvert extends Task { /** * Set targetos to a platform to one of * "windows", "unix", "netware", or "os/2"; - * defaults to the current platform. + * current platform settings are used by default. * @param target the target os * * @since Ant 1.5 @@ -437,12 +437,6 @@ public class PathConvert extends Task { if (property == null) { throw new BuildException("You must specify a property"); } - // Must either have a target OS or both a dirSep and pathSep - - if (targetOS == null && pathSep == null && dirSep == null) { - throw new BuildException("You must specify at least one of " - + "targetOS, dirSep, or pathSep"); - } // Determine the separator strings. The dirsep and pathsep attributes // override the targetOS settings. String dsep = File.separator; diff --git a/src/testcases/org/apache/tools/ant/taskdefs/PathConvertTest.java b/src/testcases/org/apache/tools/ant/taskdefs/PathConvertTest.java index 3131b4388..707d0ff7f 100755 --- a/src/testcases/org/apache/tools/ant/taskdefs/PathConvertTest.java +++ b/src/testcases/org/apache/tools/ant/taskdefs/PathConvertTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2004 The Apache Software Foundation. + * Copyright 2004-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,6 +43,10 @@ public class PathConvertTest extends BuildFileTest { test("testmapper"); } + public void testNoTargetOs() { + executeTarget("testnotargetos"); + } + private void test(String target) { executeTarget(target); assertPropertyEquals("result", "test#" + BUILD_FILENAME);