From c89a66172df55665b27e2ef3626453d8958f9767 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 19 Feb 2003 07:57:30 +0000 Subject: [PATCH] Preparing merge to 1.5 branch git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274134 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/CoreTasks/zip.html | 6 ++--- .../apache/tools/ant/taskdefs/Execute.java | 1 - .../org/apache/tools/ant/taskdefs/Zip.java | 26 +++++++++---------- .../apache/tools/ant/types/ZipFileSet.java | 10 +++---- ...SourceSelector.java => ResourceUtils.java} | 2 +- .../tools/ant/util/SourceFileScanner.java | 4 +-- src/main/org/apache/tools/zip/ZipEntry.java | 6 ++--- ...lectorTest.java => ResourceUtilsTest.java} | 12 ++++----- 8 files changed, 33 insertions(+), 34 deletions(-) rename src/main/org/apache/tools/ant/util/{SourceSelector.java => ResourceUtils.java} (99%) rename src/testcases/org/apache/tools/ant/util/{SourceSelectorTest.java => ResourceUtilsTest.java} (91%) diff --git a/docs/manual/CoreTasks/zip.html b/docs/manual/CoreTasks/zip.html index 13f4ca0ce..258e456d8 100644 --- a/docs/manual/CoreTasks/zip.html +++ b/docs/manual/CoreTasks/zip.html @@ -58,7 +58,7 @@ filenames contain non US-ASCII characters. Use the encoding attribute and set it to UTF8 to create zip files that can safely be read by Java.

-

Starting with Ant 1.6, <zip> can store Unix permissions +

Starting with Ant 1.5.2, <zip> can store Unix permissions inside the archive (see description of the filemode and dirmode attributes for <zipfileset>). Unfortunately there is no portable way to store these permissions. @@ -196,14 +196,14 @@ those listed below.

