You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by an...@apache.org on 2019/06/07 22:47:33 UTC

[sling-org-apache-sling-feature-modelconverter] branch standalone-app updated: Some adjustments to the wording of the CLI and updates of the Readme file

This is an automated email from the ASF dual-hosted git repository.

andysch pushed a commit to branch standalone-app
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-modelconverter.git


The following commit(s) were added to refs/heads/standalone-app by this push:
     new 167546b  Some adjustments to the wording of the CLI and updates of the Readme file
167546b is described below

commit 167546b3adfb4a68b26902aa12d1ee37a60e4636
Author: Andreas Schaefer <sc...@iMac.local>
AuthorDate: Fri Jun 7 15:47:15 2019 -0700

    Some adjustments to the wording of the CLI and updates of the Readme file
---
 readme.md                                          | 54 +++++++++++++++-------
 .../apache/sling/feature/modelconverter/Main.java  | 20 ++++----
 2 files changed, 48 insertions(+), 26 deletions(-)

diff --git a/readme.md b/readme.md
index 813a661..17f0014 100644
--- a/readme.md
+++ b/readme.md
@@ -59,30 +59,34 @@ $ ./bin/pm2fm -h
 Usage: pm2fm [-DhV] [-g=<groupId>] -i=<provisioningModelsInputDirectory>
              [-n=<name>] -o=<featureModelsOutputDirectory> [-v=<version>]
              [-a=<addFrameworkProperties>]... [-d=<dropVariables>]...
+             [-e=<excludeBundles>]... [-r=<runModes>]...
 Apache Sling Provisioning Model to Sling Feature Model converter
-  -a, --addFrameworkProperties=<addFrameworkProperties>
-                             Adds Framework Properties to Feature Models. Format:
-                               <Model Name>:<Property Name>=<value>
-  -d, --dropVariables=<dropVariables>
-                             All matching Variables (by name) in a Feature Model are
-                               dropped
+  -a, --addFrameworkProperty=<addFrameworkProperties>
+                             Adds Framework Property to Feature Models. Format:
+                               <Model Name>:<Property Name>=<value> (repeat for more)
+  -d, --dropVariable=<dropVariables>
+                             Variable (by name) in a Feature Model to be excluded
+                               (repeat for more)
   -D, --noProvisioningModelName
-                             If flagged then the Provisioning Model Name is not
-                               added'
+                             If flagged then the Provisioning Model Name is not added
+  -e, --excludeBundle=<excludeBundles>
+                             Bundle and/or Bundle Configuration to be excluded
+                               (repeat for more)
   -g, --group-id=<groupId>   Overwriting the Group Id of the Model ID
-  -h, --help                 Display the usage message.
+  -h, --help                 Display the usage message
   -i, --provisining-input-directory=<provisioningModelsInputDirectory>
-                             The input directory where the Provisioning File are.
-  -n, --name=<name>          Sets a general Name for all converted Models. This also
+                             The input directory where the Provisioning File are
+  -n, --name=<name>          Sets a General Name for all converted Models. This also
                                means that the name is placed in the classifier
   -o, --features-output-directory=<featureModelsOutputDirectory>
                              The output directory where the Feature File will be
-                               generated.
+                               generated in
+  -r, --runMode=<runModes>   Runmode to add to this build (all no-runmodes are
+                               included by default, repeat for more)
   -v, --version=<version>    Overwriting the Version of the Model ID
   -V, --useProvidedVersion   If flagged then the provided version will override any
-                               given version from Provisioning Model'
-Copyright(c) 2019 The Apache Software Foundation.
-```
+                               given version from Provisioning Model
+Copyright(c) 2019 The Apache Software Foundation.```
 
 to see all the available options; a sample execution could look like:
 
@@ -96,9 +100,19 @@ $sh ./bin/pm2fm \
     -n "\${project.artifactId}" \
     -D \
     -a "launchpad:felix.systempackages.substitution=true" \
