This is an automated email from the ASF dual-hosted git repository.
pengzheng pushed a commit to branch feature/604-global-initialization-of-curl
in repository https://gitbox.apache.org/repos/asf/celix.git
The following commit(s) were added to
refs/heads/feature/604-global-initialization-of-curl by this push:
new 3d47c4a4 Update all container needing curl initialization to use
Celix::launcher.
3d47c4a4 is described below
commit 3d47c4a453926a6d91fadfe08f44c90aca9f5917
Author: PengZheng <[email protected]>
AuthorDate: Mon Aug 7 18:14:25 2023 +0800
Update all container needing curl initialization to use Celix::launcher.
---
.../cxx_remote_services/integration/CMakeLists.txt | 80 ++++++++++++----------
bundles/deployment_admin/CMakeLists.txt | 4 +-
bundles/pubsub/examples/CMakeLists.txt | 40 +++++++++--
bundles/remote_services/CMakeLists.txt | 18 ++++-
.../remote_service_admin_dfi/gtest/src/main.cc | 3 +
.../topology_manager/tms_tst/CMakeLists.txt | 5 +-
.../gtest/src => topology_manager/tms_tst}/main.cc | 3 +
cmake/cmake_celix/ContainerPackaging.cmake | 7 +-
conanfile.py | 2 +-
examples/conan_test_package/CMakeLists.txt | 56 +++++++++++++--
examples/conan_test_package/test_etcd_lib.c | 2 +-
libs/framework/gtest/CMakeLists.txt | 6 +-
libs/framework/src/celix_launcher.c | 4 --
libs/launcher/CMakeLists.txt | 6 +-
libs/launcher/src/main.c | 7 +-
15 files changed, 179 insertions(+), 64 deletions(-)
diff --git a/bundles/cxx_remote_services/integration/CMakeLists.txt
b/bundles/cxx_remote_services/integration/CMakeLists.txt
index 63df4e1e..65ce3330 100644
--- a/bundles/cxx_remote_services/integration/CMakeLists.txt
+++ b/bundles/cxx_remote_services/integration/CMakeLists.txt
@@ -48,48 +48,54 @@ if (CXX_RSA_INTEGRATION)
################# Integration examples ##################################
- add_celix_container(RemoteCalculatorProvider
- GROUP rsa
- PROPERTIES
- CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
- BUNDLES
- Celix::ShellCxx
- Celix::shell_tui
+ if (BUILD_LAUNCHER)
+ add_celix_container(RemoteCalculatorProvider
+ LAUNCHER Celix::launcher
+ GROUP rsa
+ USE_CONFIG
+ PROPERTIES
+ CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
+ BUNDLES
+ Celix::ShellCxx
+ Celix::shell_tui
- #Pubsub needed for remote services on pubsub
- Celix::celix_pubsub_serializer_json
- Celix::celix_pubsub_topology_manager
- Celix::celix_pubsub_admin_zmq
- Celix::celix_pubsub_protocol_wire_v2
- Celix::celix_pubsub_discovery_etcd
+ #Pubsub needed for remote services on pubsub
+ Celix::celix_pubsub_serializer_json
+ Celix::celix_pubsub_topology_manager
+ Celix::celix_pubsub_admin_zmq
+ Celix::celix_pubsub_protocol_wire_v2
+ Celix::celix_pubsub_discovery_etcd
- #Remote Services
- Celix::RemoteServiceAdmin
- TestExportImportRemoteServiceFactory #needed to be able to create
a ExportedService for ICalculator
+ #Remote Services
+ Celix::RemoteServiceAdmin
+ TestExportImportRemoteServiceFactory #needed to be able to
create a ExportedService for ICalculator
- CalculatorProvider
- )
+ CalculatorProvider
+ )
- add_celix_container(RemoteCalculatorConsumer
- GROUP rsa
- PROPERTIES
- CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
- BUNDLES
- Celix::ShellCxx
- Celix::shell_tui
+ add_celix_container(RemoteCalculatorConsumer
+ LAUNCHER Celix::launcher
+ GROUP rsa
+ USE_CONFIG
+ PROPERTIES
+ CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
+ BUNDLES
+ Celix::ShellCxx
+ Celix::shell_tui
- #Pubsub needed for remote services on pubsub
- Celix::celix_pubsub_serializer_json
- Celix::celix_pubsub_topology_manager
- Celix::celix_pubsub_discovery_etcd
- Celix::celix_pubsub_admin_zmq
- Celix::celix_pubsub_protocol_wire_v2
+ #Pubsub needed for remote services on pubsub
+ Celix::celix_pubsub_serializer_json
+ Celix::celix_pubsub_topology_manager
+ Celix::celix_pubsub_discovery_etcd
+ Celix::celix_pubsub_admin_zmq
+ Celix::celix_pubsub_protocol_wire_v2
- #Remote Services
- Celix::RsaConfiguredDiscovery
- Celix::RemoteServiceAdmin
- TestExportImportRemoteServiceFactory #needed to be able to create
a ExportedService for ICalculator
+ #Remote Services
+ Celix::RsaConfiguredDiscovery
+ Celix::RemoteServiceAdmin
+ TestExportImportRemoteServiceFactory #needed to be able to
create a ExportedService for ICalculator
- CalculatorConsumer
- )
+ CalculatorConsumer
+ )
+ endif ()
endif()
diff --git a/bundles/deployment_admin/CMakeLists.txt
b/bundles/deployment_admin/CMakeLists.txt
index ddc624d7..c9a8d2d9 100644
--- a/bundles/deployment_admin/CMakeLists.txt
+++ b/bundles/deployment_admin/CMakeLists.txt
@@ -59,9 +59,11 @@ if (DEPLOYMENT_ADMIN)
add_library(Celix::deployment_admin_api ALIAS deployment_admin_api)
add_library(Celix::deployment_admin ALIAS deployment_admin)
- if (BUILD_SHELL AND BUILD_SHELL_TUI AND BUILD_LOG_SERVICE)
+ if (BUILD_SHELL AND BUILD_SHELL_TUI AND BUILD_LOG_SERVICE AND
BUILD_LAUNCHER)
add_celix_container(deployment-admin
+ LAUNCHER Celix::launcher
BUNDLES Celix::deployment_admin Celix::shell Celix::shell_tui
Celix::log_admin
+ USE_CONFIG
PROPERTIES
"deployment_admin_url=http://localhost:8080"
"deployment_admin_identification=celix"
diff --git a/bundles/pubsub/examples/CMakeLists.txt
b/bundles/pubsub/examples/CMakeLists.txt
index 893d50f6..cdb57002 100644
--- a/bundles/pubsub/examples/CMakeLists.txt
+++ b/bundles/pubsub/examples/CMakeLists.txt
@@ -23,8 +23,9 @@ if (PUBSUB_EXAMPLES)
find_program(XTERM_CMD NAMES xterm)
# UDP Multicast
- if (BUILD_PUBSUB_PSA_UDP_MC)
+ if (BUILD_PUBSUB_PSA_UDP_MC AND BUILD_LAUNCHER)
add_celix_container(pubsub_publisher_udp_mc
+ LAUNCHER Celix::launcher
GROUP pubsub
BUNDLES
Celix::log_admin
@@ -36,6 +37,7 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_admin_udp_multicast
celix_pubsub_poi_publisher
celix_pubsub_poi_publisher2
+ USE_CONFIG
PROPERTIES
PSA_UDPMC_VERBOSE=true
PUBSUB_ETCD_DISCOVERY_VERBOSE=true
@@ -43,6 +45,7 @@ if (PUBSUB_EXAMPLES)
)
add_celix_container(pubsub_subscriber_udp_mc
+ LAUNCHER Celix::launcher
GROUP pubsub
BUNDLES
Celix::log_admin
@@ -53,6 +56,7 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_udp_multicast
celix_pubsub_poi_subscriber
+ USE_CONFIG
PROPERTIES
PSA_UDPMC_VERBOSE=true
PUBSUB_ETCD_DISCOVERY_VERBOSE=true
@@ -60,6 +64,7 @@ if (PUBSUB_EXAMPLES)
)
add_celix_container(pubsub_subscriber2_udp_mc
+ LAUNCHER Celix::launcher
GROUP pubsub
BUNDLES
Celix::log_admin
@@ -70,6 +75,7 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_udp_multicast
celix_pubsub_poi_subscriber
+ USE_CONFIG
PROPERTIES
PSA_UDPMC_VERBOSE=true
PUBSUB_ETCD_DISCOVERY_VERBOSE=true
@@ -92,9 +98,10 @@ if (PUBSUB_EXAMPLES)
endif ()
endif()
- if (BUILD_PUBSUB_PSA_TCP)
+ if (BUILD_PUBSUB_PSA_TCP AND BUILD_LAUNCHER)
# TCP
add_celix_container(pubsub_publisher_tcp
+ LAUNCHER Celix::launcher
GROUP pubsub
BUNDLES
Celix::log_admin
@@ -107,6 +114,7 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_protocol_wire_v2
celix_pubsub_poi_publisher
celix_pubsub_poi_publisher2
+ USE_CONFIG
PROPERTIES
PSA_TCP_VERBOSE=true
PUBSUB_ETCD_DISCOVERY_VERBOSE=true
@@ -114,6 +122,7 @@ if (PUBSUB_EXAMPLES)
)
add_celix_container(pubsub_subscriber_tcp
+ LAUNCHER Celix::launcher
GROUP pubsub
BUNDLES
Celix::log_admin
@@ -125,6 +134,7 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_admin_tcp
Celix::celix_pubsub_protocol_wire_v2
celix_pubsub_poi_subscriber
+ USE_CONFIG
PROPERTIES
PSA_TCP_VERBOSE=true
PUBSUB_ETCD_DISCOVERY_VERBOSE=true
@@ -132,6 +142,7 @@ if (PUBSUB_EXAMPLES)
)
add_celix_container(pubsub_subscriber2_tcp
+ LAUNCHER Celix::launcher
GROUP pubsub
BUNDLES
Celix::log_admin
@@ -143,6 +154,7 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_admin_tcp
Celix::celix_pubsub_protocol_wire_v2
celix_pubsub_poi_subscriber
+ USE_CONFIG
PROPERTIES
PSA_TCP_VERBOSE=true
PUBSUB_ETCD_DISCOVERY_VERBOSE=true
@@ -165,11 +177,12 @@ if (PUBSUB_EXAMPLES)
endif ()
endif()
- if (BUILD_PUBSUB_PSA_ZMQ)
+ if (BUILD_PUBSUB_PSA_ZMQ AND BUILD_LAUNCHER)
if (BUILD_PUBSUB_PSA_TCP AND BUILD_PUBSUB_PSA_UDP_MC)
# Dynamic ZMQ / UDP / TCP admin
add_celix_container(pubsub_publisher
+ LAUNCHER Celix::launcher
GROUP "pubsub"
BUNDLES
Celix::shell
@@ -183,9 +196,11 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_protocol_wire_v1
celix_pubsub_poi_publisher
celix_pubsub_poi_publisher2
+ USE_CONFIG
)
add_celix_container(pubsub_subscriber
+ LAUNCHER Celix::launcher
GROUP "pubsub"
BUNDLES
Celix::shell
@@ -198,11 +213,13 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_admin_tcp
Celix::celix_pubsub_protocol_wire_v1
celix_pubsub_poi_subscriber
+ USE_CONFIG
)
endif()
# ZMQ
add_celix_container(pubsub_zmq
+ LAUNCHER Celix::launcher
GROUP "pubsub"
BUNDLES
Celix::shell
@@ -213,11 +230,13 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_admin_zmq
celix_pubsub_poi_publisher
celix_pubsub_poi_subscriber
+ USE_CONFIG
PROPERTIES
PSA_ZMQ_ZEROCOPY_ENABLED=true
)
add_celix_container(pubsub_publisher_zmq
+ LAUNCHER Celix::launcher
GROUP "pubsub"
BUNDLES
Celix::shell
@@ -230,6 +249,7 @@ if (PUBSUB_EXAMPLES)
celix_pubsub_poi_publisher
celix_pubsub_poi_publisher2
celix_pubsub_interceptors_example
+ USE_CONFIG
PROPERTIES
PSA_ZMQ_VERBOSE=true
PUBSUB_ETCD_DISCOVERY_VERBOSE=true
@@ -238,6 +258,7 @@ if (PUBSUB_EXAMPLES)
)
add_celix_container(pubsub_subscriber_zmq
+ LAUNCHER Celix::launcher
GROUP "pubsub"
BUNDLES
Celix::shell
@@ -249,6 +270,7 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_admin_zmq
celix_pubsub_poi_subscriber
celix_pubsub_interceptors_example
+ USE_CONFIG
PROPERTIES
PSA_ZMQ_VERBOSE=true
PUBSUB_ETCD_DISCOVERY_VERBOSE=true
@@ -256,6 +278,7 @@ if (PUBSUB_EXAMPLES)
)
add_celix_container(pubsub_subscriber2_zmq
+ LAUNCHER Celix::launcher
GROUP "pubsub"
BUNDLES
Celix::shell
@@ -265,6 +288,7 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_zmq
celix_pubsub_poi_subscriber
+ USE_CONFIG
PROPERTIES
PSA_ZMQ_VERBOSE=true
PUBSUB_ETCD_DISCOVERY_VERBOSE=true
@@ -300,9 +324,10 @@ if (PUBSUB_EXAMPLES)
endif ()
endif()
- if (BUILD_PUBSUB_PSA_NANOMSG)
+ if (BUILD_PUBSUB_PSA_NANOMSG AND BUILD_LAUNCHER)
add_celix_container(pubsub_publisher1_nanomsg
+ LAUNCHER Celix::launcher
GROUP "pubsub"
BUNDLES
Celix::shell
@@ -312,6 +337,7 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_nanomsg
celix_pubsub_poi_publisher
+ USE_CONFIG
PROPERTIES
PSA_NANOMSG_VERBOSE=true
PUBSUB_ETCD_DISCOVERY_VERBOSE=true
@@ -319,6 +345,7 @@ if (PUBSUB_EXAMPLES)
)
add_celix_container(pubsub_publisher2_nanomsg
+ LAUNCHER Celix::launcher
GROUP "pubsub"
BUNDLES
Celix::shell
@@ -328,6 +355,7 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_nanomsg
celix_pubsub_poi_publisher
+ USE_CONFIG
PROPERTIES
PSA_NANOMSG_VERBOSE=true
PUBSUB_ETCD_DISCOVERY_VERBOSE=true
@@ -335,6 +363,7 @@ if (PUBSUB_EXAMPLES)
)
add_celix_container(pubsub_subscriber1_nanomsg
+ LAUNCHER Celix::launcher
GROUP "pubsub"
BUNDLES
Celix::shell
@@ -344,6 +373,7 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_nanomsg
celix_pubsub_poi_subscriber
+ USE_CONFIG
PROPERTIES
PSA_NANOMSG_VERBOSE=true
PUBSUB_ETCD_DISCOVERY_VERBOSE=true
@@ -351,6 +381,7 @@ if (PUBSUB_EXAMPLES)
)
add_celix_container(pubsub_subscriber2_nanomsg
+ LAUNCHER Celix::launcher
GROUP "pubsub"
BUNDLES
Celix::shell
@@ -360,6 +391,7 @@ if (PUBSUB_EXAMPLES)
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_nanomsg
celix_pubsub_poi_subscriber
+ USE_CONFIG
PROPERTIES
PSA_NANOMSG_VERBOSE=true
PUBSUB_ETCD_DISCOVERY_VERBOSE=true
diff --git a/bundles/remote_services/CMakeLists.txt
b/bundles/remote_services/CMakeLists.txt
index 18f6c434..250abc9c 100644
--- a/bundles/remote_services/CMakeLists.txt
+++ b/bundles/remote_services/CMakeLists.txt
@@ -36,8 +36,9 @@ if (REMOTE_SERVICE_ADMIN)
add_subdirectory(discovery_shm)
endif ()
- if (BUILD_RSA_DISCOVERY_ETCD AND BUILD_RSA_REMOTE_SERVICE_ADMIN_DFI AND
BUILD_SHELL AND BUILD_SHELL_TUI AND BUILD_LOG_SERVICE)
+ if (BUILD_RSA_DISCOVERY_ETCD AND BUILD_RSA_REMOTE_SERVICE_ADMIN_DFI AND
BUILD_SHELL AND BUILD_SHELL_TUI AND BUILD_LOG_SERVICE AND BUILD_LAUNCHER)
add_celix_container(remote-services-dfi
+ LAUNCHER Celix::launcher
NAME "server"
GROUP "remote-services/remote-services-dfi"
BUNDLES
@@ -50,11 +51,13 @@ if (REMOTE_SERVICE_ADMIN)
celix_remote_interceptors_example
calculator
+ USE_CONFIG
PROPERTIES
RSA_PORT=18888
)
add_celix_container(remote-services-dfi-client
+ LAUNCHER Celix::launcher
NAME "client"
GROUP "remote-services/remote-services-dfi"
BUNDLES
@@ -66,13 +69,15 @@ if (REMOTE_SERVICE_ADMIN)
Celix::rsa_discovery_etcd
celix_remote_interceptors_example
calculator_shell
+ USE_CONFIG
PROPERTIES
RSA_PORT=28888
)
endif()
- if (BUILD_RSA_DISCOVERY_CONFIGURED AND
BUILD_RSA_REMOTE_SERVICE_ADMIN_SHM_V2 AND BUILD_RSA_JSON_RPC AND BUILD_SHELL
AND BUILD_SHELL_TUI AND BUILD_LOG_SERVICE)
+ if (BUILD_RSA_DISCOVERY_CONFIGURED AND
BUILD_RSA_REMOTE_SERVICE_ADMIN_SHM_V2 AND BUILD_RSA_JSON_RPC AND BUILD_SHELL
AND BUILD_SHELL_TUI AND BUILD_LOG_SERVICE AND BUILD_LAUNCHER)
add_celix_container(remote-services-shm-server
+ LAUNCHER Celix::launcher
NAME "server"
GROUP "remote-services/remote-services-shm"
BUNDLES
@@ -86,10 +91,12 @@ if (REMOTE_SERVICE_ADMIN)
celix_remote_interceptors_example
calculator
+ USE_CONFIG
PROPERTIES
)
add_celix_container(remote-services-shm-client
+ LAUNCHER Celix::launcher
NAME "client"
GROUP "remote-services/remote-services-shm"
BUNDLES
@@ -102,12 +109,14 @@ if (REMOTE_SERVICE_ADMIN)
Celix::log_admin
celix_remote_interceptors_example
calculator_shell
+ USE_CONFIG
PROPERTIES
)
endif()
- if (BUILD_RSA_DISCOVERY_ZEROCONF AND BUILD_RSA_REMOTE_SERVICE_ADMIN_DFI
AND BUILD_RSA_REMOTE_SERVICE_ADMIN_SHM_V2 AND BUILD_RSA_JSON_RPC AND
BUILD_SHELL AND BUILD_SHELL_TUI AND BUILD_LOG_SERVICE)
+ if (BUILD_RSA_DISCOVERY_ZEROCONF AND BUILD_RSA_REMOTE_SERVICE_ADMIN_DFI
AND BUILD_RSA_REMOTE_SERVICE_ADMIN_SHM_V2 AND BUILD_RSA_JSON_RPC AND
BUILD_SHELL AND BUILD_SHELL_TUI AND BUILD_LOG_SERVICE AND BUILD_LAUNCHER)
add_celix_container(remote-services-zeroconf-server
+ LAUNCHER Celix::launcher
NAME "server"
GROUP "remote-services/remote-services-zeroconf"
BUNDLES
@@ -121,11 +130,13 @@ if (REMOTE_SERVICE_ADMIN)
Celix::log_admin
celix_remote_interceptors_example
calculator
+ USE_CONFIG
PROPERTIES
CELIX_RSA_BIND_ON_ALL_INTERFACES=false
)
add_celix_container(remote-services-zeroconf-client
+ LAUNCHER Celix::launcher
NAME "client"
GROUP "remote-services/remote-services-zeroconf"
BUNDLES
@@ -139,6 +150,7 @@ if (REMOTE_SERVICE_ADMIN)
Celix::log_admin
celix_remote_interceptors_example
calculator_shell
+ USE_CONFIG
PROPERTIES
CELIX_RSA_BIND_ON_ALL_INTERFACES=false
)
diff --git a/bundles/remote_services/remote_service_admin_dfi/gtest/src/main.cc
b/bundles/remote_services/remote_service_admin_dfi/gtest/src/main.cc
index 09731c41..553dfa53 100644
--- a/bundles/remote_services/remote_service_admin_dfi/gtest/src/main.cc
+++ b/bundles/remote_services/remote_service_admin_dfi/gtest/src/main.cc
@@ -17,10 +17,13 @@
*under the License.
*/
+#include <curl/curl.h>
#include <gtest/gtest.h>
int main(int argc, char **argv) {
+ curl_global_init(CURL_GLOBAL_ALL);
::testing::InitGoogleTest(&argc, argv);
int rc = RUN_ALL_TESTS();
+ curl_global_cleanup();
return rc;
}
\ No newline at end of file
diff --git a/bundles/remote_services/topology_manager/tms_tst/CMakeLists.txt
b/bundles/remote_services/topology_manager/tms_tst/CMakeLists.txt
index 64b420ec..9a12de3d 100644
--- a/bundles/remote_services/topology_manager/tms_tst/CMakeLists.txt
+++ b/bundles/remote_services/topology_manager/tms_tst/CMakeLists.txt
@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
+find_package(CURL REQUIRED)
include_directories(
${PROJECT_SOURCE_DIR}/framework/public/include
@@ -30,6 +31,7 @@ add_subdirectory(bundle)
add_subdirectory(disc_mock)
add_executable(test_tm_scoped
+ main.cc
tms_tests.cpp
)
celix_deprecated_utils_headers(test_tm_scoped)
@@ -37,10 +39,11 @@ celix_deprecated_framework_headers(test_tm_scoped)
target_include_directories(test_tm_scoped PRIVATE ../src ../include)
target_link_libraries(test_tm_scoped PRIVATE
Celix::framework
- GTest::gtest GTest::gtest_main
+ GTest::gtest
jansson::jansson
calculator_api
Celix::rsa_common
+ CURL::libcurl
)
add_celix_bundle_dependencies(test_tm_scoped Celix::rsa_dfi
Celix::rsa_topology_manager calculator topology_manager_disc_mock_bundle
topology_manager_test_bundle)
diff --git a/bundles/remote_services/remote_service_admin_dfi/gtest/src/main.cc
b/bundles/remote_services/topology_manager/tms_tst/main.cc
similarity index 91%
copy from bundles/remote_services/remote_service_admin_dfi/gtest/src/main.cc
copy to bundles/remote_services/topology_manager/tms_tst/main.cc
index 09731c41..553dfa53 100644
--- a/bundles/remote_services/remote_service_admin_dfi/gtest/src/main.cc
+++ b/bundles/remote_services/topology_manager/tms_tst/main.cc
@@ -17,10 +17,13 @@
*under the License.
*/
+#include <curl/curl.h>
#include <gtest/gtest.h>
int main(int argc, char **argv) {
+ curl_global_init(CURL_GLOBAL_ALL);
::testing::InitGoogleTest(&argc, argv);
int rc = RUN_ALL_TESTS();
+ curl_global_cleanup();
return rc;
}
\ No newline at end of file
diff --git a/cmake/cmake_celix/ContainerPackaging.cmake
b/cmake/cmake_celix/ContainerPackaging.cmake
index b86ef710..bd1ec42d 100644
--- a/cmake/cmake_celix/ContainerPackaging.cmake
+++ b/cmake/cmake_celix/ContainerPackaging.cmake
@@ -50,7 +50,7 @@ There are three variants of 'add_celix_container':
CMake 'target_sources' command.
- If a LAUNCHER (absolute path to a executable of CMake `add_executable`
target) is provided that will be used as Celix launcher.
-Creating a Celix containers using 'add_celix_container' will lead to a CMake
executable target (expect if a LAUNCHER is used).
+Creating a Celix containers using 'add_celix_container' will lead to a CMake
executable target (unless a LAUNCHER is used).
These targets can be used to run/debug Celix containers from a IDE (if the IDE
supports CMake).
Optional Arguments:
@@ -341,7 +341,7 @@
$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_RUNTIME_PROPERTIES>,
#Celix Main Project
set(CELIX_LIB_DIRS
"$<TARGET_FILE_DIR:Celix::framework>:$<TARGET_FILE_DIR:Celix::utils>:$<TARGET_FILE_DIR:Celix::dfi>")
else ()
- message(FATAL_ERROR "No Celix::framework target is defined. Did you use
find_package(Celix REQUIRED)?")
+ message(FATAL_ERROR "No Celix::framework target is defined. Did you
use find_package(Celix REQUIRED)?")
endif()
#generate release.sh and optional run.sh
@@ -393,6 +393,9 @@
$<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_RUNTIME_PROPERTIES>,
celix_container_runtime_properties(${CONTAINER_TARGET}
${CONTAINER_RUNTIME_PROPERTIES})
celix_container_embedded_properties(${CONTAINER_TARGET}
${CONTAINER_EMBEDDED_PROPERTIES})
+ if (LAUNCHER_DEP)
+ add_dependencies(${CONTAINER_TARGET} ${LAUNCHER_DEP})
+ endif ()
#ensure the container dir will be deleted during clean
get_directory_property(CLEANFILES ADDITIONAL_CLEAN_FILES)
diff --git a/conanfile.py b/conanfile.py
index a077e6ba..5a0c498b 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -385,7 +385,7 @@ class CelixConan(ConanFile):
self.options['libuuid'].shared = True
if (self.options.build_framework or self.options.build_celix_etcdlib
or self.options.build_deployment_admin or
self.options.build_rsa_discovery_common
- or self.options.build_rsa_remote_service_admin_dfi):
+ or self.options.build_rsa_remote_service_admin_dfi or
self.options.build_launcher):
self.requires("libcurl/[>=7.64.1 <8.0.0]")
self.options['libcurl'].shared = True
if self.options.build_deployment_admin:
diff --git a/examples/conan_test_package/CMakeLists.txt
b/examples/conan_test_package/CMakeLists.txt
index d3889bc7..da5f4c76 100644
--- a/examples/conan_test_package/CMakeLists.txt
+++ b/examples/conan_test_package/CMakeLists.txt
@@ -140,7 +140,7 @@ endif ()
option(TEST_PSA_DISCOVERY_ETCD "Test the PubSub Discovery (ETCD) bundle" OFF)
if (TEST_PSA_DISCOVERY_ETCD)
- add_celix_container(use_psa_discovery_etcd
+ add_celix_container(build_psa_discovery_etcd
BUNDLES
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_discovery_etcd
@@ -149,6 +149,19 @@ if (TEST_PSA_DISCOVERY_ETCD)
PROPERTIES
PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true
)
+ if (TEST_LAUNCHER)
+ add_celix_container(use_psa_discovery_etcd
+ LAUNCHER Celix::launcher
+ BUNDLES
+ Celix::celix_pubsub_topology_manager
+ Celix::celix_pubsub_discovery_etcd
+ my_pubsub_admin
+ hello
+ USE_CONFIG
+ PROPERTIES
+ PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true
+ )
+ endif ()
endif ()
option(TEST_RSA "Test Remote Service Admin" OFF)
@@ -177,13 +190,24 @@ endif ()
option(TEST_RSA_DFI "Test the Remote Service Admin Service DFI" OFF)
if (TEST_RSA_DFI)
- add_celix_container(use_rsa_dfi
+ add_celix_container(build_rsa_dfi
BUNDLES
Celix::rsa_topology_manager
Celix::rsa_dfi
hello
PROPERTIES
)
+ if (TEST_LAUNCHER)
+ add_celix_container(use_rsa_dfi
+ LAUNCHER Celix::launcher
+ BUNDLES
+ Celix::rsa_topology_manager
+ Celix::rsa_dfi
+ hello
+ USE_CONFIG
+ PROPERTIES
+ )
+ endif ()
endif ()
option(TEST_RSA_SHM_V2 "Test the Remote Service Admin SHM V2" OFF)
@@ -209,7 +233,7 @@ endif ()
option(TEST_RSA_DISCOVERY_CONFIGURED "Test the Discovery (Configured) bundle"
OFF)
if (TEST_RSA_DISCOVERY_CONFIGURED)
- add_celix_container(use_rsa_configured
+ add_celix_container(build_rsa_configured
BUNDLES
Celix::rsa_discovery
Celix::rsa_topology_manager
@@ -217,11 +241,23 @@ if (TEST_RSA_DISCOVERY_CONFIGURED)
hello
PROPERTIES
)
+ if (TEST_LAUNCHER)
+ add_celix_container(use_rsa_configured
+ LAUNCHER Celix::launcher
+ BUNDLES
+ Celix::rsa_discovery
+ Celix::rsa_topology_manager
+ my_rsa
+ hello
+ USE_CONFIG
+ PROPERTIES
+ )
+ endif ()
endif ()
option(TEST_RSA_DISCOVERY_ETCD "Test the Discovery (ETCD) bundle" OFF)
if (TEST_RSA_DISCOVERY_ETCD)
- add_celix_container(use_rsa_etcd
+ add_celix_container(build_rsa_etcd
BUNDLES
Celix::rsa_discovery_etcd
Celix::rsa_topology_manager
@@ -229,6 +265,18 @@ if (TEST_RSA_DISCOVERY_ETCD)
hello
PROPERTIES
)
+ if (TEST_LAUNCHER)
+ add_celix_container(use_rsa_etcd
+ LAUNCHER Celix::launcher
+ BUNDLES
+ Celix::rsa_discovery_etcd
+ Celix::rsa_topology_manager
+ my_rsa
+ hello
+ USE_CONFIG
+ PROPERTIES
+ )
+ endif ()
endif ()
option(TEST_RSA_DISCOVERY_ZEROCONF "Test the Discovery (ZEROCONF) bundle" OFF)
diff --git a/examples/conan_test_package/test_etcd_lib.c
b/examples/conan_test_package/test_etcd_lib.c
index bbe246f7..14847b43 100644
--- a/examples/conan_test_package/test_etcd_lib.c
+++ b/examples/conan_test_package/test_etcd_lib.c
@@ -21,7 +21,7 @@
#include <stdio.h>
int main() {
- etcdlib_t *db = etcdlib_create("127.0.0.1", 8000,
ETCDLIB_NO_CURL_INITIALIZATION);
+ etcdlib_t *db = etcdlib_create("127.0.0.1", 8000, 0);
if (db != NULL) {
printf("etcdlib instance %p created\n", db);
}
diff --git a/libs/framework/gtest/CMakeLists.txt
b/libs/framework/gtest/CMakeLists.txt
index 740f3727..5ba22912 100644
--- a/libs/framework/gtest/CMakeLists.txt
+++ b/libs/framework/gtest/CMakeLists.txt
@@ -64,7 +64,7 @@ set(CELIX_FRAMEWORK_TEST_SOURCES
add_executable(test_framework ${CELIX_FRAMEWORK_TEST_SOURCES})
# framework_cut makes error injector work
-target_link_libraries(test_framework PRIVATE framework_cut CURL::libcurl
GTest::gtest GTest::gtest_main)
+target_link_libraries(test_framework PRIVATE framework_cut GTest::gtest
GTest::gtest_main)
celix_deprecated_framework_headers(test_framework)
@@ -173,7 +173,7 @@ if (ENABLE_TESTING_DEPENDENCY_MANAGER_FOR_CXX11)
add_executable(test_dep_man_with_cxx11
src/DependencyManagerTestSuite.cc
)
- target_link_libraries(test_dep_man_with_cxx11 PRIVATE framework_cut
Celix::framework CURL::libcurl GTest::gtest GTest::gtest_main)
+ target_link_libraries(test_dep_man_with_cxx11 PRIVATE framework_cut
Celix::framework GTest::gtest GTest::gtest_main)
target_compile_definitions(test_dep_man_with_cxx11 PRIVATE
SIMPLE_CXX_DEP_MAN_BUNDLE_LOC="${SIMPLE_CXX_DEP_MAN_BUNDLE_LOC}"
)
@@ -192,7 +192,7 @@ if (ENABLE_TESTING_FOR_CXX14)
set(CMAKE_CXX_STANDARD 14)
add_executable(test_framework_with_cxx14 ${CELIX_FRAMEWORK_TEST_SOURCES})
- target_link_libraries(test_framework_with_cxx14 PRIVATE framework_cut
Celix::framework CURL::libcurl GTest::gtest GTest::gtest_main)
+ target_link_libraries(test_framework_with_cxx14 PRIVATE framework_cut
Celix::framework GTest::gtest GTest::gtest_main)
celix_deprecated_utils_headers(test_framework_with_cxx14)
celix_deprecated_framework_headers(test_framework_with_cxx14)
add_celix_bundle_dependencies(test_framework_with_cxx14
diff --git a/libs/framework/src/celix_launcher.c
b/libs/framework/src/celix_launcher.c
index b41d35f3..ca0b1d1b 100644
--- a/libs/framework/src/celix_launcher.c
+++ b/libs/framework/src/celix_launcher.c
@@ -30,10 +30,6 @@
#include <curl/curl.h>
#endif
-#include <string.h>
-#include <curl/curl.h>
-#include <signal.h>
-
#include "framework.h"
#include "celix_framework_factory.h"
#include "celix_constants.h"
diff --git a/libs/launcher/CMakeLists.txt b/libs/launcher/CMakeLists.txt
index 52ec6719..734c3c31 100644
--- a/libs/launcher/CMakeLists.txt
+++ b/libs/launcher/CMakeLists.txt
@@ -16,7 +16,9 @@
# under the License.
celix_subproject(LAUNCHER "Option to build the launcher" "ON")
-if (LAUNCHER)
+if (LAUNCHER)
+ find_package(CURL REQUIRED)
+
#celix launcher linked to libc
add_executable(launcher
src/main.c
@@ -25,7 +27,7 @@ if (LAUNCHER)
set_target_properties(launcher PROPERTIES "INSTALL_RPATH"
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
target_include_directories(launcher PRIVATE src)
- target_link_libraries(launcher PRIVATE Celix::framework)
+ target_link_libraries(launcher PRIVATE Celix::framework CURL::libcurl)
install(TARGETS launcher EXPORT celix RUNTIME DESTINATION
${CMAKE_INSTALL_BINDIR} COMPONENT framework)
#Setup target aliases to match external usage
diff --git a/libs/launcher/src/main.c b/libs/launcher/src/main.c
index 96d0d12c..6ae2f1b4 100644
--- a/libs/launcher/src/main.c
+++ b/libs/launcher/src/main.c
@@ -17,8 +17,13 @@
* under the License.
*/
+#include <curl/curl.h>
#include "celix_launcher.h"
int main(int argc, char *argv[]) {
- return celixLauncher_launchAndWaitForShutdown(argc, argv, NULL);
+ int ret;
+ curl_global_init(CURL_GLOBAL_ALL);
+ ret = celixLauncher_launchAndWaitForShutdown(argc, argv, NULL);
+ curl_global_cleanup();
+ return ret;
}
\ No newline at end of file