celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rlenfer...@apache.org
Subject celix git commit: CELIX-418: Added packed configuration for docker executables
Date Wed, 03 Jan 2018 09:18:58 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 9ff00c306 -> 6f78b6701


CELIX-418: Added packed configuration for docker executables


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/6f78b670
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/6f78b670
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/6f78b670

Branch: refs/heads/develop
Commit: 6f78b67016d703325cbcee76b5a68fa953dac3b9
Parents: 9ff00c3
Author: Roy Lenferink <lenferinkroy@gmail.com>
Authored: Wed Jan 3 10:18:42 2018 +0100
Committer: Roy Lenferink <lenferinkroy@gmail.com>
Committed: Wed Jan 3 10:18:42 2018 +0100

----------------------------------------------------------------------
 cmake/cmake_celix/DockerPackaging.cmake | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/6f78b670/cmake/cmake_celix/DockerPackaging.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/DockerPackaging.cmake b/cmake/cmake_celix/DockerPackaging.cmake
index 0acd7cc..8b7d8ab 100644
--- a/cmake/cmake_celix/DockerPackaging.cmake
+++ b/cmake/cmake_celix/DockerPackaging.cmake
@@ -95,7 +95,33 @@ function(add_celix_docker)
     else ()
         add_custom_command(OUTPUT ${LAUNCHER_SRC}
                 COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/celix/gen
-                COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAUNCHER_ORG} ${LAUNCHER_SRC}
+        )
+
+        if (DOCKER_CXX)
+            set(LAUNCHER_STAGE1 "${CMAKE_CURRENT_BINARY_DIR}/${DOCKER_TARGET}-docker-main-stage1.cc")
+        else()
+            set(LAUNCHER_STAGE1 "${CMAKE_CURRENT_BINARY_DIR}/${DOCKER_TARGET}-docker-main-stage1.c")
+        endif()
+
+        file(GENERATE
+                OUTPUT "${LAUNCHER_STAGE1}"
+                CONTENT "#include <celix_launcher.h>
+
+int main(int argc, char *argv[]) {
+    const char * config = \"cosgi.auto.start.1=$<JOIN:$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_BUNDLES>,
>\\n\\
+$<JOIN:$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_PROPERTIES>,\\n\\
+>\";
+
+    properties_pt packedConfig = properties_loadFromString(config);
+
+    return celixLauncher_launchWithArgsAndProps(argc, argv, packedConfig);
+}
+"
+        )
+
+        file(GENERATE
+                OUTPUT "${LAUNCHER_SRC}"
+                INPUT "${LAUNCHER_STAGE1}"
         )
 
         add_executable(${DOCKER_TARGET} ${LAUNCHER_SRC})


Mime
View raw message