celix icon indicating copy to clipboard operation
celix copied to clipboard

Feature/embedded bundles

Open pnoltes opened this issue 3 years ago • 1 comments

This PR adds support for embedded bundles. This makes it possible to make Celix container executable where the bundles are embedded in the executable and do not depend on bundle zip files located somewhere on the system.

Bundles can be embedded using the Celix CMake commands:

  • celix_target_embedded_bundles
  • celix_target_embedded_bundle
  • celix_container_embedded_bundles
  • add_celix_container using the EMBEDDED_BUNDLES option

Bundles are embedded using a small CMake generated assembly source file. An other option would be to use the linker, but this works differently on OSX and linux, especially how the naming of the embedded resources works. IMO using a very small assembly source using a incbin directive is better.

How bundles are unzipped (celix_bundle_cache.c) was also refactored so that unzipping using a in memory source is possible. The basic support for this was already added a while back in the celix_file_utils.h functions. The change in how bundles are unzipped also made it possible to remove the embedded mini minizip sources.

This PR also:

  • Adds an option to create a compile definition for a set of bundles (for testing) with the Celix CMake command: celix_target_bundle_set_definition
  • Adds the bundle symbolic name info to an imported bundle target
  • Adds some missing test for celix_bundleState_getName
  • Removes some unused cmake templates
  • Updates Celix CMake commands documentation

This PR is also merged with the list_all_bundles branch, which can be found in the PR: https://github.com/apache/celix/pull/386

pnoltes avatar Jan 03 '22 18:01 pnoltes

Codecov Report

Merging #388 (c1412ae) into master (cfb684e) will increase coverage by 1.19%. The diff coverage is 76.76%.

@@            Coverage Diff             @@
##           master     #388      +/-   ##
==========================================
+ Coverage   72.53%   73.73%   +1.19%     
==========================================
  Files         182      181       -1     
  Lines       29816    28786    -1030     
==========================================
- Hits        21628    21224     -404     
+ Misses       8188     7562     -626     
Impacted Files Coverage Δ
libs/framework/include/celix/Bundle.h 100.00% <ø> (ø)
libs/framework/src/celix_launcher.c 21.37% <4.76%> (-3.41%) :arrow_down:
bundles/shell/shell/src/lb_command.c 78.51% <33.33%> (ø)
libs/framework/src/bundle_archive.c 51.05% <51.42%> (+3.16%) :arrow_up:
libs/framework/src/bundle.c 70.73% <57.14%> (-0.28%) :arrow_down:
libs/framework/src/celix_bundle_cache.c 70.37% <70.37%> (ø)
libs/framework/src/framework.c 78.65% <71.64%> (-0.95%) :arrow_down:
libs/utils/src/utils.c 89.31% <94.11%> (-0.29%) :arrow_down:
libs/framework/src/celix_framework_utils.c 94.93% <94.93%> (ø)
libs/framework/include/celix/FrameworkUtils.h 100.00% <100.00%> (ø)
... and 9 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Jan 03 '22 18:01 codecov-commenter