You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2026/03/03 17:48:04 UTC
(celix) branch master updated (88e228f3a -> 0f994dbe1)
This is an automated email from the ASF dual-hosted git repository.
pnoltes pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/celix.git
from 88e228f3a Fix various CI errors.
new 9c550db3d Remove jar bnd packaging and introduce cmake built-in zip usage
new 0f994dbe1 Remove celix_use_compression_for_bundle_zips option
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.github/workflows/ubuntu.yml | 1 +
CHANGES.md | 2 ++
CMakeLists.txt | 2 --
cmake/cmake_celix/BundlePackaging.cmake | 45 ++++++++++-----------------------
libs/utils/gtest/CMakeLists.txt | 12 ++++-----
5 files changed, 23 insertions(+), 39 deletions(-)
(celix) 02/02: Remove celix_use_compression_for_bundle_zips option
Posted by pn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pnoltes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/celix.git
commit 0f994dbe16f23b4b10618c8f6ca295bd3f5f06ca
Author: Pepijn Noltes <pn...@apache.org>
AuthorDate: Mon Mar 2 20:03:32 2026 +0100
Remove celix_use_compression_for_bundle_zips option
---
conanfile.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/conanfile.py b/conanfile.py
index 2a9640e16..bdf002d31 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -156,7 +156,6 @@ class CelixConan(ConanFile):
del self.info.options.enable_fuzzing
del self.info.options.enable_code_coverage
del self.info.options.enable_gcc_analyzer
- del self.info.options.celix_use_compression_for_bundle_zips
def build_requirements(self):
if self.options.enable_testing:
(celix) 01/02: Remove jar bnd packaging and introduce cmake built-in zip usage
Posted by pn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pnoltes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/celix.git
commit 9c550db3d9ada36944a0eca29b75e17baefa752f
Author: Pepijn Noltes <pn...@apache.org>
AuthorDate: Tue Feb 10 08:47:09 2026 +0100
Remove jar bnd packaging and introduce cmake built-in zip usage
---
.github/workflows/ubuntu.yml | 1 +
CHANGES.md | 2 ++
CMakeLists.txt | 2 --
cmake/cmake_celix/BundlePackaging.cmake | 45 ++++++++++-----------------------
conanfile.py | 1 +
libs/utils/gtest/CMakeLists.txt | 12 ++++-----
6 files changed, 24 insertions(+), 39 deletions(-)
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index 7ebc64776..184c830b8 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -145,6 +145,7 @@ jobs:
-DENABLE_CCACHE=ON
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DENABLE_GCC_ANALYZER=${{matrix.type == 'RelWithDebInfo' && 'ON' || 'OFF'}}
+ -DCELIX_USE_COMPRESSION_FOR_BUNDLE_ZIPS=OFF
-G Ninja
run: |
mkdir build install
diff --git a/CHANGES.md b/CHANGES.md
index 9ffc58162..dc7daa41e 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -83,6 +83,8 @@ limitations under the License.
- The manifest format has been changed to JSON, and the manifest attribute names have been changed.
The old manifest format is no longer supported.
The old manifest attribute names are also no longer defined in `celix_constants.h`.
+- Using jar to packaging bundles is no longer support. Jar was used to ensure the MANIFEST.MF was the first
+ entry in a bundle zip file, but MANIFEST.MF is no longer used (replaced by MANIFEST.json).
## New Features
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09e065ae8..9a69c377e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,8 +157,6 @@ if (ENABLE_TESTING)
enable_testing()
endif()
-option(CELIX_USE_ZIP_INSTEAD_OF_JAR "Default Celix cmake command will use jar to package bundle (if found). This option enforces Celix to use zip instead." OFF)
-
option(CELIX_CXX14 "Build C++14 libraries and bundles." ON)
option(CELIX_CXX17 "Build C++17 libraries, bundles and if testing is enabled C++17 tests" ON)
if (CELIX_CXX17 AND NOT CELIX_CXX14)
diff --git a/cmake/cmake_celix/BundlePackaging.cmake b/cmake/cmake_celix/BundlePackaging.cmake
index bb4869022..2e28c8d13 100644
--- a/cmake/cmake_celix/BundlePackaging.cmake
+++ b/cmake/cmake_celix/BundlePackaging.cmake
@@ -19,28 +19,16 @@
set(CELIX_NO_POSTFIX_BUILD_TYPES RelWithDebInfo Release CACHE STRING "The build type used for creating bundle without a build type postfix.")
option(CELIX_USE_COMPRESSION_FOR_BUNDLE_ZIPS "Enables bundle compression" TRUE)
-if (CELIX_USE_COMPRESSION_FOR_BUNDLE_ZIPS)
- set(CELIX_JAR_COMMAND_ARGUMENTS -cf)
- set(CELIX_ZIP_COMMAND_ARGUMENTS -rq)
-else ()
- set(CELIX_JAR_COMMAND_ARGUMENTS -cf0)
- set(CELIX_ZIP_COMMAND_ARGUMENTS -rq0)
-endif ()
-
-find_program(JAR_COMMAND jar NO_CMAKE_FIND_ROOT_PATH)
-
-if (JAR_COMMAND AND NOT CELIX_USE_ZIP_INSTEAD_OF_JAR)
- message(DEBUG "Using jar to create bundles")
-else ()
+if (NOT CELIX_USE_COMPRESSION_FOR_BUNDLE_ZIPS)
+ #Note `cmake -E tar --format=zip` does not support not compressing the zip files,
+ #falling back to using a zip command.
find_program(ZIP_COMMAND zip NO_CMAKE_FIND_ROOT_PATH)
- if (ZIP_COMMAND)
- message(DEBUG "Using zip to create bundles")
- else ()
- message(FATAL_ERROR "A jar or zip command is needed to created bundles")
+ if (NOT ZIP_COMMAND)
+ message(FATAL_ERROR "Cannot find zip executable, zip exe is needed for creating zip files without compression")
endif ()
+ set(CELIX_ZIP_COMMAND_ARGUMENTS -rq0)
endif ()
-
##### setup bundles/deploy target
if (NOT TARGET celix-bundles)
add_custom_target(celix-bundles ALL)
@@ -286,7 +274,7 @@ function(add_celix_bundle)
)
#########################################################
- ###### Packaging the bundle using using jar or zip and a content dir. Configuring dependencies ######
+ ###### Packaging the bundle using using zip or Cmake built-in zip and a content dir. Configuring dependencies ######
if (ZIP_COMMAND)
file(MAKE_DIRECTORY ${BUNDLE_CONTENT_DIR}) #Note needed because working_directory is bundle content dir
add_custom_command(OUTPUT ${BUNDLE_FILE}
@@ -296,21 +284,18 @@ function(add_celix_bundle)
DEPENDS ${BUNDLE_TARGET_NAME} "$<TARGET_PROPERTY:${BUNDLE_TARGET_NAME},BUNDLE_DEPEND_TARGETS>" ${BUNDLE_GEN_DIR}/MANIFEST.json
WORKING_DIRECTORY ${BUNDLE_CONTENT_DIR}
)
- elseif (JAR_COMMAND)
+ else ()
+ file(MAKE_DIRECTORY ${BUNDLE_CONTENT_DIR}) #Note needed because working_directory is bundle content dir
add_custom_command(OUTPUT ${BUNDLE_FILE}
- COMMAND ${CMAKE_COMMAND} -E make_directory ${BUNDLE_CONTENT_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BUNDLE_GEN_DIR}/MANIFEST.json ${BUNDLE_CONTENT_DIR}/META-INF/MANIFEST.json
- COMMAND ${JAR_COMMAND} ${CELIX_JAR_COMMAND_ARGUMENTS} ${BUNDLE_FILE} -C ${BUNDLE_CONTENT_DIR} .
+ COMMAND ${CMAKE_COMMAND} -E tar cf ${BUNDLE_FILE} --format=zip .
COMMENT "Packaging ${BUNDLE_TARGET_NAME}"
DEPENDS ${BUNDLE_TARGET_NAME} "$<TARGET_PROPERTY:${BUNDLE_TARGET_NAME},BUNDLE_DEPEND_TARGETS>" ${BUNDLE_GEN_DIR}/MANIFEST.json
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ WORKING_DIRECTORY ${BUNDLE_CONTENT_DIR}
)
- else ()
- message(FATAL_ERROR "A jar or zip command is needed to jar/zip bundles")
endif ()
###################################################################################
-
###################################
##### Additional Cleanup info #####
###################################
@@ -943,17 +928,15 @@ function(install_celix_bundle)
)"
COMPONENT ${BUNDLE}
)
- elseif (JAR_COMMAND)
+ else ()
install(CODE
"execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BUNDLE_GEN_DIR}/MANIFEST.json META-INF/MANIFEST.json
- COMMAND ${JAR_COMMAND} ${CELIX_JAR_COMMAND_ARGUMENTS} ${BUNDLE_FILE_INSTALL} -C ${BUNDLE_CONTENT_DIR} .
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND ${CMAKE_COMMAND} -E tar cf ${BUNDLE_FILE_INSTALL} --format=zip .
+ WORKING_DIRECTORY ${BUNDLE_CONTENT_DIR}
)"
COMPONENT ${BUNDLE}
)
- else ()
- message(FATAL_ERROR "A jar or zip command is needed to jar/zip bundles")
endif ()
install(FILES ${BUNDLE_FILE_INSTALL} DESTINATION share/${INSTALL_PROJECT_NAME}/bundles
diff --git a/conanfile.py b/conanfile.py
index bdf002d31..2a9640e16 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -156,6 +156,7 @@ class CelixConan(ConanFile):
del self.info.options.enable_fuzzing
del self.info.options.enable_code_coverage
del self.info.options.enable_gcc_analyzer
+ del self.info.options.celix_use_compression_for_bundle_zips
def build_requirements(self):
if self.options.enable_testing:
diff --git a/libs/utils/gtest/CMakeLists.txt b/libs/utils/gtest/CMakeLists.txt
index 84fe3a4c2..56e8e2987 100644
--- a/libs/utils/gtest/CMakeLists.txt
+++ b/libs/utils/gtest/CMakeLists.txt
@@ -69,14 +69,14 @@ if(ZIP_COMMAND)
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zip_content/top.properties ${CMAKE_CURRENT_BINARY_DIR}/zip_content/subdir/sub.properties
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/zip_content
)
-else()
+else ()
add_custom_command(OUTPUT ${TEST_ZIP_FILE}
- COMMAND ${JAR_COMMAND} -cf ${TEST_ZIP_FILE} -C ${CMAKE_CURRENT_BINARY_DIR}/zip_content .
- COMMENT "Creating ${TEST_ZIP_FILE} for testing"
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zip_content/top.properties ${CMAKE_CURRENT_BINARY_DIR}/zip_content/subdir/sub.properties
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND ${CMAKE_COMMAND} -E tar cf ${TEST_ZIP_FILE} --format=zip .
+ COMMENT "Creating ${TEST_ZIP_FILE} for testing"
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zip_content/top.properties ${CMAKE_CURRENT_BINARY_DIR}/zip_content/subdir/sub.properties
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/zip_content
)
-endif()
+endif ()
add_custom_target(test_utils_resources DEPENDS ${TEST_ZIP_FILE})
add_dependencies(test_utils test_utils_resources)
target_compile_definitions(test_utils PRIVATE -DTEST_ZIP_LOCATION=\"${TEST_ZIP_FILE}\")