diff --git a/CHANGES.md b/CHANGES.md index a92d8d694..5db41a36f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,7 +21,12 @@ limitations under the License. # Noteworthy Changes for 3.0.0 (TBD) +## Backwards incompatible changes + - Deployment Admin bundle has been removed and is no longer supported. +- The libs `dependency_manager_static`, `shell_dm` and `dependency_manager_cxx_static` are removed. These libraries are + not needed anymore. The dependency manager is an integral part of the framework lib and the `dm` command is part + of the standard shell commands. # Noteworthy Changes for 2.4.0 (2023-09-27) diff --git a/conanfile.py b/conanfile.py index cf4490ece..5899c15e4 100644 --- a/conanfile.py +++ b/conanfile.py @@ -91,8 +91,6 @@ class CelixConan(ConanFile): "build_pushstreams": False, "build_experimental": False, "build_celix_dfi": False, - "build_dependency_manager": False, - "build_dependency_manager_cxx": False, "build_framework": False, "build_rcm": False, "build_utils": False, @@ -315,13 +313,9 @@ def configure(self): if options["build_rcm"]: options["build_utils"] = True - if options["build_launcher"] or options["build_dependency_manager"]: + if options["build_launcher"]: options["build_framework"] = True - if options["build_dependency_manager_cxx"]: - options["build_framework"] = True - options["celix_cxx14"] = True - if options["build_celix_dfi"]: options["build_utils"] = True diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index 7c7127765..8da61c273 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -29,14 +29,7 @@ add_subdirectory(framework) #launcher add_subdirectory(launcher) -#add_subdirectory(event_admin)# event_admin is unstable -add_subdirectory(dependency_manager) -if (CELIX_CXX14) - add_subdirectory(dependency_manager_cxx) -endif () - # Error Injectors if (ENABLE_TESTING AND EI_TESTS) add_subdirectory(error_injector) endif () - diff --git a/libs/dependency_manager/CMakeLists.txt b/libs/dependency_manager/CMakeLists.txt deleted file mode 100644 index 2c1f759bb..000000000 --- a/libs/dependency_manager/CMakeLists.txt +++ /dev/null @@ -1,58 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -#dummy libaries to ensure backward compatability with projects using the dependency manager libs/shell -celix_subproject(DEPENDENCY_MANAGER "Option to enable building the legacy Dependency Manager" ON) -if (DEPENDENCY_MANAGER) - add_library(dependency_manager_static STATIC src/dm_activator.c) - celix_deprecated_framework_headers(dependency_manager_static) - target_include_directories(dependency_manager_static PUBLIC - $ - ) - if (APPLE) - target_link_libraries(dependency_manager_static Celix::framework "-undefined dynamic_lookup") - else() - target_link_libraries(dependency_manager_static Celix::framework) - endif() - - add_library(dependency_manager_so SHARED src/dm_activator.c) - celix_deprecated_framework_headers(dependency_manager_so) - target_include_directories(dependency_manager_so PUBLIC - $ - ) - if (APPLE) - target_link_libraries(dependency_manager_so Celix::framework "-undefined dynamic_lookup") - else() - target_link_libraries(dependency_manager_so Celix::framework) - endif() - - #now part of the the shell bundle - add_library(dm_shell INTERFACE) - - celix_deprecated_utils_headers(dependency_manager_static) - celix_deprecated_utils_headers(dependency_manager_so) - - #Setup target aliases to match external usage - add_library(Celix::dm_shell ALIAS dm_shell) - add_library(Celix::dependency_manager_static ALIAS dependency_manager_static) - add_library(Celix::dependency_manager_so ALIAS dependency_manager_so) - - #install dummy libs - install(TARGETS dependency_manager_static dependency_manager_so dm_shell EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix) -endif () - diff --git a/libs/dependency_manager/api/dm_activator.h b/libs/dependency_manager/api/dm_activator.h deleted file mode 100644 index ffc8ccc15..000000000 --- a/libs/dependency_manager/api/dm_activator.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#ifndef DM_ACTIVATOR_BASE_H_ -#define DM_ACTIVATOR_BASE_H_ - -#include "celix_bundle_context.h" -#include "dm_dependency_manager.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Should be implemented by a bundle specific DM activator. - * Should allocate and initialize a bundle specific activator struct. - */ -celix_status_t dm_create(celix_bundle_context_t *ctx, void ** userData); - -/** - * Should be implemented by a bundle specific DM activator. - * Will be called after the dm_create function. - * Can be used to specify with use of the provided dependency manager the bundle specific components. - */ -celix_status_t dm_init(void * userData, celix_bundle_context_t *ctx, dm_dependency_manager_t *mng); - -/** - * Should be implemented by a bundle specific DM activator. - * Should deinitialize and deallocate the bundle specific activator struct. - */ -celix_status_t dm_destroy(void * userData, celix_bundle_context_t *ctx, dm_dependency_manager_t *mng); - -#ifdef __cplusplus -} -#endif - -#endif /* DM_ACTIVATOR_BASE_H_ */ - diff --git a/libs/dependency_manager/src/dm_activator.c b/libs/dependency_manager/src/dm_activator.c deleted file mode 100644 index 35dc5bb88..000000000 --- a/libs/dependency_manager/src/dm_activator.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#include "dm_activator.h" -#include "celix_compiler.h" - -#include - - -celix_status_t bundleActivator_create(celix_bundle_context_t *ctx, void **userData) { - return dm_create(ctx, userData); -} - -celix_status_t bundleActivator_start(void *userData, celix_bundle_context_t *ctx) { - dm_dependency_manager_t *mng = celix_bundleContext_getDependencyManager(ctx); - return dm_init(userData, ctx, mng); -} - -celix_status_t bundleActivator_stop(void * userData, celix_bundle_context_t *ctx) { - dm_dependency_manager_t *mng = celix_bundleContext_getDependencyManager(ctx); - return dm_destroy(userData, ctx, mng); -} - -celix_status_t bundleActivator_destroy(void * userData CELIX_UNUSED, celix_bundle_context_t *ctx CELIX_UNUSED) { - return CELIX_SUCCESS; //nothing to do -} diff --git a/libs/dependency_manager_cxx/CMakeLists.txt b/libs/dependency_manager_cxx/CMakeLists.txt deleted file mode 100644 index e28880d0d..000000000 --- a/libs/dependency_manager_cxx/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -celix_subproject(DEPENDENCY_MANAGER_CXX "Option to enable building the legacy C++ Dependency Manager" ON) -if (DEPENDENCY_MANAGER_CXX) - add_library(dependency_manager_cxx_static STATIC - src/dm_activator.cc - ) - celix_deprecated_framework_headers(dependency_manager_cxx_static) - set_target_properties(dependency_manager_cxx_static PROPERTIES OUTPUT_NAME "celix_dependency_manager_cxx_static") - target_compile_options(dependency_manager_cxx_static PRIVATE -fPIC) - target_compile_options(dependency_manager_cxx_static PRIVATE -Wno-deprecated-declarations) - if (APPLE) - target_link_libraries(dependency_manager_cxx_static Celix::framework "-undefined dynamic_lookup") - else() - target_link_libraries(dependency_manager_cxx_static Celix::framework) - endif() - - install(TARGETS dependency_manager_cxx_static EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework) - - celix_deprecated_utils_headers(dependency_manager_cxx_static) - - #Setup target aliases to match external usage - add_library(Celix::dependency_manager_cxx_static ALIAS dependency_manager_cxx_static) -endif () diff --git a/libs/dependency_manager_cxx/src/dm_activator.cc b/libs/dependency_manager_cxx/src/dm_activator.cc deleted file mode 100644 index 0bba0a56b..000000000 --- a/libs/dependency_manager_cxx/src/dm_activator.cc +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#include -#include - -#include "celix/dm/DependencyManager.h" -#include "celix/dm/DmActivator.h" -#include "bundle_activator.h" - - -/** - * Deprecated. Use the CELIX_GEN_CXX_BUNDLE_ACTIVATOR marco from celix_bundle_activator.h instead - */ -struct BundleActivatorData { - std::shared_ptr mng; - std::unique_ptr act; -}; - -extern "C" celix_status_t bundleActivator_create(celix_bundle_context_t *context, void** userData) { - int status = CELIX_SUCCESS; - - BundleActivatorData* data = nullptr; -#ifdef __EXCEPTIONS - data = new BundleActivatorData{ - .mng = std::make_shared(context), - .act = nullptr - }; -#else - data = new(std::nothrow) BundleActivatorData{ - .mng = celix::dm::DependencyManager{context}, - .act = nullptr - }; -#endif - if (data != nullptr) { - data->act = std::unique_ptr{celix::dm::DmActivator::create(*data->mng)}; - } - - if (data == nullptr || data->act == nullptr) { - status = CELIX_ENOMEM; - if (data != nullptr) { - delete data; - } - *userData = nullptr; - } else { - *userData = data; - } - return status; -} - -extern "C" celix_status_t bundleActivator_start(void* userData, celix_bundle_context_t *) { - int status = CELIX_SUCCESS; - auto* data = static_cast(userData); - if (data != nullptr) { - status = data->act->start(); - } - return status; -} - -extern "C" celix_status_t bundleActivator_stop(void* userData, celix_bundle_context_t *) { - int status = CELIX_SUCCESS; - auto* data = static_cast(userData); - if (data != nullptr) { - status = data->act->stop(); - data->act = nullptr; - } - return status; -} - -extern "C" celix_status_t bundleActivator_destroy(void *userData, celix_bundle_context_t* ) { - auto* data = static_cast(userData); - if (data != nullptr) { - delete data; - } - return CELIX_SUCCESS; -} \ No newline at end of file