celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [2/2] celix git commit: CELIX-414: Adds initial changes so that add_deploy will result in a add_executable (using a minimal main.c file).
Date Wed, 08 Nov 2017 19:25:27 GMT
CELIX-414: Adds initial changes so that add_deploy will result in a add_executable (using a
minimal main.c file).

These changes result in a executable which can be directly run in the CLI without a release
and a executable which can be runned from CLion without additional config.


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

Branch: refs/heads/develop
Commit: 27b9648b0cbedbaecb4018a07e9977f83258b05d
Parents: 918c2dd
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Wed Nov 8 20:24:17 2017 +0100
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Wed Nov 8 20:24:34 2017 +0100

----------------------------------------------------------------------
 cmake/cmake_celix/DeployPackaging.cmake | 100 +++++++++++----------------
 cmake/cmake_celix/DockerPackaging.cmake |  20 +++---
 cmake/cmake_celix/Runtimes.cmake        |  30 ++++----
 cmake/cmake_celix/main.c.in             |  24 +++++++
 cmake/cmake_celix/runtime_common.sh.in  |   2 +-
 cmake/cmake_celix/runtime_start.sh.in   |   2 +-
 cmake/cmake_celix/runtime_stop.sh.in    |   2 +-
 pubsub/deploy/CMakeLists.txt            |  40 +++++------
 pubsub/test/CMakeLists.txt              |   4 +-
 pubsub/test/test/tst_activator.cpp      |  12 ++--
 10 files changed, 120 insertions(+), 116 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/27b9648b/cmake/cmake_celix/DeployPackaging.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/DeployPackaging.cmake b/cmake/cmake_celix/DeployPackaging.cmake
index 2dfc540..2b21265 100644
--- a/cmake/cmake_celix/DeployPackaging.cmake
+++ b/cmake/cmake_celix/DeployPackaging.cmake
@@ -50,64 +50,36 @@ function(add_celix_container)
 
     ##### Setting defaults #####
     if (CONTAINER_GROUP)
-        set(CONTAINER_LOCATION "${CONTAINER_DIR}/${CONTAINER_GROUP}/${CONTAINER_NAME}")
+        set(CONTAINER_LOC "${CONTAINER_DIR}/${CONTAINER_GROUP}/${CONTAINER_NAME}")
         set(CONTAINER_PRINT_NAME "${CONTAINER_GROUP}/${CONTAINER_NAME}")
     else ()
-        set(CONTAINER_LOCATION "${CONTAINER_DIR}/${CONTAINER_NAME}")
+        set(CONTAINER_LOC "${CONTAINER_DIR}/${CONTAINER_NAME}")
         set(CONTAINER_PRINT_NAME "${CONTAINER_NAME}")
     endif ()
     ######
 
-
-    ###### Setup deploy custom target and config.properties file
-    set(TIMESTAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CONTAINER_TARGET}-container-timestamp")
-
-    add_custom_target(${CONTAINER_TARGET}
-        DEPENDS ${TIMESTAMP_FILE}
-    )
     get_target_property(CONTAINERDEPS containers "CONTAINER_DEPLOYMENTS")
     list(APPEND CONTAINERDEPS ${CONTAINER_TARGET})
     set_target_properties(containers PROPERTIES "CONTAINER_DEPLOYMENTS" "${CONTAINERDEPS}")
 
     #FILE TARGETS FOR CONTAINER
-    set(CONTAINER_EXE "${CONTAINER_LOCATION}/${CONTAINER_NAME}")
-    set(CONTAINER_RUN_SH "${CONTAINER_LOCATION}/run.sh")
-    set(CONTAINER_PROPS "${CONTAINER_LOCATION}/config.properties")
-    set(CONTAINER_ECLIPSE_LAUNCHER "${CONTAINER_LOCATION}/${CONTAINER_NAME}.launch")
-    set(CONTAINER_RELEASE_SH "${CONTAINER_LOCATION}/release.sh")
-
-    find_program(LINK_CMD ln)
-    if (LINK_CMD) 
-        #if ln is available use a softlink to celix exe instead of a run.sh
-        list(APPEND CONTAINER_FILE_TARGETS ${CONTAINER_PROPS} ${CONTAINER_ECLIPSE_LAUNCHER}
${CONTAINER_RELEASE_SH} ${CONTAINER_RUN_SH} ${CONTAINER_EXE})
-    else()
-        list(APPEND CONTAINER_FILE_TARGETS ${CONTAINER_PROPS} ${CONTAINER_ECLIPSE_LAUNCHER}
${CONTAINER_RELEASE_SH} ${CONTAINER_RUN_SH})
-    endif()
+    set(CONTAINER_PROPS "${CONTAINER_LOC}/config.properties")
+    set(CONTAINER_ECLIPSE_LAUNCHER "${CONTAINER_LOC}/${CONTAINER_NAME}.launch")
+
+    set(LAUNCHER_SRC "${CMAKE_CURRENT_BINARY_DIR}/${CONTAINER_TARGET}.launcher.c")
 
