private void buildRequireCapability(Analyzer analyzer) { String requireCapability = analyzer.getProperty(REQUIRE_CAPABILITY); if (requireCapability == null) { analyzer.setProperty(REQUIRE_CAPABILITY, DM_RUNTIME_CAPABILITY); } else { StringBuilder sb = new StringBuilder(requireCapability).append(",").append(DM_RUNTIME_CAPABILITY); analyzer.setProperty(REQUIRE_CAPABILITY, sb.toString()); } } }
public void putAll(Map<String, String> additional, boolean force) { for (Iterator<Map.Entry<String, String>> i = additional.entrySet() .iterator(); i.hasNext();) { Map.Entry<String, String> entry = i.next(); if (force || getProperties().get(entry.getKey()) == null) setProperty(entry.getKey(), entry.getValue()); } }
private void buildImportExportService(Analyzer analyzer, String header, Set<String> services) { m_logger.info("building %s header with the following services: %s", header, services); if (services.size() > 0) { StringBuilder sb = new StringBuilder(); for (String service : services) { sb.append(service); sb.append(","); } sb.setLength(sb.length() - 1); // skip last comma analyzer.setProperty(header, sb.toString()); } }
public void putAll(Map<String,String> additional, boolean force) { for (Iterator<Map.Entry<String,String>> i = additional.entrySet().iterator(); i.hasNext();) { Map.Entry<String,String> entry = i.next(); if (force || getProperties().get(entry.getKey()) == null) setProperty(entry.getKey(), entry.getValue()); } }
private static void setPackageOptions(Analyzer analyzer) { analyzer.setProperty(Analyzer.IMPORT_PACKAGE, "*;resolution:=optional"); String export = analyzer.calculateExportsFromContents(analyzer.getJar()); analyzer.setProperty(Analyzer.EXPORT_PACKAGE, export); }
public void putAll(Map<String,String> additional, boolean force) { for (Iterator<Map.Entry<String,String>> i = additional.entrySet().iterator(); i.hasNext();) { Map.Entry<String,String> entry = i.next(); if (force || getProperties().get(entry.getKey()) == null) setProperty(entry.getKey(), entry.getValue()); } }
public void putAll(Map<String, String> additional, boolean force) { for (Iterator<Map.Entry<String, String>> i = additional.entrySet() .iterator(); i.hasNext();) { Map.Entry<String, String> entry = i.next(); if (force || getProperties().get(entry.getKey()) == null) setProperty(entry.getKey(), entry.getValue()); } }
private static void setBundleOptions(Analyzer analyzer, ArtifactBundlerInstructions instructions) { analyzer.setProperty(Analyzer.BUNDLE_SYMBOLICNAME, instructions.getSymbolicNameWithOptions()); if (analyzer.getProperty(Analyzer.BUNDLE_NAME) == null) { // in case name was not set in the instructions analyzer.setProperty(Analyzer.BUNDLE_NAME, instructions.getName()); } analyzer.setProperty(Analyzer.BUNDLE_VERSION, instructions.getVersion()); analyzer.setProperty(TOOL_KEY, TOOL); }
public void putAll(Map<String,String> additional, boolean force) { for (Iterator<Map.Entry<String,String>> i = additional.entrySet().iterator(); i.hasNext();) { Map.Entry<String,String> entry = i.next(); if (force || getProperties().get(entry.getKey()) == null) setProperty(entry.getKey(), entry.getValue()); } }
/** * Check if mandatory properties are present, otherwise generate default. * * @param analyzer bnd analyzer * @param jar bnd jar * @param symbolicName bundle symbolic name */ private void checkMandatoryProperties( final Analyzer analyzer, final Jar jar, final String symbolicName ) { final String localSymbolicName = analyzer.getProperty( Analyzer.BUNDLE_SYMBOLICNAME, symbolicName ); analyzer.setProperty( Analyzer.BUNDLE_SYMBOLICNAME, generateSymbolicName( localSymbolicName ) ); }
/** * 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("@"); } }
/** * 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("@"); } }
@Override public boolean analyzeJar(Analyzer analyzer) throws Exception { ComponentMaker m = new ComponentMaker(analyzer); Set<String> l = m.doServiceComponent() .keySet(); List<String> names = DSAnnotations.removeOverlapInServiceComponentHeader(l); analyzer.setProperty(Constants.SERVICE_COMPONENT, Strings.join(names)); analyzer.getInfo(m, Constants.SERVICE_COMPONENT + ": "); m.close(); return false; }
@Override public boolean analyzeJar(Analyzer analyzer) throws Exception { ComponentMaker m = new ComponentMaker(analyzer); Set<String> l = m.doServiceComponent() .keySet(); List<String> names = DSAnnotations.removeOverlapInServiceComponentHeader(l); analyzer.setProperty(Constants.SERVICE_COMPONENT, Strings.join(names)); analyzer.getInfo(m, Constants.SERVICE_COMPONENT + ": "); m.close(); return false; }
public boolean analyzeJar(Analyzer analyzer) throws Exception { ComponentMaker m = new ComponentMaker(analyzer); Map<String,Map<String,String>> l = m.doServiceComponent(); analyzer.setProperty(Constants.SERVICE_COMPONENT, Processor.printClauses(l)); analyzer.getInfo(m, "Service-Component: "); m.close(); return false; }
public boolean analyzeJar(Analyzer analyzer) throws Exception { ComponentMaker m = new ComponentMaker(analyzer); Map<String,Map<String,String>> l = m.doServiceComponent(); analyzer.setProperty(Constants.SERVICE_COMPONENT, Processor.printClauses(l)); analyzer.getInfo(m, Constants.SERVICE_COMPONENT + ": "); m.close(); return false; }
public boolean analyzeJar(Analyzer analyzer) throws Exception { ComponentMaker m = new ComponentMaker(analyzer); Map<String,Map<String,String>> l = m.doServiceComponent(); analyzer.setProperty(Constants.SERVICE_COMPONENT, Processor.printClauses(l)); analyzer.getInfo(m, Constants.SERVICE_COMPONENT + ": "); m.close(); return false; }
String applyVersionPolicy(String exportVersion, String importRange, boolean provider) { try { setProperty("@", exportVersion); if (importRange != null) { importRange = cleanupVersion(importRange); importRange = getReplacer().process(importRange); } else importRange = getVersionPolicy(provider); } finally { unsetProperty("@"); } return importRange; }
String applyVersionPolicy(String exportVersion, String importRange, boolean provider) { try { setProperty("@", exportVersion); if (importRange != null) { importRange = cleanupVersion(importRange); importRange = getReplacer().process(importRange); } else importRange = getVersionPolicy(provider); } finally { unsetProperty("@"); } return importRange; }
String applyVersionPolicy(String exportVersion, String importRange, boolean provider) { try { setProperty("@", exportVersion); if (importRange != null) { importRange = cleanupVersion(importRange); importRange = getReplacer().process(importRange); } else importRange = getVersionPolicy(provider); } finally { unsetProperty("@"); } return importRange; }