public void cleanupVersion(Map<String, Map<String, String>> mapOfMap) { for (Iterator<Map.Entry<String, Map<String, String>>> e = mapOfMap .entrySet().iterator(); e.hasNext();) { Map.Entry<String, Map<String, String>> entry = e.next(); Map<String, String> attributes = entry.getValue(); if (attributes.containsKey("version")) { attributes.put("version", cleanupVersion(attributes .get("version"))); } } }
/** * Intercept the call to analyze and cleanup versions after we have analyzed * the setup. We do not want to cleanup if we are going to verify. */ public void analyze() throws IOException { super.analyze(); cleanupVersion(imports); cleanupVersion(exports); String version = getProperty(BUNDLE_VERSION); if (version != null) setProperty(BUNDLE_VERSION, cleanupVersion(version)); }
/** * Intercept the call to analyze and cleanup versions after we have analyzed * the setup. We do not want to cleanup if we are going to verify. */ public void analyze() throws Exception { super.analyze(); cleanupVersion(imports, null); cleanupVersion(exports, getVersion()); String version = getProperty(BUNDLE_VERSION); if (version != null) { version = cleanupVersion(version); if (version.endsWith(".SNAPSHOT")) { version = version.replaceAll("SNAPSHOT$", getProperty(SNAPSHOT, "SNAPSHOT")); } setProperty(BUNDLE_VERSION, version); } }
/** * A macro to convert a maven version to an OSGi version */ public String _maven_version(String args[]) { if (args.length > 2) error("${maven_version} macro receives too many arguments " + Arrays.toString(args)); else if (args.length < 2) error("${maven_version} macro has no arguments, use ${maven_version;1.2.3-SNAPSHOT}"); else { return cleanupVersion(args[1]); } return null; }
/** * A macro to convert a maven version to an OSGi version */ public String _maven_version(String args[]) { if (args.length > 2) error("${maven_version} macro receives too many arguments " + Arrays.toString(args)); else if (args.length < 2) error("${maven_version} macro has no arguments, use ${maven_version;1.2.3-SNAPSHOT}"); else { return cleanupVersion(args[1]); } return null; }
public void cleanupVersion(Map<String, Map<String, String>> mapOfMap, String defaultVersion) { for (Iterator<Map.Entry<String, Map<String, String>>> e = mapOfMap.entrySet().iterator(); e .hasNext();) { Map.Entry<String, Map<String, String>> entry = e.next(); Map<String, String> attributes = entry.getValue(); String v = attributes.get(Constants.VERSION_ATTRIBUTE); if (v == null && defaultVersion != null) { if (!isTrue(getProperty(Constants.NODEFAULTVERSION))) { v = defaultVersion; if (isPedantic()) warning("Used bundle version %s for exported package %s", v, entry.getKey()); } else { if (isPedantic()) warning("No export version for exported package %s", entry.getKey()); } } if (v != null) attributes.put(Constants.VERSION_ATTRIBUTE, cleanupVersion(v)); } }
version = Builder.cleanupVersion(version); analyzer.setProperty(Analyzer.BUNDLE_VERSION, version);
version = Builder.cleanupVersion(version); analyzer.setProperty(Analyzer.BUNDLE_VERSION, version);