-    #setup dependencies based on timestamp
-    add_custom_command(OUTPUT "${TIMESTAMP_FILE}"
-        COMMAND ${CMAKE_COMMAND} -E touch ${TIMESTAMP_FILE}
-        COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_LOCATION>
-        COMMAND chmod +x $<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_LOCATION>/run.sh
-        COMMAND chmod +x $<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_LOCATION>/release.sh
+    add_custom_command(OUTPUT ${LAUNCHER_SRC}
+        COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CELIX_CMAKE_DIRECTORY}/cmake_celix/main.c.in
${LAUNCHER_SRC}
         DEPENDS  "$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_TARGET_DEPS>" ${CONTAINER_FILE_TARGETS}
-        WORKING_DIRECTORY "${CONTAINER_LOCATION}"
+        WORKING_DIRECTORY "${CONTAINER_LOC}"
         COMMENT "Deploying ${CONTAINER_PRINT_NAME} Celix container" VERBATIM
     )
 
-    #Setting CELIX_LIB_DIRS, CELIX_BIN_DIR and CELIX_LAUNCHER 
-    if (EXISTS ${CELIX_FRAMEWORK_LIBRARY}) 
-        #CELIX_FRAMEWORK_LIBRARY set by FindCelix.cmake -> Celix Based Project
-        get_filename_component(CELIX_LIB_DIR ${CELIX_FRAMEWORK_LIBRARY} DIRECTORY) #Note
assuming all celix libs are in the same dir
-        set(CELIX_LIB_DIRS "${CELIX_LIB_DIR}")
-        #CELIX_LAUNCHER is set by FindCelix.cmake
-        get_filename_component(CELIX_BIN_DIR ${CELIX_LAUNCHER} DIRECTORY)
-    else()
-        #Celix Main Project
-        set(CELIX_LIB_DIRS "$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>")
-        set(CELIX_LAUNCHER "$<TARGET_FILE:celix>")
-        set(CELIX_BIN_DIR  "$<TARGET_FILE_DIR:celix>")
-    endif()
+    include_directories(${CELIX_INCLUDE_DIRS})
+    add_executable(${CONTAINER_TARGET} ${LAUNCHER_SRC})
+    set_target_properties(${CONTAINER_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CONTAINER_LOC})
+    #TODO SETUP CELIX_LIBRARIES AND INCLUDE DIRS for celix project and celix using projects
!!
+    target_link_libraries(${CONTAINER_TARGET} ${CELIX_LIBRARIES})
 
     #generate config.properties
     set(STAGE1_PROPERTIES "${CMAKE_CURRENT_BINARY_DIR}/${CONTAINER_TARGET}-container-config-stage1.properties")
@@ -124,7 +96,7 @@ $<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_PROPERTIES>,
     )
 
 
-    #Setup launcher using celix target, celix binary or custom launcher
+    #Setup launcher using specifie exe target / exe loc or the container launcher targer
file
     if (CONTAINER_LAUNCHER)
         if (IS_ABSOLUTE "${CONTAINER_LAUNCHER}")
             set(LAUNCHER "${CONTAINER_LAUNCHER}")
@@ -133,17 +105,23 @@ $<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_PROPERTIES>,
             set(LAUNCHER "$<TARGET_FILE:${CONTAINER_LAUNCHER}>")
         endif()
     else()
-        #Use CELIX_LAUNCHER
-        set(LAUNCHER "${CELIX_LAUNCHER}")
+        set(LAUNCHER "$<TARGET_FILE:${CONTAINER_TARGET}>")
     endif()
 
-    #softlink celix exe file
-    add_custom_command(OUTPUT "${CONTAINER_EXE}"
-        COMMAND ${LINK_CMD} -s "${LAUNCHER}" "${CONTAINER_EXE}"
-        WORKING_DIRECTORY ${CONTAINER_LOCATION}
-        DEPENDS "${LAUNCHER}" 
-        COMMENT "Symbolic link launcher to ${CONTAINER_EXE}" VERBATIM
-    ) 
+    #needed in the release.sh & run.sh files
+    #Setting CELIX_LIB_DIRS, CELIX_BIN_DIR and CELIX_LAUNCHER
+    if (EXISTS ${CELIX_FRAMEWORK_LIBRARY})
+        #CELIX_FRAMEWORK_LIBRARY set by FindCelix.cmake -> Celix Based Project
+        get_filename_component(CELIX_LIB_DIR ${CELIX_FRAMEWORK_LIBRARY} DIRECTORY) #Note
assuming all celix libs are in the same dir
+        set(CELIX_LIB_DIRS "${CELIX_LIB_DIR}")
+        #CELIX_LAUNCHER is set by FindCelix.cmake
+        get_filename_component(CELIX_BIN_DIR ${CELIX_LAUNCHER} DIRECTORY)
+    else()
+        #Celix Main Project
+        set(CELIX_LIB_DIRS "$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>")
+        set(CELIX_LAUNCHER "$<TARGET_FILE:celix>")
+        set(CELIX_BIN_DIR  "$<TARGET_FILE_DIR:celix>")
+    endif()
 
 
     #generate release.sh and optional run.sh
@@ -152,25 +130,27 @@ $<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_PROPERTIES>,
     else()
         set(LIB_PATH_NAME "LD_LIBRARY_PATH")
     endif()
