Skip to content

Commit

Permalink
gh-685: Change space sep in auto start bundle to comma seperator
Browse files Browse the repository at this point in the history
  • Loading branch information
pnoltes committed May 30, 2024
1 parent 0566315 commit b8c6ab5
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 83 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ limitations under the License.
to add service properties with the correct type.
- Celix C++ Exception are now defined in the `celix/exceptions.h` header file. The `celix/Exception.h`
and `celix/IOException.h` are removed.
- The seperator for `CELIX_AUTO_START_0` .. `CELIX_AUTO_START_6` and `CELIX_AUTO_INSTALL` is now a comma instead of a
space.

## New Features

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"CELIX_AUTO_START_1":"@rsa_bundle_file@ @discovery_bundle_file@ @topology_manager_bundle_file@ @tst_bundle_file@",
"CELIX_AUTO_START_1":"@rsa_bundle_file@,@discovery_bundle_file@,@topology_manager_bundle_file@,@tst_bundle_file@",
"LOGHELPER_ENABLE_STDOUT_FALLBACK":true,
"CELIX_FRAMEWORK_CLEAN_CACHE_DIR_ON_CREATE":true,
"CELIX_FRAMEWORK_CACHE_DIR":".cacheClient",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"CELIX_AUTO_START_1":"@rsa_bundle_file@ @calc_bundle_file@",
"CELIX_AUTO_START_1":"@rsa_bundle_file@,@calc_bundle_file@",
"LOGHELPER_ENABLE_STDOUT_FALLBACK":true,
"CELIX_FRAMEWORK_CLEAN_CACHE_DIR_ON_CREATE":true
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"CELIX_AUTO_START_1":"@rsa_bundle_file@ @calc_bundle_file@ @remote_example_bundle_file@ @discovery_bundle_file@ @topology_manager_bundle_file@",
"CELIX_AUTO_START_1":"@rsa_bundle_file@,@calc_bundle_file@,@remote_example_bundle_file@,@discovery_bundle_file@,@topology_manager_bundle_file@",
"LOGHELPER_ENABLE_STDOUT_FALLBACK":true,
"CELIX_FRAMEWORK_CLEAN_CACHE_DIR_ON_CREATE":true,
"CELIX_FRAMEWORK_CACHE_DIR":".cacheServer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ add_celix_bundle_dependencies(test_tm_scoped Celix::rsa_dfi Celix::rsa_topology_
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/config.properties"
CONTENT "{
\"CELIX_AUTO_START_1\":\"$<TARGET_PROPERTY:Celix::rsa_dfi,BUNDLE_FILE> $<TARGET_PROPERTY:calculator,BUNDLE_FILE> $<TARGET_PROPERTY:Celix::rsa_topology_manager,BUNDLE_FILE> $<TARGET_PROPERTY:topology_manager_disc_mock_bundle,BUNDLE_FILE>\",
\"CELIX_AUTO_START_1\":\"$<TARGET_PROPERTY:Celix::rsa_dfi,BUNDLE_FILE>,$<TARGET_PROPERTY:calculator,BUNDLE_FILE>,$<TARGET_PROPERTY:Celix::rsa_topology_manager,BUNDLE_FILE>,$<TARGET_PROPERTY:topology_manager_disc_mock_bundle,BUNDLE_FILE>\",
\"LOGHELPER_ENABLE_STDOUT_FALLBACK\":true,
\"CELIX_FRAMEWORK_CLEAN_CACHE_DIR_ON_CREATE\":true
}")

