-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Autogenerate config.ini before framework startup (#5351)
* feat: Autogenerate config.ini before framework startup Signed-off-by: Nicola Timeus <[email protected]> * fixed typos --------- Signed-off-by: Nicola Timeus <[email protected]>
- Loading branch information
1 parent
1dec568
commit 651dd03
Showing
7 changed files
with
1,390 additions
and
1,344 deletions.
There are no files selected for viewing
2,590 changes: 1,278 additions & 1,312 deletions
2,590
kura/distrib/src/main/ant/build_equinox_distrib.xml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/sh | ||
|
||
TEMPLATE=$1 | ||
ROOT=$2 | ||
|
||
usage() { | ||
>&2 echo "Usage: gen_config_ini.sh <config.ini template> <plugin root directory>" | ||
} | ||
|
||
abspath() { | ||
cd "${1}" || exit 1 | ||
RESULT="${PWD}" | ||
cd "${OLDPWD}" || exit 1 | ||
echo "${RESULT}" | ||
} | ||
|
||
if ! [ -e "${TEMPLATE}" ] | ||
then | ||
>&2 echo "config.ini template not found" | ||
usage | ||
exit 1 | ||
fi | ||
|
||
if ! [ -d "${ROOT}" ] | ||
then | ||
>&2 echo "plugin root directory not found" | ||
usage | ||
exit 1 | ||
fi | ||
|
||
ROOT=$(abspath "${ROOT}") | ||
|
||
OSGI_BUNDLES= | ||
|
||
for DIR_PATH in "${ROOT}"/* | ||
do | ||
DIR_NAME=$(basename -- "${DIR_PATH}") | ||
|
||
if [ "${#DIR_NAME}" = 0 ] || [ "${#DIR_NAME}" -gt 2 ] || ! [ -d "${DIR_PATH}" ] | ||
then | ||
continue | ||
fi | ||
|
||
if ! expr "${DIR_NAME}" : '^[0-9]\{1,\}s\{0,1\}$' > /dev/null | ||
then | ||
continue | ||
fi | ||
|
||
START_LEVEL="${DIR_NAME%s}" | ||
|
||
if [ "${#DIR_NAME}" = "${#START_LEVEL}" ] | ||
then | ||
START= | ||
else | ||
START="\:start" | ||
fi | ||
|
||
for JAR in "${DIR_PATH}"/*.jar | ||
do | ||
if [ -n "${OSGI_BUNDLES}" ] | ||
then | ||
OSGI_BUNDLES="${OSGI_BUNDLES}," | ||
fi | ||
|
||
OSGI_BUNDLES="${OSGI_BUNDLES}reference\:file\:${JAR}@${START_LEVEL}${START}" | ||
done | ||
|
||
done | ||
|
||
cat "${TEMPLATE}" | ||
echo | ||
echo "osgi.bundles=${OSGI_BUNDLES}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.