+    set(RELEASE_SH ${CONTAINER_LOC}/release.sh)
+    set(RUN_SH ${CONTAINER_LOC}/run.sh)
     set(RELEASE_CONTENT "#!/bin/sh\nexport ${LIB_PATH_NAME}=${CELIX_LIB_DIRS}:\${${LIB_PATH_NAME}}\nexport
PATH=${CELIX_BIN_DIR}:\${PATH}")
     file(GENERATE
-        OUTPUT ${CONTAINER_RELEASE_SH}
+        OUTPUT ${RELEASE_SH}
         CONTENT ${RELEASE_CONTENT}
     )
     set(RUN_CONTENT "${RELEASE_CONTENT}\n${LAUNCHER} \$@\n")
     file(GENERATE
-        OUTPUT ${CONTAINER_RUN_SH}
+        OUTPUT ${RUN_SH}
         CONTENT ${RUN_CONTENT}
     )
 
     #generate eclipse project launch file
     set(PROGRAM_NAME "${LAUNCHER}")
     set(PROJECT_ATTR "${CMAKE_PROJECT_NAME}-build")
-    set(WORKING_DIRECTORY ${CONTAINER_LOCATION})
+    set(WORKING_DIRECTORY ${CONTAINER_LOC})
     include("${CELIX_CMAKE_DIRECTORY}/cmake_celix/RunConfig.in.cmake") #set VAR RUN_CONFIG_IN
     file(GENERATE
         OUTPUT "${CONTAINER_ECLIPSE_LAUNCHER}"
-        CONTENT "${RUN_CONFIG_IN}"    
+        CONTENT "${RUN_CONFIG_IN}"
     )
 
     ##### Container Target Properties #####
@@ -182,7 +162,7 @@ $<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_PROPERTIES>,
     #deploy specific
     set_target_properties(${CONTAINER_TARGET} PROPERTIES "CONTAINER_NAME" "${CONTAINER_NAME}")
     set_target_properties(${CONTAINER_TARGET} PROPERTIES "CONTAINER_GROUP" "${CONTAINER_GROUP}")
-    set_target_properties(${CONTAINER_TARGET} PROPERTIES "CONTAINER_LOCATION" "${CONTAINER_LOCATION}")
+    set_target_properties(${CONTAINER_TARGET} PROPERTIES "CONTAINER_LOC" "${CONTAINER_LOC}")
     set_target_properties(${CONTAINER_TARGET} PROPERTIES "CONTAINER_PROPERTIES" "")
     #####
 
@@ -192,7 +172,7 @@ $<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_PROPERTIES>,
 
     #ensure the container dir will be deleted during clean
     get_directory_property(CLEANFILES ADDITIONAL_MAKE_CLEAN_FILES)
-    list(APPEND CLEANFILES "$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_LOCATION>")
+    list(APPEND CLEANFILES "$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_LOC>")
     set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CLEANFILES}")
 endfunction()
 
@@ -215,7 +195,7 @@ function(celix_container_bundles_dir)
         message(FATAL_ERROR "Missing mandatory DIR_NAME argument")
     endif()
 
-    get_target_property(CONTAINER_LOC ${CONTAINER_TARGET} "CONTAINER_LOCATION")
+    get_target_property(CONTAINER_LOC ${CONTAINER_TARGET} "CONTAINER_LOC")
     get_target_property(DEPS ${CONTAINER_TARGET} "CONTAINER_TARGET_DEPS")
 
     foreach(BUNDLE IN ITEMS ${BD_BUNDLES})
@@ -224,7 +204,7 @@ function(celix_container_bundles_dir)
             set(OUT "${CONTAINER_LOC}/${BD_DIR_NAME}/${BUNDLE_FILENAME}")
             add_custom_command(OUTPUT ${OUT}
                 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BUNDLE} ${OUT}
-                COMMENT "Copying bundle '${BUNDLE}' to '${CONATAINER_LOC}/${BD_DIR_NAME}'"
+		COMMENT "Copying bundle '${BUNDLE}' to '${CONTAINER_LOC}/${BD_DIR_NAME}'"
                 DEPENDS ${BUNDLE}
             )
         else()

http://git-wip-us.apache.org/repos/asf/celix/blob/27b9648b/cmake/cmake_celix/DockerPackaging.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/DockerPackaging.cmake b/cmake/cmake_celix/DockerPackaging.cmake
index ae48273..7cce6dd 100644
--- a/cmake/cmake_celix/DockerPackaging.cmake
+++ b/cmake/cmake_celix/DockerPackaging.cmake
@@ -106,7 +106,7 @@ function(add_celix_docker)
 
     #ensure the docker dir will be deleted during clean
     get_directory_property(CLEANFILES ADDITIONAL_MAKE_CLEAN_FILES)
-    list(APPEND CLEANFILES "$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOCATION>")
+    list(APPEND CLEANFILES "$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOC>")
     set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CLEANFILES}")
 
     ###### Setup docker custom target timestamp