filemode A 3 digit octal string, specify the user, group and other modes in the standard Unix fashion. Only applies to - plain files. Default is 644. since Ant 1.6. + plain files. Default is 644. since Ant 1.5.2. No dirmode A 3 digit octal string, specify the user, group and other modes in the standard Unix fashion. Only applies to - directories. Default is 755. since Ant 1.6. + directories. Default is 755. since Ant 1.5.2. No diff --git a/src/main/org/apache/tools/ant/taskdefs/Execute.java b/src/main/org/apache/tools/ant/taskdefs/Execute.java index 603af5d04..f9d94e9b6 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Execute.java +++ b/src/main/org/apache/tools/ant/taskdefs/Execute.java @@ -216,7 +216,6 @@ public class Execute { private static String[] getProcEnvCommand() { if (Os.isFamily("os/2")) { // OS/2 - use same mechanism as Windows 2000 - // Not sure String[] cmd = {"cmd", "/c", "set" }; return cmd; } else if (Os.isFamily("windows")) { diff --git a/src/main/org/apache/tools/ant/taskdefs/Zip.java b/src/main/org/apache/tools/ant/taskdefs/Zip.java index d3fff8145..3acf6aab0 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Zip.java +++ b/src/main/org/apache/tools/ant/taskdefs/Zip.java @@ -84,7 +84,7 @@ import org.apache.tools.ant.util.FileUtils; import org.apache.tools.ant.util.GlobPatternMapper; import org.apache.tools.ant.util.IdentityMapper; import org.apache.tools.ant.util.MergingMapper; -import org.apache.tools.ant.util.SourceSelector; +import org.apache.tools.ant.util.ResourceUtils; import org.apache.tools.zip.ZipEntry; import org.apache.tools.zip.ZipOutputStream; @@ -521,7 +521,7 @@ public class Zip extends MatchingTask { * @param resources the resources to add * @param zOut the stream to write to * - * @since Ant 1.6 + * @since Ant 1.5.2 */ protected final void addResources(FileSet fileset, Resource[] resources, ZipOutputStream zOut) @@ -660,7 +660,7 @@ public class Zip extends MatchingTask { } /** - * @since Ant 1.6 + * @since Ant 1.5.2 */ private synchronized ZipScanner getZipScanner() { if (zs == null) { @@ -778,10 +778,10 @@ public class Zip extends MatchingTask { } } newerResources[i] = - SourceSelector.selectOutOfDateSources(this, - initialResources[i], - myMapper, - getZipScanner()); + ResourceUtils.selectOutOfDateSources(this, + initialResources[i], + myMapper, + getZipScanner()); needsUpdate = needsUpdate || (newerResources[i].length > 0); if (needsUpdate && !doUpdate) { @@ -804,7 +804,7 @@ public class Zip extends MatchingTask { * *

Included directories will preceede included files.

* - * @since Ant 1.6 + * @since Ant 1.5.2 */ protected Resource[][] grabResources(FileSet[] filesets) { Resource[][] result = new Resource[filesets.length][]; @@ -828,7 +828,7 @@ public class Zip extends MatchingTask { } /** - * @since Ant 1.6 + * @since Ant 1.5.2 */ protected void zipDir(File dir, ZipOutputStream zOut, String vPath, int mode) @@ -872,7 +872,7 @@ public class Zip extends MatchingTask { * entry from, will be null if we are not copying from an archive. * @param mode the Unix permissions to set. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ protected void zipFile(InputStream in, ZipOutputStream zOut, String vPath, long lastModified, File fromArchive, int mode) @@ -969,7 +969,7 @@ public class Zip extends MatchingTask { * @param vPath the name this entry shall have in the archive * @param mode the Unix permissions to set. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ protected void zipFile(File file, ZipOutputStream zOut, String vPath, int mode) @@ -991,7 +991,7 @@ public class Zip extends MatchingTask { /** * Ensure all parent dirs of a given entry have been added. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ protected final void addParentDirs(File baseDir, String entry, ZipOutputStream zOut, String prefix, @@ -1075,7 +1075,7 @@ public class Zip extends MatchingTask { /** * @return true if all individual arrays are empty * - * @since Ant 1.6 + * @since Ant 1.5.2 */ protected final static boolean isEmpty(Resource[][] r) { for (int i = 0; i < r.length; i++) { diff --git a/src/main/org/apache/tools/ant/types/ZipFileSet.java b/src/main/org/apache/tools/ant/types/ZipFileSet.java index 0cd5040b5..a6280be31 100644 --- a/src/main/org/apache/tools/ant/types/ZipFileSet.java +++ b/src/main/org/apache/tools/ant/types/ZipFileSet.java @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2001-2002 The Apache Software Foundation. All rights + * Copyright (c) 2001-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -83,7 +83,7 @@ public class ZipFileSet extends FileSet { /** * Default value for the dirmode attribute. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ public static final int DEFAULT_DIR_MODE = UnixStat.DIR_FLAG | UnixStat.DEFAULT_DIR_PERM; @@ -91,7 +91,7 @@ public class ZipFileSet extends FileSet { /** * Default value for the filemode attribute. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ public static final int DEFAULT_FILE_MODE = UnixStat.FILE_FLAG | UnixStat.DEFAULT_FILE_PERM; @@ -216,7 +216,7 @@ public class ZipFileSet extends FileSet { * other modes in the standard Unix fashion; * optional, default=0644 * - * @since Ant 1.6 + * @since Ant 1.5.2 */ public void setFileMode(String octalString) { this.fileMode = @@ -224,7 +224,7 @@ public class ZipFileSet extends FileSet { } /** - * @since Ant 1.6 + * @since Ant 1.5.2 */ public int getFileMode() { return fileMode; diff --git a/src/main/org/apache/tools/ant/util/SourceSelector.java b/src/main/org/apache/tools/ant/util/ResourceUtils.java similarity index 99% rename from src/main/org/apache/tools/ant/util/SourceSelector.java rename to src/main/org/apache/tools/ant/util/ResourceUtils.java index 9f00be7d6..4c7b57cb1 100644 --- a/src/main/org/apache/tools/ant/util/SourceSelector.java +++ b/src/main/org/apache/tools/ant/util/ResourceUtils.java @@ -68,7 +68,7 @@ import java.util.Vector; * @author Antoine Levy-Lambert * @since Ant 1.5.2 */ -public class SourceSelector { +public class ResourceUtils { /** { * tells which source files should be reprocessed based on the diff --git a/src/main/org/apache/tools/ant/util/SourceFileScanner.java b/src/main/org/apache/tools/ant/util/SourceFileScanner.java index 7a054a61c..56f90aa60 100644 --- a/src/main/org/apache/tools/ant/util/SourceFileScanner.java +++ b/src/main/org/apache/tools/ant/util/SourceFileScanner.java @@ -115,8 +115,8 @@ public class SourceFileScanner implements ResourceFactory { // build the list of sources which are out of date with // respect to the target Resource[] outofdate = - SourceSelector.selectOutOfDateSources(task, sourceresources, - mapper, this); + ResourceUtils.selectOutOfDateSources(task, sourceresources, + mapper, this); String[] result = new String[outofdate.length]; for (int counter=0; counter < outofdate.length; counter++) { result[counter] = outofdate[counter].getName(); diff --git a/src/main/org/apache/tools/zip/ZipEntry.java b/src/main/org/apache/tools/zip/ZipEntry.java index d563c2f78..ef7854b3d 100644 --- a/src/main/org/apache/tools/zip/ZipEntry.java +++ b/src/main/org/apache/tools/zip/ZipEntry.java @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2001-2002 The Apache Software Foundation. All rights + * Copyright (c) 2001-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -194,7 +194,7 @@ public class ZipEntry extends java.util.zip.ZipEntry { * Sets Unix permissions in a way that is understood by Info-Zip's * unzip command. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ public void setUnixMode(int mode) { setExternalAttributes((mode << 16) @@ -212,7 +212,7 @@ public class ZipEntry extends java.util.zip.ZipEntry { * @return 0 (MS-DOS FAT) unless {@link #setUnixMode setUnixMode} * has been called, in which case 3 (Unix) will be returned. * - * @since Ant 1.6 + * @since Ant 1.5.2 */ public int getPlatform() { return platform; diff --git a/src/testcases/org/apache/tools/ant/util/SourceSelectorTest.java b/src/testcases/org/apache/tools/ant/util/ResourceUtilsTest.java similarity index 91% rename from src/testcases/org/apache/tools/ant/util/SourceSelectorTest.java rename to src/testcases/org/apache/tools/ant/util/ResourceUtilsTest.java index 18c0bc689..fe58e6322 100644 --- a/src/testcases/org/apache/tools/ant/util/SourceSelectorTest.java +++ b/src/testcases/org/apache/tools/ant/util/ResourceUtilsTest.java @@ -64,14 +64,14 @@ import java.io.File; import junit.framework.TestCase; /** - * Tests for org.apache.tools.ant.util.SourceSelector. + * Tests for org.apache.tools.ant.util.ResourceUtils. */ -public class SourceSelectorTest extends TestCase +public class ResourceUtilsTest extends TestCase implements ResourceFactory, FileNameMapper { private Echo taskINeedForLogging = new Echo(); - public SourceSelectorTest(String name) { + public ResourceUtilsTest(String name) { super(name); taskINeedForLogging.setProject(new Project()); } @@ -79,9 +79,9 @@ public class SourceSelectorTest extends TestCase public void testNoDuplicates() { Resource r = new Resource("samual vimes", true, 1, false); Resource[] toNew = - SourceSelector.selectOutOfDateSources(taskINeedForLogging, - new Resource[] {r}, - this, this); + ResourceUtils.selectOutOfDateSources(taskINeedForLogging, + new Resource[] {r}, + this, this); assertEquals(1, toNew.length); }