From 8987af1dbc8abbcd8bdab9839611d8148a54215d Mon Sep 17 00:00:00 2001 From: BJ Hargrave Date: Tue, 27 Sep 2022 17:38:49 -0400 Subject: [PATCH] docs: Fix documentation for Metatype annotation processing instructions The docs referred to the old instruction name. Signed-off-by: BJ Hargrave --- .../src/aQute/bnd/osgi/Constants.java | 4 ++- docs/_instructions/dsannotations-options.md | 4 +-- docs/_instructions/dsannotations.md | 4 +-- docs/_instructions/metatype-options.md | 10 ------ docs/_instructions/metatype.md | 35 ------------------- .../metatypeannotations-options.md | 12 +++++++ docs/_instructions/metatypeannotations.md | 16 +++++++++ 7 files changed, 35 insertions(+), 50 deletions(-) delete mode 100644 docs/_instructions/metatype-options.md delete mode 100644 docs/_instructions/metatype.md create mode 100644 docs/_instructions/metatypeannotations-options.md create mode 100644 docs/_instructions/metatypeannotations.md diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/Constants.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/Constants.java index 66ea322bfc..52f48eeea4 100644 --- a/biz.aQute.bndlib/src/aQute/bnd/osgi/Constants.java +++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/Constants.java @@ -168,7 +168,6 @@ public interface Constants { String JAVA = "java"; String JAVA_DEBUG = "java.debug"; String MAKE = "-make"; - String METATYPE = "-metatype"; String METATYPE_ANNOTATIONS = "-metatypeannotations"; String METATYPE_ANNOTATIONS_OPTIONS = "-metatypeannotations-options"; String MANIFEST = "-manifest"; @@ -555,4 +554,7 @@ public interface Constants { /* * Deprecated Section */ + @Deprecated + String METATYPE = "-metatype"; + } diff --git a/docs/_instructions/dsannotations-options.md b/docs/_instructions/dsannotations-options.md index 728bf570d5..30a7734faf 100644 --- a/docs/_instructions/dsannotations-options.md +++ b/docs/_instructions/dsannotations-options.md @@ -1,6 +1,6 @@ --- layout: default -class: Project +class: Builder title: -dsannotations-options SELECTORS summary: Options for controlling DS annotation processing. --- @@ -12,7 +12,7 @@ The `-dsannotations-options` instruction configures how DS component annotations -dsannotations-options: version;minimum=1.2.0;maximum=1.3.0 ``` -The example above, will restrict the use of OSGi DS annotations to minimum 1.2.0 and maximum 1.3.0 version. The version number denotes that the users are free to use any version equal to or higher than 1.2.0 but less than or equal to 1.3.0, provided that the users have the SCR annotations included in the workspace. +The example above, will restrict the use of OSGi DS annotations to minimum 1.2.0 and maximum 1.3.0 version. The version number denotes that the users are free to use any version equal to or higher than 1.2.0 but less than or equal to 1.3.0, provided that the users have the DS annotations included on the build path. The following options are supported: diff --git a/docs/_instructions/dsannotations.md b/docs/_instructions/dsannotations.md index 2a49988107..6e17e8e6b9 100644 --- a/docs/_instructions/dsannotations.md +++ b/docs/_instructions/dsannotations.md @@ -1,8 +1,8 @@ --- layout: default -class: Project +class: Builder title: -dsannotations SELECTORS -summary: Selects the packages that need processing for standard OSGi DS annotations. +summary: Selects the packages that need processing for standard OSGi DS annotations. --- The `-dsannotations` instruction tells **bnd** which bundle classes, if any, to search for [Declarative Services (DS)](https://osgi.org/specification/osgi.cmpn/7.0.0/service.component.html) annotations. **bnd** will then process those classes into DS XML descriptors. diff --git a/docs/_instructions/metatype-options.md b/docs/_instructions/metatype-options.md deleted file mode 100644 index ce53cf20bf..0000000000 --- a/docs/_instructions/metatype-options.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: default -class: Project -title: -metatype-options SELECTORS -summary: Restricts the use of Metatype Annotation to a minimum version. ---- - - -metatype-options: version;minimum=1.2.0 - -Analogous to `-dsannotations-options`, this will also restrict the use of OSGi metatype annotations to minimum 1.2.0 version. The version number denotes that the users can use any version equal to or higher than 1.2.0, provided that the users have the metatype annotations included in the workspace. diff --git a/docs/_instructions/metatype.md b/docs/_instructions/metatype.md deleted file mode 100644 index 59e784d157..0000000000 --- a/docs/_instructions/metatype.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -layout: default -class: Builder -title: -metatype CLASS-SPEC ( ',' CLASS-SPEC )* -summary: Create metatype XML resources in the bundle based on the OCD annotations. ---- - - /** - * This class is responsible for meta type types. It is a plugin that can - * - * @author aqute - */ - public class MetatypePlugin implements AnalyzerPlugin { - - public boolean analyzeJar(Analyzer analyzer) throws Exception { - - Parameters map = analyzer.parseHeader(analyzer.getProperty(Constants.METATYPE)); - - Jar jar = analyzer.getJar(); - for (String name : map.keySet()) { - Collection metatypes = analyzer.getClasses("", QUERY.ANNOTATED.toString(), Meta.OCD.class.getName(), // - QUERY.NAMED.toString(), name // - ); - for (Clazz c : metatypes) { - jar.putResource("OSGI-INF/metatype/" + c.getFQN() + ".xml", new MetaTypeReader(c, analyzer)); - } - } - return false; - } - @Override - public String toString() { - return "MetatypePlugin"; - } - - } diff --git a/docs/_instructions/metatypeannotations-options.md b/docs/_instructions/metatypeannotations-options.md new file mode 100644 index 0000000000..9bbcbf4c09 --- /dev/null +++ b/docs/_instructions/metatypeannotations-options.md @@ -0,0 +1,12 @@ +--- +layout: default +class: Builder +title: -metatypeannotations-options SELECTORS +summary: Restricts the use of Metatype Annotation to a minimum version. +--- + +```properties +-metatypeannotations-options: version;minimum=1.2.0 +``` + +Analogous to `-dsannotations-options`, this will also restrict the use of OSGi Metatype annotations to minimum 1.2.0 version. The version number denotes that the users can use any version equal to or higher than 1.2.0, provided that the users have the Metatype annotations included on the build path. diff --git a/docs/_instructions/metatypeannotations.md b/docs/_instructions/metatypeannotations.md new file mode 100644 index 0000000000..78807a3b30 --- /dev/null +++ b/docs/_instructions/metatypeannotations.md @@ -0,0 +1,16 @@ +--- +layout: default +class: Builder +title: -metatypeannotations SELECTORS +summary: Selects the packages that need processing for standard OSGi Metatype annotations. +--- + +The `-metatypeannotations` instruction tells **bnd** which bundle classes, if any, to search for [Metatype Service](https://osgi.org/specification/osgi.cmpn/7.0.0/service.metatype.html) annotations. **bnd** will then process those classes into Metatype XML resources. + +The value of this instruction is a comma delimited list of fully qualified class names. + +The default value of this instruction is `*`, which means that by default **bnd** will process all bundle classes looking for Metatype annotations. + +The behavior of Metatype annotation processing can be further configured using the [-metatypeannotations-options](metatypeannotations-options.html) instruction. + +[source](https://github.com/bndtools/bnd/blob/master/biz.aQute.bndlib/src/aQute/bnd/metatype/MetatypeAnnotations.java) \ No newline at end of file