-# Common
-Bundle-Version: ${MAJOR}.${MINOR}.${MICRO}${qualifier}
-Private-Package: *.internal.*, config.*
-Export-Package: !*.internal.*, !config.*, *
+Bundle-Version: ${major}.${minor}.${micro}${qualifier}
+Export-Package: !*.internal.*, !config.*, !icons.*, !css.*, !swt.*, !rap.*, *
Bundle-RequiredExecutionEnvironment=JavaSE-17
#-consumer-policy : ${range;[==,=+)}
-contract: !JavaServlet,*
--savemanifest : META-INF/MANIFEST.MF
--includeresource.default : bin,OSGI-INF/=-OSGI-INF/,e4xmi/=-e4xmi/,icons/=-icons/,img/=-img/
--compression STORE
--source true
-removeheaders = Bnd-LastModified,Build-Jdk,Built-By,Tool,Created-By
-Automatic-Module-Name: ${bsn}
-SLC-Category=${category}
--groupid=${category}
+Automatic-Module-Name: ${bsn}
\ No newline at end of file
BUILD_BASE = $(SDK_BUILD_BASE)/$(shell basename $(SDK_SRC_BASE))
-TARGET_BUNDLES = $(abspath $(foreach bundle, $(BUNDLES),$(A2_OUTPUT)/$(shell dirname $(bundle))/$(A2_CATEGORY)/$(shell basename $(bundle)).$(MAJOR).$(MINOR).jar))
+TARGET_BUNDLES = $(abspath $(foreach bundle, $(BUNDLES),$(A2_OUTPUT)/$(shell dirname $(bundle))/$(A2_CATEGORY)/$(shell basename $(bundle)).$(major).$(minor).jar))
TODOS = $(foreach bundle, $(BUNDLES),$(BUILD_BASE)/$(bundle)/to-build)
## Needed in order to be able to expand $$ variables
# Actual build (compilation + bundle packaging)
$(BUILD_BASE)/built : BUNDLES_TO_BUILD = $(subst $(abspath $(BUILD_BASE))/,, $(subst to-build,, $?))
$(BUILD_BASE)/built : $(TODOS)
- $(ARGEO_MAKE) all --a2-bases $(A2_BASE) --dep-categories $(DEP_CATEGORIES) --category $(A2_CATEGORY) --bundles $(BUNDLES_TO_BUILD)
+ $(ARGEO_MAKE) all --branch $(BRANCH) --a2-bases $(A2_BASE) --dep-categories $(DEP_CATEGORIES) --category $(A2_CATEGORY) --bundles $(BUNDLES_TO_BUILD)
touch $(BUILD_BASE)/built
-$(A2_OUTPUT)/%.$(MAJOR).$(MINOR).jar : $(BUILD_BASE)/$$(subst $(A2_CATEGORY)/,,$$*)/to-build
- $(ARGEO_MAKE) all --a2-bases $(A2_BASE) --dep-categories $(DEP_CATEGORIES) --category $(A2_CATEGORY) --bundles $(subst $(A2_CATEGORY)/,,$*)
+$(A2_OUTPUT)/%.$(major).$(minor).jar : $(BUILD_BASE)/$$(subst $(A2_CATEGORY)/,,$$*)/to-build
+ $(ARGEO_MAKE) all --branch $(BRANCH) --a2-bases $(A2_BASE) --dep-categories $(DEP_CATEGORIES) --category $(A2_CATEGORY) --bundles $(subst $(A2_CATEGORY)/,,$*)
$(BUILD_BASE)/%/to-build : $$(shell find $(SDK_SRC_BASE)/% -type f -not -path 'bin/*' -not -path '*/MANIFEST.MF')
@rm -rf $(dir $@)
return;
List<String> categories = options.get("--category");
- Objects.requireNonNull(bundles, "--bundles argument must be set");
+ Objects.requireNonNull(bundles, "--category argument must be set");
if (categories.size() != 1)
- throw new IllegalArgumentException("One and only one category must be specified");
+ throw new IllegalArgumentException("One and only one --category must be specified");
String category = categories.get(0);
+ List<String> branches = options.get("--branch");
+ if (branches.size() != 1)
+ throw new IllegalArgumentException("One and only one --branch must be specified");
+ String branch = branches.get(0);
+
long begin = System.currentTimeMillis();
// create jars in parallel
List<CompletableFuture<Void>> toDos = new ArrayList<>();
for (String bundle : bundles) {
toDos.add(CompletableFuture.runAsync(() -> {
try {
- createBundle(bundle, category);
+ createBundle(branch, bundle, category);
} catch (IOException e) {
throw new RuntimeException("Packaging of " + bundle + " failed", e);
}
* UTILITIES
*/
/** Package a single bundle. */
- void createBundle(String bundle, String category) throws IOException {
+ void createBundle(String branch, String bundle, String category) throws IOException {
Path source = execDirectory.resolve(bundle);
Path compiled = buildBase.resolve(bundle);
String bundleSymbolicName = source.getFileName().toString();
try (InputStream in = Files.newInputStream(argeoBnd)) {
properties.load(in);
}
- // FIXME make it configurable
- Path branchBnd = sdkSrcBase.resolve("cnf/unstable.bnd");
+
+ Path branchBnd = sdkSrcBase.resolve("sdk/branches/" + branch + ".bnd");
try (InputStream in = Files.newInputStream(branchBnd)) {
properties.load(in);
}
throw new RuntimeException("Bnd analysis of " + compiled + " failed", e);
}
- String major = properties.getProperty("MAJOR");
- Objects.requireNonNull(major, "MAJOR must be set");
- String minor = properties.getProperty("MINOR");
- Objects.requireNonNull(minor, "MINOR must be set");
+ String major = properties.getProperty("major");
+ Objects.requireNonNull(major, "'major' must be set");
+ String minor = properties.getProperty("minor");
+ Objects.requireNonNull(minor, "'minor' must be set");
// Write manifest
Path manifestP = compiled.resolve("META-INF/MANIFEST.MF");
+ (jvmUptime % 1000) + " s");
} catch (Exception e) {
long jvmUptime = ManagementFactory.getRuntimeMXBean().getUptime();
- logger.log(ERROR,
- "Make.java action '" + action + "' failed after " + (jvmUptime / 1000) + "." + (jvmUptime % 1000) + " s",
- e);
+ logger.log(ERROR, "Make.java action '" + action + "' failed after " + (jvmUptime / 1000) + "."
+ + (jvmUptime % 1000) + " s", e);
System.exit(1);
}
}