/** * Provide any macro substitutions and versions for exported packages. */ void augmentExports() { for (String packageName : exports.keySet()) { setProperty(CURRENT_PACKAGE, packageName); try { Map<String, String> attributes = exports.get(packageName); Map<String, String> exporterAttributes = classpathExports.get(packageName); if (exporterAttributes == null) continue; for (Map.Entry<String, String> entry : exporterAttributes.entrySet()) { String key = entry.getKey(); if (key.equalsIgnoreCase(SPECIFICATION_VERSION)) key = VERSION_ATTRIBUTE; if (!key.endsWith(":") && !attributes.containsKey(key)) { attributes.put(key, entry.getValue()); } } fixupAttributes(attributes); removeAttributes(attributes); } finally { unsetProperty(CURRENT_PACKAGE); } } }
/** * Calculate a version from a version policy. * * @param version * The actual exported version * @param impl * true for implementations and false for clients */ String calculateVersionRange(String version, boolean impl) { setProperty("@", version); try { return getVersionPolicy(impl); } finally { unsetProperty("@"); } }
/** * Add the uses clauses. This method iterates over the exports and cal * * @param exports * @param uses * @throws MojoExecutionException */ void doUses(Map<String, Map<String, String>> exports, Map<String, Set<String>> uses, Map<String, Map<String, String>> imports) { if ("true".equalsIgnoreCase(getProperty(NOUSES))) return; for (Iterator<String> i = exports.keySet().iterator(); i.hasNext();) { String packageName = i.next(); setProperty(CURRENT_PACKAGE, packageName); try { doUses(packageName, exports, uses, imports); } finally { unsetProperty(CURRENT_PACKAGE); } } }
setProperty(CURRENT_USES, sb.toString()); override = getReplacer().process(override); unsetProperty(CURRENT_USES); } else
setProperty(CURRENT_USES, sb.toString()); override = getReplacer().process(override); unsetProperty(CURRENT_USES); } else unsetProperty(CURRENT_PACKAGE);
/** * Find some more information about imports in manifest and other places. */ void augmentImports() { for (String packageName : imports.keySet()) { setProperty(CURRENT_PACKAGE, packageName); try { Map<String, String> importAttributes = imports.get(packageName); Map<String, String> exporterAttributes = classpathExports.get(packageName); if (exporterAttributes == null) exporterAttributes = exports.get(packageName); if (exporterAttributes != null) { augmentVersion(importAttributes, exporterAttributes); augmentMandatory(importAttributes, exporterAttributes); if (exporterAttributes.containsKey(IMPORT_DIRECTIVE)) importAttributes.put(IMPORT_DIRECTIVE, exporterAttributes.get(IMPORT_DIRECTIVE)); } fixupAttributes(importAttributes); removeAttributes(importAttributes); } finally { unsetProperty(CURRENT_PACKAGE); } } }
unsetProperty(CURRENT_PACKAGE);
importRange = getVersionPolicy(); unsetProperty("@");
attrs.putValue(property.getKey(), processed); } finally { unsetProperty("@");