コード例 #1
0
  private Manifest createManifest() throws ArchiverException {
    Manifest finalManifest = Manifest.getDefaultManifest();

    if ((manifest == null) && (manifestFile != null)) {
      // if we haven't got the manifest yet, attempt to
      // get it now and have manifest be the final merge
      manifest = getManifest(manifestFile);
    }

    /*
     * Precedence: manifestFile wins over inline manifest,
     * over manifests read from the filesets over the original
     * manifest.
     *
     * merge with null argument is a no-op
     */

    if (isInUpdateMode()) {
      JdkManifestFactory.merge(finalManifest, originalManifest, false);
    }
    JdkManifestFactory.merge(finalManifest, filesetManifest, false);
    JdkManifestFactory.merge(finalManifest, configuredManifest, false);
    JdkManifestFactory.merge(finalManifest, manifest, !mergeManifestsMain);

    return finalManifest;
  }
コード例 #2
0
  private void filesetManifest(File file, InputStream is) throws ArchiverException {
    if ((manifestFile != null) && manifestFile.equals(file)) {
      // If this is the same name specified in 'manifest', this
      // is the manifest to use
      getLogger().debug("Found manifest " + file);
      if (is != null) {
        manifest = getManifest(is);
      } else {
        manifest = getManifest(file);
      }
    } else if ((filesetManifestConfig != null)
        && filesetManifestConfig != FilesetManifestConfig.skip) {
      // we add this to our group of fileset manifests
      getLogger().debug("Found manifest to merge in file " + file);

      Manifest newManifest;
      if (is != null) {
        newManifest = getManifest(is);
      } else {
        newManifest = getManifest(file);
      }

      if (filesetManifest == null) {
        filesetManifest = newManifest;
      } else {
        JdkManifestFactory.merge(filesetManifest, newManifest, false);
      }
    }
  }
コード例 #3
0
 /**
  * Allows the manifest for the archive file to be provided inline in the build file rather than in
  * an external file.
  *
  * @param newManifest The new manifest
  * @throws ManifestException .
  */
 public void addConfiguredManifest(Manifest newManifest) throws ManifestException {
   if (configuredManifest == null) {
     configuredManifest = newManifest;
   } else {
     JdkManifestFactory.merge(configuredManifest, newManifest, false);
   }
   savedConfiguredManifest = configuredManifest;
 }