private Map<String, Map<String, String>> getHeader(String string) { if (string == null) return Collections.emptyMap(); return parseHeader(getProperty(string)); }
private Map<String, Map<String, String>> getHeader(String string) { if (string == null) return Collections.emptyMap(); return parseHeader(getProperty(string)); }
private void doIncludeResource(Jar jar, String includes) throws Exception { Map<String, Map<String, String>> clauses = parseHeader(includes); doIncludeResource(jar, clauses); }
Map<Instruction, Map<String, String>> getMakeHeader() { if (make != null) return make; make = Processor.newMap(); String s = builder.getProperty(Builder.MAKE); Map<String, Map<String, String>> make = builder.parseHeader(s); for (Iterator<Map.Entry<String, Map<String, String>>> e = make .entrySet().iterator(); e.hasNext();) { Map.Entry<String, Map<String, String>> entry = e.next(); String pattern = Processor.removeDuplicateMarker(entry.getKey()); Instruction instr = Instruction.getPattern(pattern); this.make.put(instr, entry.getValue()); } return this.make; } }
Map<Instruction, Map<String, String>> getMakeHeader() { if (make != null) return make; make = Processor.newMap(); String s = builder.getProperty(Builder.MAKE); Map<String, Map<String, String>> make = builder.parseHeader(s); for (Iterator<Map.Entry<String, Map<String, String>>> e = make .entrySet().iterator(); e.hasNext();) { Map.Entry<String, Map<String, String>> entry = e.next(); String pattern = Processor.removeDuplicateMarker(entry.getKey()); Instruction instr = Instruction.getPattern(pattern); this.make.put(instr, entry.getValue()); } return this.make; } }
public Collection<File> getSourcePath() { if (firstUse) { firstUse = false; String sp = getProperty(SOURCEPATH); if (sp != null) { Map<String, Map<String, String>> map = parseHeader(sp); for (Iterator<String> i = map.keySet().iterator(); i.hasNext();) { String file = i.next(); if (!isDuplicate(file)) { File f = getFile(file); if (!f.isDirectory()) { error("Adding a sourcepath that is not a directory: " + f); } else { sourcePath.add(f); } } } } } return sourcePath; }
public Collection<File> getSourcePath() { if (firstUse) { firstUse = false; String sp = getProperty(SOURCEPATH); if (sp != null) { Map<String, Map<String, String>> map = parseHeader(sp); for (Iterator<String> i = map.keySet().iterator(); i.hasNext();) { String file = i.next(); if (!isDuplicate(file)) { File f = getFile(file); if (!f.isDirectory()) { error("Adding a sourcepath that is not a directory: " + f); } else { sourcePath.add(f); } } } } } return sourcePath; }
/** * Parse the Bundle-Includes header. Files in the bundles Include header are * included in the jar. The source can be a directory or a file. * * @throws IOException * @throws FileNotFoundException */ private void doIncludeResources(Jar jar) throws Exception { String includes = getProperty("Bundle-Includes"); if (includes == null) { includes = getProperty(INCLUDERESOURCE); if (includes == null) includes = getProperty("Include-Resource"); } else warning("Please use -includeresource instead of Bundle-Includes"); if (includes == null) return; Map<String, Map<String, String>> clauses = parseHeader(includes); for (Iterator<Map.Entry<String, Map<String, String>>> i = clauses .entrySet().iterator(); i.hasNext();) { Map.Entry<String, Map<String, String>> entry = i.next(); doIncludeResource(jar, entry.getKey(), entry.getValue()); } }
return builders; Map<String, Map<String, String>> subsMap = parseHeader(sub); for (Iterator<String> i = subsMap.keySet().iterator(); i.hasNext();) { File file = getFile(i.next());
ps.println(" <licenses>"); Map<String, Map<String, String>> map = parseHeader(licenses); for (Iterator<Map.Entry<String, Map<String, String>>> e = map .entrySet().iterator(); e.hasNext();) {
/** * Sign the jar file. * * -sign : <alias> [ ';' 'password:=' <password> ] [ ';' 'keystore:=' * <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )* * * @return */ void sign(Jar jar) throws Exception { String signing = getProperty("-sign"); if (signing == null) return; trace("Signing %s, with %s", getBsn(), signing); List<SignerPlugin> signers = getPlugins(SignerPlugin.class); Map<String, Map<String, String>> infos = parseHeader(signing); for (Map.Entry<String, Map<String, String>> entry : infos.entrySet()) { for (SignerPlugin signer : signers) { signer.sign(this, entry.getKey()); } } }
Map<String, Map<String, String>> clauses = parseHeader(getProperty(Constants.EXPORT_PACKAGE)); clauses.putAll(parseHeader(getProperty(Constants.PRIVATE_PACKAGE))); if (isTrue(getProperty(Constants.UNDERTEST))) { clauses.putAll(parseHeader(getProperty(Constants.TESTPACKAGES, "test;presence:=optional")));
/** * Sign the jar file. * * -sign : <alias> [ ';' 'password:=' <password> ] [ ';' 'keystore:=' * <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )* * * @return */ void sign(Jar jar) throws Exception { String signing = getProperty("-sign"); if (signing == null) return; trace("Signing %s, with %s", getBsn(), signing); List<SignerPlugin> signers = getPlugins(SignerPlugin.class); Map<String, Map<String, String>> infos = parseHeader(signing); for (Map.Entry<String, Map<String, String>> entry : infos.entrySet()) { for (SignerPlugin signer : signers) { signer.sign(this, entry.getKey()); } } }
Map<String, Map<String, String>> map = parseHeader(conduit); Jar[] result = new Jar[map.size()]; int n = 0;
Map<String, Map<String, String>> map = parseHeader(conduit); Jar[] result = new Jar[map.size()]; int n = 0; Set<Instruction> subs = replaceWitInstruction(parseHeader(sub), SUB) .keySet();
Map<String, Map<String, String>> clauses = parseHeader(getProperty(WABLIB)); for (String key : clauses.keySet()) { File f = getFile(key);
private void doExpand(Jar jar) throws IOException { if (getClasspath().size() == 0 && (getProperty(EXPORT_PACKAGE) != null || getProperty(PRIVATE_PACKAGE) != null)) warning("Classpath is empty. Private-Package and Export-Package can only expand from the classpath when there is one"); Map<Instruction, Map<String, String>> privateMap = replaceWitInstruction( getHeader(PRIVATE_PACKAGE), PRIVATE_PACKAGE); Map<Instruction, Map<String, String>> exportMap = replaceWitInstruction( getHeader(EXPORT_PACKAGE), EXPORT_PACKAGE); if (isTrue(getProperty(Constants.UNDERTEST))) { privateMap.putAll(replaceWitInstruction(parseHeader(getProperty( Constants.TESTPACKAGES, "test;presence:=optional")), TESTPACKAGES)); } if (!privateMap.isEmpty()) doExpand(jar, "Private-Package, or -testpackages", privateMap, true); if (!exportMap.isEmpty()) { Jar exports = new Jar("exports"); doExpand(exports, "Export-Package", exportMap, true); jar.addAll(exports); exports.close(); } if (privateMap.isEmpty() && exportMap.isEmpty() && !isResourceOnly()) { warning("Neither Export-Package, Private-Package, -testpackages is set, therefore no packages will be included"); } }
private void doExpand(Jar jar) throws IOException { if (getClasspath().size() == 0 && (getProperty(EXPORT_PACKAGE) != null || getProperty(EXPORT_PACKAGE) != null || getProperty(PRIVATE_PACKAGE) != null)) warning("Classpath is empty. Private-Package and Export-Package can only expand from the classpath when there is one"); Map<Instruction, Map<String, String>> privateMap = Instruction .replaceWithInstruction(getHeader(PRIVATE_PACKAGE)); Map<Instruction, Map<String, String>> exportMap = Instruction .replaceWithInstruction(getHeader(EXPORT_PACKAGE)); if (isTrue(getProperty(Constants.UNDERTEST))) { privateMap.putAll(Instruction.replaceWithInstruction(parseHeader(getProperty( Constants.TESTPACKAGES, "test;presence:=optional")))); } if (!privateMap.isEmpty()) doExpand(jar, "Private-Package, or -testpackages", privateMap, true); if (!exportMap.isEmpty()) { Jar exports = new Jar("exports"); doExpand(exports, EXPORT_PACKAGE, exportMap, true); jar.addAll(exports); exports.close(); } if (!isNoBundle()) { if (privateMap.isEmpty() && exportMap.isEmpty() && !isResourceOnly() && getProperty(EXPORT_CONTENTS) == null) { warning("None of Export-Package, Provide-Package, Private-Package, -testpackages, or -exportcontents is set, therefore no packages will be included"); } } }