@@ -128,24 +128,24 @@ function(add_celix_docker)
     if (DOCKER_CREATE_FS)
         add_custom_command(OUTPUT "${TIMESTAMP_FILE}"
             COMMAND ${CMAKE_COMMAND} -E touch ${TIMESTAMP_FILE}
-            COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOCATION>
-            COMMAND cd $<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOCATION> &&
/bin/bash ${CELIX_CMAKE_DIRECTORY}/cmake_celix/create_target_filesystem.sh -e ${CELIX_LAUNCHER}
-l $<TARGET_FILE:${DOCKER_DEPSLIB}> > /dev/null
+	    COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOC>
+	    COMMAND cd $<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOC> && /bin/bash
${CELIX_CMAKE_DIRECTORY}/cmake_celix/create_target_filesystem.sh -e ${CELIX_LAUNCHER} -l $<TARGET_FILE:${DOCKER_DEPSLIB}>
> /dev/null
             DEPENDS  "$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_DEPS>" ${DOCKERFILE}
${DOCKER_DEPSLIB}
-            WORKING_DIRECTORY "${DOCKER_LOCATION}"
+	    WORKING_DIRECTORY "${DOCKER_LOC}"
             COMMENT "Creating docker dir for ${DOCKER_TARGET}" VERBATIM
         )
     else ()
         add_custom_command(OUTPUT "${TIMESTAMP_FILE}"
             COMMAND ${CMAKE_COMMAND} -E touch ${TIMESTAMP_FILE}
-            COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOCATION>
+	    COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOC>
             DEPENDS  "$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_DEPS>" ${DOCKERFILE}
-            WORKING_DIRECTORY "${DOCKER_LOCATION}"
+	    WORKING_DIRECTORY "${DOCKER_LOC}"
             COMMENT "Creating docker dir for ${DOCKER_TARGET}" VERBATIM
         )
     endif ()
 
     ##### Deploy Target Properties for Dockerfile #####
-    set_target_properties(${DOCKER_TARGET} PROPERTIES "DOCKER_LOCATION" "${DOCKER_LOC}")
+    set_target_properties(${DOCKER_TARGET} PROPERTIES "DOCKER_LOC" "${DOCKER_LOC}")
     set_target_properties(${DOCKER_TARGET} PROPERTIES "DOCKER_FROM" "${DOCKER_FROM}") #name
of docker base, default celix-base
     set_target_properties(${DOCKER_TARGET} PROPERTIES "DOCKER_IMAGE_NAME" "${DOCKER_IMAGE_NAME}")
#name of docker images, default deploy target name
     set_target_properties(${DOCKER_TARGET} PROPERTIES "DOCKER_BUNDLES_DIR" "${DOCKER_BUNDLES_DIR}")
#bundles directory in docker image
@@ -157,7 +157,7 @@ function(add_celix_docker)
     set_target_properties(${DOCKER_TARGET} PROPERTIES "DOCKER_PROPERTIES" "")
     set_target_properties(${DOCKER_TARGET} PROPERTIES "DOCKER_DEPS" "")
 
