|
| 1 | +<!-- |
| 2 | +Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +contributor license agreements. See the NOTICE file distributed with |
| 4 | +this work for additional information regarding copyright ownership. |
| 5 | +The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | +(the "License"); you may not use this file except in compliance with |
| 7 | +the License. You may obtain a copy of the License at |
| 8 | + |
| 9 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | +Unless required by applicable law or agreed to in writing, software |
| 12 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +See the License for the specific language governing permissions and |
| 15 | +limitations under the License. |
| 16 | +--> |
| 17 | + |
| 18 | +# Project overview |
| 19 | + |
| 20 | +Apache Celix is an implementation of the OSGi specification adapted for C (C11) and C++ (C++14). |
| 21 | +It enables a dynamic, modular software architecture using bundles, services, and components. |
| 22 | + |
| 23 | +Key Concepts |
| 24 | + - Bundles: Deployment units (zip files) containing libraries and resources. |
| 25 | + - Services: Function pointer structs (C) or abstract classes (C++) registered in a framework-wide registry. |
| 26 | + - Components: Logic units managed by the Dependency Manager (DM) that handle service lifecycle (init, start, stop, deinit) declaratively. |
| 27 | + - Containers: Executables created via add_celix_container that launch a framework instance with preconfigured bundles. |
| 28 | + |
| 29 | +## Building (Offline Priority) |
| 30 | + |
| 31 | +Assume no internet connection. Request confirmation before installing system packages. |
| 32 | + |
| 33 | +```bash |
| 34 | + |
| 35 | +# Initial configure build: |
| 36 | +cmake \ |
| 37 | + -DCMAKE_FETCHCONTENT_FULLY_DISCONNECTED=ON \ |
| 38 | + -DENABLE_TESTING=ON \ |
| 39 | + -DRSA_JSON_RPC=ON \ |
| 40 | + -DRSA_REMOTE_SERVICE_ADMIN_SHM_V2=ON \ |
| 41 | + -DCMAKE_BUILD_TYPE=Debug \ |
| 42 | + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ |
| 43 | + -G Ninja \ |
| 44 | + -S . -B build |
| 45 | + |
| 46 | +# Initial configure build, if a download is needed: |
| 47 | +cmake \ |
| 48 | + -DENABLE_TESTING=ON \ |
| 49 | + -DRSA_JSON_RPC=ON \ |
| 50 | + -DRSA_REMOTE_SERVICE_ADMIN_SHM_V2=ON \ |
| 51 | + -DCMAKE_BUILD_TYPE=Debug \ |
| 52 | + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ |
| 53 | + -G Ninja \ |
| 54 | + -S . -B build |
| 55 | + |
| 56 | +# Compile: |
| 57 | +cmake --build build --parallel |
| 58 | +``` |
| 59 | + |
| 60 | +# Test Execution |
| 61 | + |
| 62 | +After building, run the tests for the components you changed. Run `ctest` from |
| 63 | +the appropriate `build` subdirectory when possible. |
| 64 | +For example, to test the shell bundles: |
| 65 | + |
| 66 | +Scoped: |
| 67 | +```bash |
| 68 | +ctest --output-on-failure --test-dir build/<sub-dir> |
| 69 | +``` |
| 70 | + |
| 71 | +Full Suite: |
| 72 | +```bash |
| 73 | +ctest --output-on-failure --test-dir build |
| 74 | +``` |
| 75 | + |
| 76 | +With exception of documentation changes, always build and run the test before submitting changes. |
| 77 | + |
| 78 | +# Quality Standards |
| 79 | + |
| 80 | +- Line Coverage: New code must aim for >95% line coverage. |
| 81 | +- Error Injection: Use or extend the Apache Celix error_injector libraries to inject errors in unit tests to ensure high code coverage. |
| 82 | + |
| 83 | +# Coding Style |
| 84 | + |
| 85 | +- Refer to the [development guide](documents/development/README.md) for the project's coding conventions. |
| 86 | +- New files should be formatted with the project's `.clang-format` configuration. |
| 87 | + |
0 commit comments