-    -a "launchpad:felix.systempackages.calculate.uses=true"
+    -a "launchpad:felix.systempackages.calculate.uses=true" \
+    -r ":standalone" \
+    -r "oak_tar"
 ```
 
+**Attention**: the current Model Converter is adding runmode bundles and
+configurations with a **id** that has a suffix of **.runmode.<runmode name>**
+which will not work with the Feature Launcher as the Feature Model does not
+support runtime selection / configuration.
+The **-r** argument provides the ability to select the desired runmodes which
+then does not add the suffix to the id and drop all other runmodes. See
+SLING-8479 for more on this.
+
 **Note**: this will generate all the Feature Models for the current Sling
 Provisioning (Sling (PM) Starter). The groupId, artifactId and version is
 set to a placeholder and with it the model name is placed inside the classifier.
@@ -126,6 +140,14 @@ Argument Files for Long Command Lines:
 # Add Launchpad Framework Properties to make bundles with Java dependencies activate
 -a "launchpad:felix.systempackages.substitution=true"
 -a "launchpad:felix.systempackages.calculate.uses=true"
+# Exclude Lauchpad Installer (provided by the feature launcher) and Repository
+# Initializer as this is embedded in the configuration file
+-e "org.apache.sling.launchpad.installer"
+-e "org.apache.sling.jcr.repoinit.impl.RepositoryInitializer"
+# This is a build for the standalone OAK Segment Node Store which needs
+# these two runmodes but we dropped all others like :webapp or oak_mongo
+-r "oak_tar"
+-r ":standalone"
 ```
 
 then execute the command
diff --git a/src/main/java/org/apache/sling/feature/modelconverter/Main.java b/src/main/java/org/apache/sling/feature/modelconverter/Main.java
index 052bfc1..4475089 100644
--- a/src/main/java/org/apache/sling/feature/modelconverter/Main.java
+++ b/src/main/java/org/apache/sling/feature/modelconverter/Main.java
@@ -41,13 +41,13 @@ public class Main implements Runnable {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(Main.class);
 
-    @Option(names = { "-h", "--help" }, usageHelp = true, description = "Display the usage message.")
+    @Option(names = { "-h", "--help" }, usageHelp = true, description = "Display the usage message")
     private boolean helpRequested;
 
-    @Option(names = { "-i", "--provisining-input-directory" }, description = "The input directory where the Provisioning File are.", required = true)
+    @Option(names = { "-i", "--provisining-input-directory" }, description = "The input directory where the Provisioning File are", required = true)
     private File provisioningModelsInputDirectory;
 
-    @Option(names = { "-o", "--features-output-directory" }, description = "The output directory where the Feature File will be generated.", required = true)
+    @Option(names = { "-o", "--features-output-directory" }, description = "The output directory where the Feature File will be generated in", required = true)
     private File featureModelsOutputDirectory;
 
     @Option(names = { "-g", "--group-id" }, description = "Overwriting the Group Id of the Model ID")
@@ -56,25 +56,25 @@ public class Main implements Runnable {
     @Option(names = { "-v", "--version" }, description = "Overwriting the Version of the Model ID")
     private String version;
 
-    @Option(names = { "-V", "--useProvidedVersion" }, description = "If flagged then the provided version will override any given version from Provisioning Model'")
+    @Option(names = { "-V", "--useProvidedVersion" }, description = "If flagged then the provided version will override any given version from Provisioning Model")
     private boolean useProvidedVersion;
 
-    @Option(names = { "-n", "--name" }, description = "Sets a general Name for all converted Models. This also means that the name is placed in the classifier")
+    @Option(names = { "-n", "--name" }, description = "Sets a General Name for all converted Models. This also means that the name is placed in the classifier")
     private String name;
 
-    @Option(names = { "-d", "--dropVariables" }, description = "All matching Variables (by name) in a Feature Model are dropped")
+    @Option(names = { "-d", "--dropVariable" }, description = "Variable (by name) in a Feature Model to be excluded (repeat for more)")
     private List<String> dropVariables;
 
-    @Option(names = { "-a", "--addFrameworkProperties" }, description = "Adds Framework Properties to Feature Models. Format: <Model Name>:<Property Name>=<value>")
+    @Option(names = { "-a", "--addFrameworkProperty" }, description = "Adds Framework Property to Feature Models. Format: <Model Name>:<Property Name>=<value> (repeat for more)")
     private List<String> addFrameworkProperties;
 
-    @Option(names = { "-D", "--noProvisioningModelName" }, description = "If flagged then the Provisioning Model Name is not added'")
+    @Option(names = { "-D", "--noProvisioningModelName" }, description = "If flagged then the Provisioning Model Name is not added")
     private boolean noProvisioningModelName;
 
-    @Option(names = { "-e", "--excludeBundles" }, description = "List of Bundles and Bundle Configurations to be excluded'")
+    @Option(names = { "-e", "--excludeBundle" }, description = "Bundle and/or Bundle Configuration to be excluded (repeat for more)")
     private List<String> excludeBundles;
 
-    @Option(names = { "-r", "--runModes" }, description = "List of Runmodes of the Feature Model. If set only configuration with that runmodes are used w/o a .runmdoes. suffix")
+    @Option(names = { "-r", "--runMode" }, description = "Runmode to add to this build (all no-runmodes are included by default, repeat for more)")
     private List<String> runModes;
 
     private Pattern pattern = Pattern.compile("^(.*?):(.*?)=(.*?)$");