diff --git a/java/com.sap.sailing.feature.p2build/raceanalysis.product b/java/com.sap.sailing.feature.p2build/raceanalysis.product index 01cef651b1f..be689b47a6a 100755 --- a/java/com.sap.sailing.feature.p2build/raceanalysis.product +++ b/java/com.sap.sailing.feature.p2build/raceanalysis.product @@ -42,10 +42,10 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -76,6 +76,7 @@ + diff --git a/java/com.sap.sailing.feature.p2build/scripts/README b/java/com.sap.sailing.feature.p2build/scripts/README new file mode 100644 index 00000000000..091c46591a6 --- /dev/null +++ b/java/com.sap.sailing.feature.p2build/scripts/README @@ -0,0 +1,5 @@ +Scripts that may help to convert an OSGi .launch configuration into the autostart configuration section +for the .product file. + +Other scripts may help in adjusting the .launch configuration's start level and autostart settings to +what is defined in the .product file. diff --git a/java/com.sap.sailing.feature.p2build/scripts/analyzeLaunch.sh b/java/com.sap.sailing.feature.p2build/scripts/analyzeLaunch.sh new file mode 100755 index 00000000000..6e54a0d1415 --- /dev/null +++ b/java/com.sap.sailing.feature.p2build/scripts/analyzeLaunch.sh @@ -0,0 +1,8 @@ +#!/bin/bash +target_bundles=$(cat "$1" | grep 'key="target_bundles"' | sed -e 's/^.* value="\([^"]*\)"\/>/\1/' | sed -e 's/,/\n/g' | sed -e 's/^\(.*\)@\(.*\):\(.*\)$/\1 \2 \3/') +workspace_bundles=$(cat "$1" | grep 'key="workspace_bundles"' | sed -e 's/^.* value="\([^"]*\)"\/>/\1/' | sed -e 's/,/\n/g' | sed -e 's/^\(.*\)@\(.*\):\(.*\)$/\1 \2 \3/') +echo " *** Target Bundles ***" +echo "$target_bundles" | sort +echo " *** Workspace Bundles ***" +echo "$workspace_bundles" | sort + diff --git a/java/com.sap.sailing.feature.p2build/scripts/analyzeProduct.sh b/java/com.sap.sailing.feature.p2build/scripts/analyzeProduct.sh new file mode 100755 index 00000000000..2f215b8497d --- /dev/null +++ b/java/com.sap.sailing.feature.p2build/scripts/analyzeProduct.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# Call like this: analyzeProduct.sh [] +# Will output two lines in format +# +# +# If a launch configuration file is provided as the second argument, it will be patched in-place by +# replacing the workspace_bundles and target_bundles string attributes by those generated by this script. + +# The product consists of the features and plugins it lists. Its section overrides +# the startLevel and autoStart defaults (4 / false) for a subset of the bundle list obtained from +# the features and plugins lists. The features that our product consists of are partitioned into +# ".runtime" and non-".runtime" features. The ".runtime" features obtain their bundles from the +# target platform, whereas the non-".runtime" features take their features from the workspace. + +# In order to derive the target/workspace bundles for a launch configuration, the bundles are +# extracted from the features. Those from the .runtime features are assigned to the target_bundles +# attribute, the others to the workspace_bundles attribute. Auto start and start level information +# will be set to default:default unless the bundle occurs in the section of the +# .product definition in which case the start level and auto start values are copied from the +# .product's section. + +GIT_ROOT=`dirname $0`/../../.. +echo "GIT ROOT: $GIT_ROOT" +features=$(cat "$1" | grep "feature id=" | sed -e 's/^.*feature id="\([^"]*\)".*$/\1/') +echo ' *** Features ***' +echo "$features" +feature_xml_files=$(for i in $features; do echo "${GIT_ROOT}/java/$i/feature.xml"; done) +echo "$feature_xml_files" +# Determine the bundles with a specific configuration in the .product file: +autostart_bundles=$(cat "$1" | grep "plugin id=.* startLevel=" | sed -e 's/^.* id="\(.*\)" autoStart="\(.*\)" startLevel="\([0-9]*\)".*$/\1 \3 \2/') +echo ' *** Autostart Bundles ***' +echo "$autostart_bundles" +# These autostart bundles need to be updated accordingly in the .launch configuration +# so they have the correct startLevel and autostart settings. The autostart bundles +# may occur either in the target_bundles or the workspace_bundles attribute in the .launch +# configuration. All other entries in the .launch configuration are set to @default:default. +# Now collect the bundles from the feature.xml files, split by workspace vs. target: +for feature in $features; do + feature_xml_file=${GIT_ROOT}/java/$feature/feature.xml + bundles_in_feature=$(cat "$feature_xml_file" | grep "id=\"" | grep -v "id=\"$feature\"" | sed -e 's/^.*id="\([^"]*\)".*$/\1/') + echo ' *** Bundles in feature' $feature '***' + echo "$bundles_in_feature" + for bundle in $bundles_in_feature; do + # find out whether we have a non-default configuration for the bundle + echo "$autostart_bundles" | grep -q '^'${bundle}' [^ ]* [^ ]*$' + if [ "$?" == "0" ]; then + # found a configuration for the bundle + echo ' *** Found a non-default configuration for bundle '${bundle}' ***' + bundle_spec_for_launch=$(echo "$autostart_bundles" | grep '^'${bundle}' [^ ]* [^ ]*$' | sed -e 's/^\([^ ]*\) \([^ ]*\) \([^ ]*\)$/\1@\2:\3/') + else + bundle_spec_for_launch="${bundle}@default:default" + fi + if [[ $feature =~ .runtime$ ]]; then + # contribute to target_bundles + target_bundles="${target_bundles},${bundle_spec_for_launch}" + else + # contribute to workspace_bundles + workspace_bundles="${workspace_bundles},${bundle_spec_for_launch}" + fi + done +done +echo ' *** Target Bundles ***' +echo "" +echo ' *** Workspace Bundles ***' +echo "" +# Now patch the .launch file if provided +if [ $# -ge 2 ]; then + echo "Patching $2 ..." + sed -i 's// - - - - - - - - diff --git a/java/com.sap.sailing.feature/feature.xml b/java/com.sap.sailing.feature/feature.xml index 1a126624cb7..512f5a17b60 100755 --- a/java/com.sap.sailing.feature/feature.xml +++ b/java/com.sap.sailing.feature/feature.xml @@ -430,4 +430,19 @@ Computes leaderboard information for sailing races and offers RESTful APIs to al version="0.0.0" unpack="false"/> + + + + diff --git a/java/com.sap.sailing.server.gateway.serialization.test/.settings/org.eclipse.jdt.core.prefs b/java/com.sap.sailing.server.gateway.serialization.test/.settings/org.eclipse.jdt.core.prefs index 0c68a61dca8..87b7a7a3a60 100755 --- a/java/com.sap.sailing.server.gateway.serialization.test/.settings/org.eclipse.jdt.core.prefs +++ b/java/com.sap.sailing.server.gateway.serialization.test/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,13 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=1.8 diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy).launch b/java/com.sap.sailing.server/SailingServer (No Proxy).launch index 1c4a0cd72e0..2a528b1578e 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy).launch @@ -9,7 +9,7 @@ - + diff --git a/java/com.sap.sse.feature.runtime/feature.xml b/java/com.sap.sse.feature.runtime/feature.xml index d3afcef8d9e..9d5526345a7 100644 --- a/java/com.sap.sse.feature.runtime/feature.xml +++ b/java/com.sap.sse.feature.runtime/feature.xml @@ -410,14 +410,6 @@ version="1.2.0.v20170105-1446" unpack="false"/> - - + + diff --git a/java/com.sap.sse.feature/feature.xml b/java/com.sap.sse.feature/feature.xml index 13bff187ab2..d5ef10025be 100644 --- a/java/com.sap.sse.feature/feature.xml +++ b/java/com.sap.sse.feature/feature.xml @@ -164,4 +164,60 @@ Computes leaderboard information for sailing races and offers RESTful APIs to al version="0.0.0" unpack="false"/> + + + + + + + + + + + + + + + +