+ }
+ if (!sequential)
+ CompletableFuture.allOf(toDos.toArray(new CompletableFuture[toDos.size()])).join();
+
+ // Summary
+ StringBuilder sb = new StringBuilder();
+ for (String licenseId : licensesUsed.keySet())
+ for (String name : licensesUsed.get(licenseId))
+ sb.append((licenseId.equals("") ? "Proprietary" : licenseId) + "\t\t" + name + "\n");
+ logger.log(INFO, "# License summary:\n" + sb);
+ }
+
+ /** MANIFEST headers. */
+ enum ManifestHeader {
+ // OSGi
+ /** OSGi bundle symbolic name. */
+ BUNDLE_SYMBOLICNAME("Bundle-SymbolicName"), //
+ /** OSGi bundle version. */
+ BUNDLE_VERSION("Bundle-Version"), //
+ /** OSGi bundle license. */
+ BUNDLE_LICENSE("Bundle-License"), //
+ /** OSGi exported packages list. */
+ EXPORT_PACKAGE("Export-Package"), //
+ /** OSGi imported packages list. */
+ IMPORT_PACKAGE("Import-Package"), //
+ /** OSGi path to embedded jar. */
+ BUNDLE_CLASSPATH("Bundle-Classpath"), //
+ // Java
+ /** Java module name. */
+ AUTOMATIC_MODULE_NAME("Automatic-Module-Name"), //
+ // Eclipse
+ /** Eclipse source bundle. */
+ ECLIPSE_SOURCE_BUNDLE("Eclipse-SourceBundle"), //
+ // SPDX
+ /**
+ * SPDX license identifier.
+ *
+ * @see https://spdx.org/licenses/
+ */
+ SPDX_LICENSE_IDENTIFIER("SPDX-License-Identifier"), //
+ // Argeo Origin
+ /**
+ * Maven coordinates of the origin, possibly partial when using common.bnd or
+ * merge.bnd.
+ */
+ ARGEO_ORIGIN_M2("Argeo-Origin-M2"), //
+ /** List of Maven coordinates to merge. */
+ ARGEO_ORIGIN_M2_MERGE("Argeo-Origin-M2-Merge"), //
+ /** Maven repository, if not the default one. */
+ ARGEO_ORIGIN_M2_REPO("Argeo-Origin-M2-Repo"), //
+ /**
+ * Do not perform BND analysis of the origin component. Typically Import_package
+ * and Export-Package will be kept untouched.
+ */
+ ARGEO_ORIGIN_NO_METADATA_GENERATION("Argeo-Origin-NoMetadataGeneration"), //
+// /**
+// * Embed the original jar without modifying it (may be required by some
+// * proprietary licenses, such as JCR Day License).
+// */
+// ARGEO_ORIGIN_EMBED("Argeo-Origin-Embed"), //
+ /**
+ * Do not modify original jar (may be required by some proprietary licenses,
+ * such as JCR Day License).
+ */
+ ARGEO_DO_NOT_MODIFY("Argeo-Origin-Do-Not-Modify"), //
+ /**
+ * Origin (non-Maven) URI of the component. It may be anything (jar, archive,
+ * etc.).
+ */
+ ARGEO_ORIGIN_URI("Argeo-Origin-URI"), //
+ /**
+ * Origin (non-Maven) URI of the source of the component. It may be anything
+ * (jar, archive, code repository, etc.).
+ */
+ ARGEO_ORIGIN_SOURCES_URI("Argeo-Origin-Sources-URI"), //
+ ;
+
+ final String headerName;
+
+ private ManifestHeader(String headerName) {
+ this.headerName = headerName;
+ }
+
+ @Override
+ public String toString() {
+ return headerName;
+ }
+
+ /** Get the value from either a {@link Manifest} or a {@link Properties}. */
+ String get(Object map) {
+ if (map instanceof Manifest manifest)
+ return manifest.getMainAttributes().getValue(headerName);
+ else if (map instanceof Properties props)
+ return props.getProperty(headerName);