-    set(DOCKERFILE "$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOCATION>/Dockerfile")
+    set(DOCKERFILE "$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOC>/Dockerfile")
 
     file(GENERATE
             OUTPUT "${DOCKERFILE}"
@@ -207,7 +207,7 @@ $<JOIN:$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_PROPERTIES>,
         set(SUDO_CMD "sudo")
     endif ()
     add_custom_target(build-${DOCKER_TARGET}-docker-image
-	    COMMAND cd $<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOCATION> && ${SUDO_CMD}
${DOCKER_CMD} build -t "$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_IMAGE_NAME>" .
+	    COMMAND cd $<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_LOC> && ${SUDO_CMD}
${DOCKER_CMD} build -t "$<TARGET_PROPERTY:${DOCKER_TARGET},DOCKER_IMAGE_NAME>" .
         DEPENDS ${DOCKERFILE} ${DOCKER_TARGET}
         COMMENT "Creating docker image for target '${DOCKER_TARGET}'" VERBATIM
     )
@@ -227,7 +227,7 @@ function(celix_docker_bundles)
 
     get_target_property(BUNDLES ${DOCKER_TARGET} "DOCKER_BUNDLES")
     get_target_property(BUNDLES_DIR ${DOCKER_TARGET} "DOCKER_BUNDLES_DIR")
-    get_target_property(LOC ${DOCKER_TARGET} "DOCKER_LOCATION")
+    get_target_property(LOC ${DOCKER_TARGET} "DOCKER_LOC")
     get_target_property(DEPS ${DOCKER_TARGET} "DOCKER_DEPS")
 
     foreach(BUNDLE IN ITEMS ${ARGN})

http://git-wip-us.apache.org/repos/asf/celix/blob/27b9648b/cmake/cmake_celix/Runtimes.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/Runtimes.cmake b/cmake/cmake_celix/Runtimes.cmake
index 7665527..a55a089 100644
--- a/cmake/cmake_celix/Runtimes.cmake
+++ b/cmake/cmake_celix/Runtimes.cmake
@@ -17,24 +17,24 @@ function(add_runtime)
         set(RUNTIME_NAME ${RUNTIME_TARGET_NAME})
     endif ()
     if (NOT RUNTIME_GROUP)
-        set(RUNTIME_LOCATION "${PROJECT_BINARY_DIR}/runtimes/${RUNTIME_NAME}")
+        set(RUNTIME_LOC "${PROJECT_BINARY_DIR}/runtimes/${RUNTIME_NAME}")
     else ()
-        set(RUNTIME_LOCATION "${PROJECT_BINARY_DIR}/runtimes/${RUNTIME_GROUP}/${RUNTIME_NAME}")
+        set(RUNTIME_LOC "${PROJECT_BINARY_DIR}/runtimes/${RUNTIME_GROUP}/${RUNTIME_NAME}")
     endif ()
     set(TIMESTAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${RUNTIME_TARGET_NAME}-runtime-timestamp")
 
-    set(START_SCRIPT "$<TARGET_PROPERTY:${RUNTIME_TARGET_NAME},RUNTIME_LOCATION>/start.sh")
-    set(STOP_SCRIPT "$<TARGET_PROPERTY:${RUNTIME_TARGET_NAME},RUNTIME_LOCATION>/stop.sh")
-    set(COMMON_SCRIPT "$<TARGET_PROPERTY:${RUNTIME_TARGET_NAME},RUNTIME_LOCATION>/common.sh")
+    set(START_SCRIPT "$<TARGET_PROPERTY:${RUNTIME_TARGET_NAME},RUNTIME_LOC>/start.sh")
+    set(STOP_SCRIPT "$<TARGET_PROPERTY:${RUNTIME_TARGET_NAME},RUNTIME_LOC>/stop.sh")
+    set(COMMON_SCRIPT "$<TARGET_PROPERTY:${RUNTIME_TARGET_NAME},RUNTIME_LOC>/common.sh")
 
     add_custom_command(OUTPUT "${TIMESTAMP_FILE}"
         COMMAND ${CMAKE_COMMAND} -E touch ${TIMESTAMP_FILE}
-        COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_PROPERTY:${RUNTIME_TARGET_NAME},RUNTIME_LOCATION>
-        COMMAND chmod +x $<TARGET_PROPERTY:${RUNTIME_TARGET_NAME},RUNTIME_LOCATION>/start.sh
-        COMMAND chmod +x $<TARGET_PROPERTY:${RUNTIME_TARGET_NAME},RUNTIME_LOCATION>/stop.sh
+        COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_PROPERTY:${RUNTIME_TARGET_NAME},RUNTIME_LOC>
+        COMMAND chmod +x $<TARGET_PROPERTY:${RUNTIME_TARGET_NAME},RUNTIME_LOC>/start.sh
+        COMMAND chmod +x $<TARGET_PROPERTY:${RUNTIME_TARGET_NAME},RUNTIME_LOC>/stop.sh
         #TODO DEPENDS  "$<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_TARGET_DEPS>" ${DEPLOY_FILE_TARGETS}
         DEPENDS  ${START_SCRIPT} ${STOP_SCRIPT} ${SETUP_SCRIPT}
-        WORKING_DIRECTORY "${RUNTIME_LOCATION}"
+        WORKING_DIRECTORY "${RUNTIME_LOC}"
         COMMENT "Creating runtime ${RUNTIME_TARGET_NAME}" VERBATIM
     )
     add_custom_target(${RUNTIME_TARGET_NAME}
@@ -46,7 +46,7 @@ function(add_runtime)
     set_target_properties(${RUNTIME_TARGET_NAME} PROPERTIES "RUNTIME_ARGUMENTS" "") #potential
arguments to use for deployments
     set_target_properties(${RUNTIME_TARGET_NAME} PROPERTIES "RUNTIME_NAME" "${RUNTIME_NAME}")
#The runtime workdir
     set_target_properties(${RUNTIME_TARGET_NAME} PROPERTIES "RUNTIME_GROUP" "${RUNTIME_GROUP}")
#The runtime workdir
-    set_target_properties(${RUNTIME_TARGET_NAME} PROPERTIES "RUNTIME_LOCATION" "${RUNTIME_LOCATION}")
#The runtime workdir
+    set_target_properties(${RUNTIME_TARGET_NAME} PROPERTIES "RUNTIME_LOC" "${RUNTIME_LOC}")
#The runtime workdir
     set_target_properties(${RUNTIME_TARGET_NAME} PROPERTIES "RUNTIME_USE_TERM" "${RUNTIME_USE_TERM}")
#Wether or not the use terminal
     set_target_properties(${RUNTIME_TARGET_NAME} PROPERTIES "RUNTIME_LOG_TO_FILES" "${RUNTIME_LOG_TO_FILES}")
#log to files or std out/err
     set_target_properties(${RUNTIME_TARGET_NAME} PROPERTIES "RUNTIME_NEXT_DEPLOYMENT_ID"
"0") #used for indexes int he bash scripts
@@ -80,7 +80,7 @@ function(add_runtime)
     )
 
 
-    #replaces list of $<TARGET_PROPERTY:<DEPLOY_NAME>,DEPLOY_LOCATION>, only
needed for common
+    #replaces list of $<TARGET_PROPERTY:<DEPLOY_NAME>,DEPLOY_LOC>, only needed
for common
     file(GENERATE
         OUTPUT "${COMMON_SCRIPT}"
         INPUT "${CMAKE_CURRENT_BINARY_DIR}/common.sh.${RUNTIME_TARGET_NAME}.in.2"
@@ -127,9 +127,9 @@ function(runtime_deployments)
         get_target_property(DEP_ID ${RUNTIME_NAME} "RUNTIME_NEXT_DEPLOYMENT_ID")
         math(EXPR DEP_ID "${DEP_ID}+1")
         set_target_properties(${RUNTIME_NAME} PROPERTIES "RUNTIME_DEPLOYMENT_${DEPLOYMENT}_ID"
"${DEP_ID}")
-        list(APPEND DEPLOYMENTS "DEPLOYMENT_NAMES[${DEP_ID}]=\"$<TARGET_PROPERTY:${DEPLOYMENT},DEPLOY_NAME>\"")
-        list(APPEND DEPLOYMENTS "DEPLOYMENT_DIRS[${DEP_ID}]=\"$<TARGET_PROPERTY:${DEPLOYMENT},DEPLOY_LOCATION>\"")
-	list(APPEND DEPLOYMENTS "DEPLOYMENT_DEBUG_OPTS[${DEP_ID}]=\"\${${DEPLOYMENT}_DEBUG_OPTS:-}\"")
+        list(APPEND DEPLOYMENTS "DEPLOYMENT_NAMES[${DEP_ID}]=\"$<TARGET_PROPERTY:${DEPLOYMENT},CONTAINER_NAME>\"")
+        list(APPEND DEPLOYMENTS "DEPLOYMENT_DIRS[${DEP_ID}]=\"$<TARGET_PROPERTY:${DEPLOYMENT},CONTAINER_LOC>\"")
+        list(APPEND DEPLOYMENTS "DEPLOYMENT_DEBUG_OPTS[${DEP_ID}]=\"\${${DEPLOYMENT}_DEBUG_OPTS:-}\"")
         set_target_properties(${RUNTIME_NAME} PROPERTIES "RUNTIME_NEXT_DEPLOYMENT_ID" "${DEP_ID}")
    endforeach()
 
@@ -142,7 +142,7 @@ function(runtime_deployment_wait_for)
     list(GET ARGN 0 RUNTIME_NAME)
     list(GET ARGN 1 DEPLOYMENT)
 
-    set_target_properties(${RUNTIME_NAME} PROPERTIES "RUNTIME_WAIT_FOR_DEPLOYMENT" "$<TARGET_PROPERTY:${DEPLOYMENT},DEPLOY_LOCATION>")
+    set_target_properties(${RUNTIME_NAME} PROPERTIES "RUNTIME_WAIT_FOR_DEPLOYMENT" "$<TARGET_PROPERTY:${DEPLOYMENT},DEPLOY_LOC>")
     set_target_properties(${RUNTIME_NAME} PROPERTIES "RUNTIME_WAIT_FOR_COMMAND" "")
 endfunction()
 

http://git-wip-us.apache.org/repos/asf/celix/blob/27b9648b/cmake/cmake_celix/main.c.in
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/main.c.in b/cmake/cmake_celix/main.c.in
new file mode 100644
index 0000000..bd26e8b
--- /dev/null
+++ b/cmake/cmake_celix/main.c.in
@@ -0,0 +1,24 @@
+/**
+ *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 "celix_launcher.h"
+
+int main(int argc, char *argv[]) {
+    return celixLauncher_launchWithArgs(argc, argv);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/celix/blob/27b9648b/cmake/cmake_celix/runtime_common.sh.in
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/runtime_common.sh.in b/cmake/cmake_celix/runtime_common.sh.in
index bc01470..b819bf8 100644
--- a/cmake/cmake_celix/runtime_common.sh.in
+++ b/cmake/cmake_celix/runtime_common.sh.in
@@ -2,7 +2,7 @@
 
 #Locations
 BUILD_DIR="${BUILD_DIR:-@PROJECT_BINARY_DIR@}"
-RUNTIME_DIR="${RUNTIME_DIR:-$<TARGET_PROPERTY:@RUNTIME_TARGET_NAME@,RUNTIME_LOCATION>}"
+RUNTIME_DIR="${RUNTIME_DIR:-$<TARGET_PROPERTY:@RUNTIME_TARGET_NAME@,RUNTIME_LOC>}"
 DEPLOY_DIR="${DEPLOY_DIR:-${BUILD_DIR}/deploy}"
 
 #Name & Group

http://git-wip-us.apache.org/repos/asf/celix/blob/27b9648b/cmake/cmake_celix/runtime_start.sh.in
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/runtime_start.sh.in b/cmake/cmake_celix/runtime_start.sh.in
index d3c1774..f929f18 100644
--- a/cmake/cmake_celix/runtime_start.sh.in
+++ b/cmake/cmake_celix/runtime_start.sh.in
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-source $<TARGET_PROPERTY:@RUNTIME_TARGET_NAME@,RUNTIME_LOCATION>/common.sh
+source $<TARGET_PROPERTY:@RUNTIME_TARGET_NAME@,RUNTIME_LOC>/common.sh
 
 rt_init
 rt_start_all

http://git-wip-us.apache.org/repos/asf/celix/blob/27b9648b/cmake/cmake_celix/runtime_stop.sh.in
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/runtime_stop.sh.in b/cmake/cmake_celix/runtime_stop.sh.in
index b0db1e6..79c3fe7 100644
--- a/cmake/cmake_celix/runtime_stop.sh.in
+++ b/cmake/cmake_celix/runtime_stop.sh.in
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-source $<TARGET_PROPERTY:@RUNTIME_TARGET_NAME@,RUNTIME_LOCATION>/common.sh
+source $<TARGET_PROPERTY:@RUNTIME_TARGET_NAME@,RUNTIME_LOC>/common.sh
 
 #Options
 USE_SIGNAL=${USE_SIGNAL:-}

http://git-wip-us.apache.org/repos/asf/celix/blob/27b9648b/pubsub/deploy/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/pubsub/deploy/CMakeLists.txt b/pubsub/deploy/CMakeLists.txt
index a787c2b..5039aea 100644
--- a/pubsub/deploy/CMakeLists.txt
+++ b/pubsub/deploy/CMakeLists.txt
@@ -19,13 +19,13 @@ find_program(ETCD_CMD NAMES etcd)
 find_program(XTERM_CMD NAMES xterm)
 
 # UDP Multicast
-add_deploy("pubsub_publisher_udp_mc"
-	GROUP "pubsub"
+add_deploy(pubsub_publisher_udp_mc
+	GROUP pubsub
 	BUNDLES
 	   shell
 	   shell_tui
-		org.apache.celix.pubsub_serializer.PubSubSerializerJson
-		org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
+	   org.apache.celix.pubsub_serializer.PubSubSerializerJson
+	   org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
 	   org.apache.celix.pubsub_topology_manager.PubSubTopologyManager
 	   org.apache.celix.pubsub_admin.PubSubAdminUdpMc
 	   org.apache.celix.pubsub_publisher.PoiPublisher
@@ -37,8 +37,8 @@ add_deploy("pubsub_subscriber_udp_mc"
 	BUNDLES
 	   shell
 	   shell_tui
-		org.apache.celix.pubsub_serializer.PubSubSerializerJson
-		org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
+	   org.apache.celix.pubsub_serializer.PubSubSerializerJson
+	   org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
 	   org.apache.celix.pubsub_topology_manager.PubSubTopologyManager
 	   org.apache.celix.pubsub_admin.PubSubAdminUdpMc
 	   org.apache.celix.pubsub_subscriber.PoiSubscriber
@@ -49,8 +49,8 @@ add_deploy("pubsub_subscriber2_udp_mc"
 	BUNDLES
 	   shell
 	   shell_tui
-		org.apache.celix.pubsub_serializer.PubSubSerializerJson
-		org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
+	   org.apache.celix.pubsub_serializer.PubSubSerializerJson
+	   org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
 	   org.apache.celix.pubsub_topology_manager.PubSubTopologyManager
 	   org.apache.celix.pubsub_admin.PubSubAdminUdpMc
 	   org.apache.celix.pubsub_subscriber.PoiSubscriber
@@ -79,8 +79,8 @@ if (BUILD_PUBSUB_PSA_ZMQ)
 	    BUNDLES
 	       shell
 	       shell_tui
-			org.apache.celix.pubsub_serializer.PubSubSerializerJson
-			org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
+	       org.apache.celix.pubsub_serializer.PubSubSerializerJson
+	       org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
 	       org.apache.celix.pubsub_topology_manager.PubSubTopologyManager
 	       org.apache.celix.pubsub_admin.PubSubAdminZmq
 	       org.apache.celix.pubsub_admin.PubSubAdminUdpMc
@@ -96,8 +96,8 @@ if (BUILD_PUBSUB_PSA_ZMQ)
 	    BUNDLES
 	       shell
 	       shell_tui
-			org.apache.celix.pubsub_serializer.PubSubSerializerJson
-			org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
+	       org.apache.celix.pubsub_serializer.PubSubSerializerJson
+	       org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
 	       org.apache.celix.pubsub_topology_manager.PubSubTopologyManager
 	       org.apache.celix.pubsub_admin.PubSubAdminZmq
 	       org.apache.celix.pubsub_admin.PubSubAdminUdpMc
@@ -113,8 +113,8 @@ if (BUILD_PUBSUB_PSA_ZMQ)
 	    BUNDLES
 	       shell
 	       shell_tui
-			org.apache.celix.pubsub_serializer.PubSubSerializerJson
-			org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
+	       org.apache.celix.pubsub_serializer.PubSubSerializerJson
+	       org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
 	       org.apache.celix.pubsub_topology_manager.PubSubTopologyManager
 	       org.apache.celix.pubsub_admin.PubSubAdminZmq
 	       org.apache.celix.pubsub_publisher.PoiPublisher
@@ -126,8 +126,8 @@ if (BUILD_PUBSUB_PSA_ZMQ)
 	    BUNDLES
 	       shell
 	       shell_tui
-			org.apache.celix.pubsub_serializer.PubSubSerializerJson
-			org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
+	       org.apache.celix.pubsub_serializer.PubSubSerializerJson
+	       org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
 	       org.apache.celix.pubsub_topology_manager.PubSubTopologyManager
 	       org.apache.celix.pubsub_admin.PubSubAdminZmq
 	       org.apache.celix.pubsub_publisher.PoiPublisher
@@ -141,7 +141,7 @@ if (BUILD_PUBSUB_PSA_ZMQ)
 	    BUNDLES
 	       shell
 	       shell_tui
-			org.apache.celix.pubsub_serializer.PubSubSerializerJson
+	       org.apache.celix.pubsub_serializer.PubSubSerializerJson
 	       org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
 	       org.apache.celix.pubsub_topology_manager.PubSubTopologyManager
 	       org.apache.celix.pubsub_admin.PubSubAdminZmq
@@ -153,7 +153,7 @@ if (BUILD_PUBSUB_PSA_ZMQ)
 	    BUNDLES
 	       shell
 	       shell_tui
-			org.apache.celix.pubsub_serializer.PubSubSerializerJson
+	       org.apache.celix.pubsub_serializer.PubSubSerializerJson
 	       org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
 	       org.apache.celix.pubsub_topology_manager.PubSubTopologyManager
 	       org.apache.celix.pubsub_admin.PubSubAdminZmq
@@ -167,7 +167,7 @@ if (BUILD_PUBSUB_PSA_ZMQ)
 	    BUNDLES
 	       shell
 	       shell_tui
-			org.apache.celix.pubsub_serializer.PubSubSerializerJson
+	       org.apache.celix.pubsub_serializer.PubSubSerializerJson
 	       org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
 	       org.apache.celix.pubsub_topology_manager.PubSubTopologyManager
 	       org.apache.celix.pubsub_admin.PubSubAdminZmq
@@ -180,7 +180,7 @@ if (BUILD_PUBSUB_PSA_ZMQ)
 	   		shell
 	   		shell_tui
 	   		org.apache.celix.pubsub_serializer.PubSubSerializerJson
-			org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
+	   		org.apache.celix.pubsub_discovery.etcd.PubsubDiscovery
 	   		org.apache.celix.pubsub_topology_manager.PubSubTopologyManager
 	   		org.apache.celix.pubsub_admin.PubSubAdminZmq
 	   		org.apache.celix.pubsub_publisher.MpPublisher

http://git-wip-us.apache.org/repos/asf/celix/blob/27b9648b/pubsub/test/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/pubsub/test/CMakeLists.txt b/pubsub/test/CMakeLists.txt
index f8c0fd2..8279c0c 100644
--- a/pubsub/test/CMakeLists.txt
+++ b/pubsub/test/CMakeLists.txt
@@ -115,7 +115,7 @@ if (ETCD_CMD)
         #USE_TERM
     )
     add_test(NAME pubsub_udpmc_test
-        COMMAND $<TARGET_PROPERTY:pubsub_test_udpmc_runtime,RUNTIME_LOCATION>/start.sh
+	    COMMAND $<TARGET_PROPERTY:pubsub_test_udpmc_runtime,RUNTIME_LOC>/start.sh
     )
 
     add_runtime(pubsub_test_zmq_runtime
@@ -134,6 +134,6 @@ if (ETCD_CMD)
         #USE_TERM
     )
     add_test(NAME pubsub_zmq_test
-        COMMAND $<TARGET_PROPERTY:pubsub_test_zmq_runtime,RUNTIME_LOCATION>/start.sh
+	    COMMAND $<TARGET_PROPERTY:pubsub_test_zmq_runtime,RUNTIME_LOC>/start.sh
     )
 endif ()

http://git-wip-us.apache.org/repos/asf/celix/blob/27b9648b/pubsub/test/test/tst_activator.cpp
----------------------------------------------------------------------
diff --git a/pubsub/test/test/tst_activator.cpp b/pubsub/test/test/tst_activator.cpp
index 4183972..04be892 100644
--- a/pubsub/test/test/tst_activator.cpp
+++ b/pubsub/test/test/tst_activator.cpp
@@ -41,12 +41,12 @@ static int tst_pubAdded(void *handle, service_reference_pt reference,
void *serv
 static int tst_pubRemoved(void *handle, service_reference_pt reference, void *service);
 
 struct activator {
-	pubsub_subscriber_t subSvc;
+	pubsub_subscriber_t subSvc{};
 	service_registration_pt reg = nullptr;
 
 	service_tracker_pt tracker = nullptr;
 
-	pthread_mutex_t mutex; //protects below
+	pthread_mutex_t mutex{}; //protects below
 	pubsub_publisher_t* pubSvc = nullptr;
 
     unsigned int syncId = 0;
@@ -96,7 +96,7 @@ celix_status_t bundleActivator_destroy(__attribute__((unused)) void * userData,
 	return CELIX_SUCCESS;
 }
 
-static int tst_receive(void *handle, const char *msgType, unsigned int msgTypeId, void *msg,
pubsub_multipart_callbacks_t *callbacks, bool *release) {
+static int tst_receive(void *handle, const char * /*msgType*/, unsigned int msgTypeId, void
* /*msg*/, pubsub_multipart_callbacks_t* /*callbacks*/, bool* /*release*/) {
 	struct activator* act = static_cast<struct activator*>(handle);
     pthread_mutex_lock(&act->mutex);
     if (msgTypeId == act->syncId) {
@@ -108,7 +108,7 @@ static int tst_receive(void *handle, const char *msgType, unsigned int
msgTypeId
 	return CELIX_SUCCESS;
 }
 
-static int tst_pubAdded(void *handle, service_reference_pt reference, void *service) {
+static int tst_pubAdded(void *handle, service_reference_pt /*reference*/, void *service)
{
     struct activator* act = static_cast<struct activator*>(handle);
     pthread_mutex_lock(&act->mutex);
 	act->pubSvc = static_cast<pubsub_publisher_t*>(service);
@@ -120,7 +120,7 @@ static int tst_pubAdded(void *handle, service_reference_pt reference,
void *serv
 
 }
 
-static int tst_pubRemoved(void *handle, service_reference_pt reference, void *service) {
+static int tst_pubRemoved(void *handle, service_reference_pt /*reference*/, void *service)
{
     struct activator* act = static_cast<struct activator*>(handle);
     pthread_mutex_lock(&act->mutex);
 	if (act->pubSvc == service) {
@@ -218,4 +218,4 @@ TEST(PUBSUB_INT_GROUP, sendRecvTest) {
     int count = g_act.count;
     pthread_mutex_unlock(&g_act.mutex);
     CHECK_EQUAL(COUNT, count);
-}
\ No newline at end of file
+}


Mime
View raw message