file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/config_import.properties"
CONTENT "{
\"CELIX_AUTO_START_1\":\"$<TARGET_PROPERTY:Celix::rsa_dfi,BUNDLE_FILE> $<TARGET_PROPERTY:calculator,BUNDLE_FILE> $<TARGET_PROPERTY:Celix::rsa_topology_manager,BUNDLE_FILE> $<TARGET_PROPERTY:topology_manager_test_bundle,BUNDLE_FILE>\",
\"CELIX_AUTO_START_1\":\"$<TARGET_PROPERTY:Celix::rsa_dfi,BUNDLE_FILE>,$<TARGET_PROPERTY:calculator,BUNDLE_FILE>,$<TARGET_PROPERTY:Celix::rsa_topology_manager,BUNDLE_FILE>,$<TARGET_PROPERTY:topology_manager_test_bundle,BUNDLE_FILE>\",
\"LOGHELPER_ENABLE_STDOUT_FALLBACK\":true,
\"CELIX_FRAMEWORK_CLEAN_CACHE_DIR_ON_CREATE\":true
}")
Expand Down
32 changes: 16 additions & 16 deletions cmake/cmake_celix/ContainerPackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,14 @@ function(add_celix_container)
int main(int argc, char *argv[]) {
const char * config = CELIX_MULTI_LINE_STRING(
{
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_0>>:\"CELIX_AUTO_START_0\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_0>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_1>>:\"CELIX_AUTO_START_1\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_1>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_2>>:\"CELIX_AUTO_START_2\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_2>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_3>>:\"CELIX_AUTO_START_3\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_3>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_4>>:\"CELIX_AUTO_START_4\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_4>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_5>>:\"CELIX_AUTO_START_5\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_5>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_6>>:\"CELIX_AUTO_START_6\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_6>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_INSTALL>>:\"CELIX_AUTO_INSTALL\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_INSTALL>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_0>>:\"CELIX_AUTO_START_0\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_0>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_1>>:\"CELIX_AUTO_START_1\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_1>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_2>>:\"CELIX_AUTO_START_2\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_2>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_3>>:\"CELIX_AUTO_START_3\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_3>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_4>>:\"CELIX_AUTO_START_4\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_4>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_5>>:\"CELIX_AUTO_START_5\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_5>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_6>>:\"CELIX_AUTO_START_6\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_6>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_INSTALL>>:\"CELIX_AUTO_INSTALL\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_INSTALL>,$<COMMA>>\"$<COMMA>>
$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_EMBEDDED_PROPERTIES>,$<COMMA>
>$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_EMBEDDED_PROPERTIES>>:$<COMMA>>
\"CELIX_BUNDLES_PATH\":\"bundles\"$<COMMA>
Expand Down Expand Up @@ -278,14 +278,14 @@ int main(int argc, char *argv[]) {
file(GENERATE
OUTPUT "${STAGE1_PROPERTIES}"
CONTENT "{
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_0>>:\"CELIX_AUTO_START_0\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_0>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_1>>:\"CELIX_AUTO_START_1\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_1>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_2>>:\"CELIX_AUTO_START_2\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_2>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_3>>:\"CELIX_AUTO_START_3\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_3>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_4>>:\"CELIX_AUTO_START_4\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_4>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_5>>:\"CELIX_AUTO_START_5\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_5>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_6>>:\"CELIX_AUTO_START_6\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_6>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_INSTALL>>:\"CELIX_AUTO_INSTALL\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_INSTALL>, >\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_0>>:\"CELIX_AUTO_START_0\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_0>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_1>>:\"CELIX_AUTO_START_1\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_1>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_2>>:\"CELIX_AUTO_START_2\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_2>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_3>>:\"CELIX_AUTO_START_3\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_3>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_4>>:\"CELIX_AUTO_START_4\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_4>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_5>>:\"CELIX_AUTO_START_5\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_5>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_6>>:\"CELIX_AUTO_START_6\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_LEVEL_6>,$<COMMA>>\"$<COMMA>>
$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_INSTALL>>:\"CELIX_AUTO_INSTALL\":\"$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_BUNDLES_INSTALL>,$<COMMA>>\"$<COMMA>>
$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_EMBEDDED_PROPERTIES>,$<COMMA>
>$<$<BOOL:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_EMBEDDED_PROPERTIES>>:$<COMMA>>
\"CELIX_BUNDLES_PATH\":\"bundles\"$<COMMA>
Expand Down
6 changes: 3 additions & 3 deletions libs/framework/gtest/install_and_start_bundles.properties.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"CELIX_FRAMEWORK_CLEAN_CACHE_DIR_ON_CREATE":true,
"CELIX_AUTO_START_1":"@SIMPLE_TEST_BUNDLE1@ @SIMPLE_TEST_BUNDLE2@ Invalid1.zip",
"CELIX_AUTO_START_3":"@SIMPLE_TEST_BUNDLE2@ @SIMPLE_TEST_BUNDLE3@ Invalid2.zip",
"CELIX_AUTO_INSTALL":"@SIMPLE_TEST_BUNDLE3@ @SIMPLE_TEST_BUNDLE4@ @SIMPLE_TEST_BUNDLE5@ Invalid3.zip"
"CELIX_AUTO_START_1":"@SIMPLE_TEST_BUNDLE1@,@SIMPLE_TEST_BUNDLE2@,Invalid1.zip",
"CELIX_AUTO_START_3":"@SIMPLE_TEST_BUNDLE2@,@SIMPLE_TEST_BUNDLE3@,Invalid2.zip",
"CELIX_AUTO_INSTALL":"@SIMPLE_TEST_BUNDLE3@,@SIMPLE_TEST_BUNDLE4@,@SIMPLE_TEST_BUNDLE5@,Invalid3.zip"
}


4 changes: 2 additions & 2 deletions libs/framework/include/celix/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ namespace celix {
constexpr const char * const FRAMEWORK_STATIC_EVENT_QUEUE_SIZE = CELIX_FRAMEWORK_STATIC_EVENT_QUEUE_SIZE;

/**
* @brief Celix framework environment property (named "CELIX_AUTO_START_0") which specified a (ordered) space
* @brief Celix framework environment property (named "CELIX_AUTO_START_0") which specified a (ordered) comma
* separated set of bundles to load and auto start when the Celix framework is started.
*
* The Celix framework will first start bundles in for AUTO_START_0 and lastly start bundles in AUTO_START_6.
Expand Down Expand Up @@ -181,7 +181,7 @@ namespace celix {
constexpr const char * const AUTO_START_6 = CELIX_AUTO_START_6;

/**
* @brief Celix framework environment property (named "CELIX_AUTO_INSTALL") which specified a (ordered) space
* @brief Celix framework environment property (named "CELIX_AUTO_INSTALL") which specified a (ordered) comma
* separated set of bundles to install when the Celix framework is started.
*
* The Celix framework will first install and start bundles defined in the properties CELIX_AUTO_START_0 till
Expand Down
16 changes: 8 additions & 8 deletions libs/framework/include/celix_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,16 @@ extern "C" {
#define CELIX_FRAMEWORK_STATIC_EVENT_QUEUE_SIZE "CELIX_FRAMEWORK_STATIC_EVENT_QUEUE_SIZE"

/**
* @brief Celix framework environment property (named "CELIX_AUTO_START_0") which specified a (ordered) space
* @brief Celix framework environment property (named "CELIX_AUTO_START_0") which specified a (ordered) comma
* separated set of bundles to load and auto start when the Celix framework is started.
*
* Note: Because the list is space separated path with spaces are not allowed.
* Note: Because the list is comma separated, paths with commas are not supported.
*
* The Celix framework will first start bundles in for CELIX_AUTO_START_0 and lastly start bundles in CELIX_AUTO_START_6.
* Bundles which are also started in the order they appear in the AUTO_START set; first bundles mentioned is started
* The Celix framework will first start bundles in for CELIX_AUTO_START_0 and lastly start bundles in
* CELIX_AUTO_START_6. Bundles which are also started in the order they appear in the AUTO_START set; first bundles
* mentioned is started first. When the Celix framework stops the bundles are stopped in the reverse order. Bundles in
* CELIX_AUTO_START_6 are stopped first and of those bundles, the bundle mentioned last in a AUTO_START set is stopped
* first.
* When the Celix framework stops the bundles are stopped in the reverse order. Bundles in CELIX_AUTO_START_6 are stopped
* first and of those bundles, the bundle mentioned last in a AUTO_START set is stopped first.
*/
#define CELIX_AUTO_START_0 "CELIX_AUTO_START_0"

Expand Down Expand Up @@ -265,11 +265,11 @@ extern "C" {
#define CELIX_AUTO_START_6 "CELIX_AUTO_START_6"

/**
* @brief Celix framework environment property (named "CELIX_AUTO_INSTALL") which specified a (ordered) space
* @brief Celix framework environment property (named "CELIX_AUTO_INSTALL") which specified a (ordered) comma
* separated set of bundles to install when the Celix framework is started.
*
* The Celix framework will first install and start bundles defined in the properties CELIX_AUTO_START_0 till
* CELIX_AUTO_START_6 and then install (ano not start!) the bundles listed in CELIX_AUTO_INSTALL.
* CELIX_AUTO_START_6 and then install (and not start!) the bundles listed in CELIX_AUTO_INSTALL.
*
* When the Celix framework stops the bundles are stopped in the reverse order. Started bundles in CELIX_AUTO_INSTALL
* are stopped first and of those bundles, the bundle mentioned last in a CELIX_AUTO_INSTALL set is stopped first.
Expand Down
Loading

0 comments on commit b8c6ab5

Please sign in to comment.