From 13a6c34fb5ac9900592d3e36b7f661304336e70d Mon Sep 17 00:00:00 2001 From: BJ Hargrave Date: Tue, 24 May 2022 16:40:59 -0400 Subject: [PATCH 1/2] build: Use new ++ decoration to ensure literal is included Signed-off-by: BJ Hargrave --- cnf/build.bnd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cnf/build.bnd b/cnf/build.bnd index 64a59b2f16..f575a2500b 100644 --- a/cnf/build.bnd +++ b/cnf/build.bnd @@ -38,7 +38,7 @@ Bundle-Version: ${base.version}.${tstamp}-SNAPSHOT "org.osgi.namespace.*";~version=latest;~maven-scope=provided,\ "org.osgi.service.*.annotations";~version=latest;~maven-scope=provided --conditionalpackage+: \ +-conditionalpackage++: \ =!aQute.lib.exceptions.* -testpath+: \ From f3aead214d5b8364d3a629e65cd8e182582faef5 Mon Sep 17 00:00:00 2001 From: BJ Hargrave Date: Tue, 24 May 2022 16:54:20 -0400 Subject: [PATCH 2/2] decoration: Backward compatibility phase 2 Complete the changes by changing the `+` behavior back to not adding literals. Fixes https://github.com/bndtools/bnd/issues/5260 Signed-off-by: BJ Hargrave --- biz.aQute.bndlib/src/aQute/bnd/build/Project.java | 3 +-- biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java | 12 ++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/biz.aQute.bndlib/src/aQute/bnd/build/Project.java b/biz.aQute.bndlib/src/aQute/bnd/build/Project.java index d4115a1c6b..5aad432e4e 100644 --- a/biz.aQute.bndlib/src/aQute/bnd/build/Project.java +++ b/biz.aQute.bndlib/src/aQute/bnd/build/Project.java @@ -619,8 +619,7 @@ public List getBundles(Strategy strategyx, String spec, String source Parameters bundles = parseHeader(spec); if (source != null) { Instructions decorator = new Instructions(mergeProperties(source + "+")); - // TODO change the decorated call to remove the second arg. - decorator.decorate(bundles, true); + decorator.decorate(bundles); decorator = new Instructions(mergeProperties(source + "++")); decorator.decorate(bundles, true); } diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java index a33b797568..e4db48bc7d 100644 --- a/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java +++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java @@ -402,8 +402,7 @@ public boolean hasSources() { @Override protected Jar getExtra() throws Exception { Parameters conditionals = getMergedParameters(CONDITIONAL_PACKAGE); - // TODO change the decorated call to remove the second arg. - conditionals.putAll(decorated(CONDITIONALPACKAGE, true)); + conditionals.putAll(decorated(CONDITIONALPACKAGE)); if (conditionals.isEmpty()) return null; logger.debug("do Conditional Package {}", conditionals); @@ -629,11 +628,9 @@ private void doExpand(Jar dot) throws Exception { } Parameters private_package = getParameters(PRIVATE_PACKAGE); - // TODO change the decorated call to remove the second arg. - Parameters privatepackage = decorated(PRIVATEPACKAGE, true); + Parameters privatepackage = decorated(PRIVATEPACKAGE); Parameters testpackage = new Parameters(); - // TODO change the decorated call to remove the second arg. - Parameters includepackage = decorated(INCLUDEPACKAGE, true); + Parameters includepackage = decorated(INCLUDEPACKAGE); if (buildInstrs.undertest()) { String h = mergeProperties(Constants.TESTPACKAGES, "test;presence:=optional"); @@ -905,8 +902,7 @@ private Instruction matches(Instructions instructions, String pack, Set