ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Jar.java
Date Wed, 22 May 2002 11:53:16 GMT
bodewig     02/05/22 04:53:16

  Modified:    src/main/org/apache/tools/ant/taskdefs Tag: ANT_15_BRANCH
                        Jar.java
  Log:
  Don't warn for things that have explicitly been asked for.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.51.2.4  +13 -8     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java
  
  Index: Jar.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java,v
  retrieving revision 1.51.2.3
  retrieving revision 1.51.2.4
  diff -u -r1.51.2.3 -r1.51.2.4
  --- Jar.java	21 May 2002 22:46:32 -0000	1.51.2.3
  +++ Jar.java	22 May 2002 11:53:16 -0000	1.51.2.4
  @@ -101,7 +101,7 @@
        *  whether to merge fileset manifests;
        *  value is true if filesetmanifest is 'merge' or 'mergewithoutmain'
        */
  -    private boolean mergeManifests = false;
  +    private FilesetManifestConfig filesetManifestConfig;
   
       /**
        *  Whether to create manifest file on finalizeOutputStream?
  @@ -215,9 +215,8 @@
       }
   
       public void setFilesetmanifest(FilesetManifestConfig config) {
  -        String filesetManifestConfig = config.getValue();
  -        mergeManifests = !("skip".equals(filesetManifestConfig));
  -        mergeManifestsMain = "merge".equals(filesetManifestConfig);
  +        filesetManifestConfig = config;
  +        mergeManifestsMain = "merge".equals(config.getValue());
       }
   
       public void addMetainf(ZipFileSet fs) {
  @@ -228,7 +227,8 @@
   
       protected void initZipOutputStream(ZipOutputStream zOut)
           throws IOException, BuildException {
  -        if (! (mergeManifests || mergeManifestsMain)) {
  +        if (filesetManifestConfig == null
  +            || filesetManifestConfig.getValue().equals("skip")) {
               manifestOnFinalize = false;
               createManifest(zOut);
           }
  @@ -394,7 +394,8 @@
               } else {
                   manifest = getManifest(file);
               }
  -        } else if (mergeManifests) {
  +        } else if (filesetManifestConfig != null && 
  +                   !filesetManifestConfig.getValue().equals("skip")) {
               // we add this to our group of fileset manifests
               log("Found manifest to merge in file " + file,
                   Project.MSG_VERBOSE);
  @@ -413,10 +414,14 @@
               }
           } else {
               // assuming 'skip' otherwise
  +            // don't warn if skip has been requested explicitly, warn if user
  +            // didn't set the attribute
  +            int logLevel = filesetManifestConfig == null ?
  +                Project.MSG_WARN : Project.MSG_VERBOSE;
               log("File " + file
                   + " includes a META-INF/MANIFEST.MF which will be ignored. "
                   + "To include this file, set filesetManifest to a value other "
  -                + "than 'skip'.", Project.MSG_WARN);
  +                + "than 'skip'.", logLevel);
           }
       }
   
  @@ -503,7 +508,7 @@
       public void reset() {
           super.reset();
           configuredManifest = null;
  -        mergeManifests = false;
  +        filesetManifestConfig = null;
           mergeManifestsMain = false;
           manifestFile = null;
           index = false;
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message