Return-Path: Delivered-To: apmail-incubator-celix-commits-archive@minotaur.apache.org Received: (qmail 98245 invoked from network); 9 Dec 2010 12:06:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Dec 2010 12:06:59 -0000 Received: (qmail 2016 invoked by uid 500); 9 Dec 2010 12:06:59 -0000 Delivered-To: apmail-incubator-celix-commits-archive@incubator.apache.org Received: (qmail 1997 invoked by uid 500); 9 Dec 2010 12:06:58 -0000 Mailing-List: contact celix-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: celix-dev@incubator.apache.org Delivered-To: mailing list celix-commits@incubator.apache.org Received: (qmail 1990 invoked by uid 99); 9 Dec 2010 12:06:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Dec 2010 12:06:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED,T_FILL_THIS_FORM_SHORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Dec 2010 12:06:51 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D63D6238890A; Thu, 9 Dec 2010 12:06:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1043922 - in /incubator/celix/trunk: ./ build/ launcher/ sender/ sender/MANIFEST/ test/ Date: Thu, 09 Dec 2010 12:06:29 -0000 To: celix-commits@incubator.apache.org From: abroekhuis@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101209120629.D63D6238890A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: abroekhuis Date: Thu Dec 9 12:06:28 2010 New Revision: 1043922 URL: http://svn.apache.org/viewvc?rev=1043922&view=rev Log: CELIX-1 initial code import Added: incubator/celix/trunk/.cproject incubator/celix/trunk/.project incubator/celix/trunk/Bundle.in incubator/celix/trunk/CMakeLists.txt incubator/celix/trunk/CPackConfig.in incubator/celix/trunk/CPackConfigDeploy.in incubator/celix/trunk/CPackConfigPKG.in incubator/celix/trunk/Packaging.cmake incubator/celix/trunk/build/ incubator/celix/trunk/config.properties incubator/celix/trunk/config.properties.in incubator/celix/trunk/launcher/ incubator/celix/trunk/launcher/CMakeLists.txt incubator/celix/trunk/launcher/launcher.c incubator/celix/trunk/sender/ incubator/celix/trunk/sender/CMakeLists.txt incubator/celix/trunk/sender/MANIFEST/ incubator/celix/trunk/sender/MANIFEST/MANIFEST.MF incubator/celix/trunk/sender/listenerTest.c incubator/celix/trunk/sender/listenerTest.h incubator/celix/trunk/sender/test_activator.c incubator/celix/trunk/target.cmake incubator/celix/trunk/test/ incubator/celix/trunk/test/CMakeLists.txt incubator/celix/trunk/test/main.c Added: incubator/celix/trunk/.cproject URL: http://svn.apache.org/viewvc/incubator/celix/trunk/.cproject?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/.cproject (added) +++ incubator/celix/trunk/.cproject Thu Dec 9 12:06:28 2010 @@ -0,0 +1,269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + make + -C /Users/alexanderb/Documents/workspace-c/celix/build + all + true + true + true + + + make + -C /Users/alexanderb/Documents/workspace-c/celix/build + deploy + true + true + true + + + cmake + + -E chdir ${workspace_loc:/celix}/build cmake -G "Unix Makefiles" ../ + true + false + true + + + make + -C /Users/alexanderb/Documents/workspace-c/celix/build + clean + true + true + true + + + make + -C /Users/alexanderb/Documents/workspace-c/celix/build + help + true + true + true + + + make + -C /Users/alexanderb/Documents/workspace-c/celix/build + install-fw + true + true + true + + + + + + + + + Added: incubator/celix/trunk/.project URL: http://svn.apache.org/viewvc/incubator/celix/trunk/.project?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/.project (added) +++ incubator/celix/trunk/.project Thu Dec 9 12:06:28 2010 @@ -0,0 +1,81 @@ + + + celix + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + -C ${workspace_loc:/celix}/build + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/celix}/build + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + false + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + Added: incubator/celix/trunk/Bundle.in URL: http://svn.apache.org/viewvc/incubator/celix/trunk/Bundle.in?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/Bundle.in (added) +++ incubator/celix/trunk/Bundle.in Thu Dec 9 12:06:28 2010 @@ -0,0 +1,2 @@ +set(BUNDLE_NAME ${NAME}_bundle) +set(PACKAGE_NAME ${NAME}_package) \ No newline at end of file Added: incubator/celix/trunk/CMakeLists.txt URL: http://svn.apache.org/viewvc/incubator/celix/trunk/CMakeLists.txt?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/CMakeLists.txt (added) +++ incubator/celix/trunk/CMakeLists.txt Thu Dec 9 12:06:28 2010 @@ -0,0 +1,40 @@ +cmake_minimum_required (VERSION 2.6) +project (Celix) + +SET(CMAKE_BUILD_TYPE "Debug") +SET(CMAKE_C_FLAGS "-std=c99") +SET(CMAKE_C_FLAGS "-D_GNU_SOURCE") + +ADD_CUSTOM_TARGET(install-fw + ${CMAKE_COMMAND} + -D "CMAKE_INSTALL_COMPONENT=framework" + -D "CMAKE_INSTALL_PREFIX=framework" + -P "celix/cmake_install.cmake" + -P "launcher/cmake_install.cmake" + ) + + +#include(CPackConfig.in) +include(Packaging.cmake) +add_subdirectory(celix) +add_subdirectory(dependency_manager) +add_subdirectory(launcher) +add_subdirectory(test) + +add_subdirectory(shell) +add_subdirectory(shell_tui) + +add_subdirectory(receiver) +add_subdirectory(receiver-2.0) +add_subdirectory(sender) + +add_subdirectory(hello_world) +add_subdirectory(echo_service/client) +add_subdirectory(echo_service/server) +add_subdirectory(whiteboard) +#add_subdirectory(echo_service) + +add_subdirectory(celix_test) + +include(target.cmake) +enable_testing() \ No newline at end of file Added: incubator/celix/trunk/CPackConfig.in URL: http://svn.apache.org/viewvc/incubator/celix/trunk/CPackConfig.in?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/CPackConfig.in (added) +++ incubator/celix/trunk/CPackConfig.in Thu Dec 9 12:06:28 2010 @@ -0,0 +1,21 @@ +SET(CPACK_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +SET(CPACK_GENERATOR "@CPACK_GENERATOR@") +SET(CPACK_INSTALL_CMAKE_PROJECTS "@PROJECT_BINARY_DIR@;@PROJECT_NAME@;@BUNDLE_NAME@;/") +SET(CPACK_MODULE_PATH "") +SET(CPACK_PACKAGE_DESCRIPTION "Package description") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IBS @BUNDLE_NAME@ Package") +#SET(CPACK_PACKAGE_FILE_NAME "@BUNDLE_NAME@-@IBS_VERSION@") +SET(CPACK_PACKAGE_FILE_NAME "@BUNDLE_NAME@") +SET(CPACK_PACKAGE_INSTALL_DIRECTORY "IBS") +SET(CPACK_PACKAGE_NAME "@CPACK_PACKAGE_NAME@") +SET(CPACK_PACKAGE_VENDOR "HPA") +SET(CPACK_PACKAGE_VERSION "@IBS_VERSION@") +SET(CPACK_PACKAGE_VERSION_MAJOR "@IBS_MAJOR@") +SET(CPACK_PACKAGE_VERSION_MINOR "@IBS_MINOR@") +SET(CPACK_PACKAGE_VERSION_PATCH "@IBS_PATCH@") +SET(CPACK_RESOURCE_FILE_LICENSE "@PROJECT_SOURCE_DIR@/cpack/License.txt") +SET(CPACK_RESOURCE_FILE_README "@PROJECT_SOURCE_DIR@/cpack/Readme.txt") +SET(CPACK_RESOURCE_FILE_WELCOME "@PROJECT_SOURCE_DIR@/cpack/Welcome.txt") +SET(CPACK_SYSTEM_NAME "@CPACK_SYSTEM_NAME@") +SET(CPACK_TOPLEVEL_TAG "@CPACK_TOPLEVEL_TAG@") +SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "0") Added: incubator/celix/trunk/CPackConfigDeploy.in URL: http://svn.apache.org/viewvc/incubator/celix/trunk/CPackConfigDeploy.in?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/CPackConfigDeploy.in (added) +++ incubator/celix/trunk/CPackConfigDeploy.in Thu Dec 9 12:06:28 2010 @@ -0,0 +1,21 @@ +SET(CPACK_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +SET(CPACK_GENERATOR "@CPACK_GENERATOR@") +SET(CPACK_INSTALL_CMAKE_PROJECTS "@PROJECT_BINARY_DIR@;@PROJECT_NAME@;@DEPLOY_COMPONENT@;/") +SET(CPACK_MODULE_PATH "") +SET(CPACK_PACKAGE_DESCRIPTION "Package description") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IBS @DEPLOY_NAME@ Package") +#SET(CPACK_PACKAGE_FILE_NAME "@DEPLOY_NAME@-@IBS_VERSION@") +SET(CPACK_PACKAGE_FILE_NAME "@DEPLOY_NAME@") +SET(CPACK_PACKAGE_INSTALL_DIRECTORY "IBS") +SET(CPACK_PACKAGE_NAME "@CPACK_PACKAGE_NAME@") +SET(CPACK_PACKAGE_VENDOR "HPA") +SET(CPACK_PACKAGE_VERSION "@IBS_VERSION@") +SET(CPACK_PACKAGE_VERSION_MAJOR "@IBS_MAJOR@") +SET(CPACK_PACKAGE_VERSION_MINOR "@IBS_MINOR@") +SET(CPACK_PACKAGE_VERSION_PATCH "@IBS_PATCH@") +SET(CPACK_RESOURCE_FILE_LICENSE "@PROJECT_SOURCE_DIR@/cpack/License.txt") +SET(CPACK_RESOURCE_FILE_README "@PROJECT_SOURCE_DIR@/cpack/Readme.txt") +SET(CPACK_RESOURCE_FILE_WELCOME "@PROJECT_SOURCE_DIR@/cpack/Welcome.txt") +SET(CPACK_SYSTEM_NAME "@CPACK_SYSTEM_NAME@") +SET(CPACK_TOPLEVEL_TAG "@CPACK_TOPLEVEL_TAG@") +SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "0") Added: incubator/celix/trunk/CPackConfigPKG.in URL: http://svn.apache.org/viewvc/incubator/celix/trunk/CPackConfigPKG.in?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/CPackConfigPKG.in (added) +++ incubator/celix/trunk/CPackConfigPKG.in Thu Dec 9 12:06:28 2010 @@ -0,0 +1,20 @@ +SET(CPACK_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +SET(CPACK_GENERATOR "@CPACK_GENERATOR@") +SET(CPACK_INSTALL_CMAKE_PROJECTS "@PROJECT_BINARY_DIR@;@PROJECT_NAME@;@PACKAGE_COMPONENT@;/") +SET(CPACK_MODULE_PATH "") +SET(CPACK_PACKAGE_DESCRIPTION "Package description") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "@PACKAGE_NAME@_pkg") +SET(CPACK_PACKAGE_FILE_NAME "@PACKAGE_NAME@_pkg") +SET(CPACK_PACKAGE_INSTALL_DIRECTORY "IBS") +SET(CPACK_PACKAGE_NAME "@CPACK_PACKAGE_NAME@") +SET(CPACK_PACKAGE_VENDOR "HPA") +SET(CPACK_PACKAGE_VERSION "@IBS_VERSION@") +SET(CPACK_PACKAGE_VERSION_MAJOR "@IBS_MAJOR@") +SET(CPACK_PACKAGE_VERSION_MINOR "@IBS_MINOR@") +SET(CPACK_PACKAGE_VERSION_PATCH "@IBS_PATCH@") +SET(CPACK_RESOURCE_FILE_LICENSE "@PROJECT_SOURCE_DIR@/cpack/License.txt") +SET(CPACK_RESOURCE_FILE_README "@PROJECT_SOURCE_DIR@/cpack/Readme.txt") +SET(CPACK_RESOURCE_FILE_WELCOME "@PROJECT_SOURCE_DIR@/cpack/Welcome.txt") +SET(CPACK_SYSTEM_NAME "@CPACK_SYSTEM_NAME@") +SET(CPACK_TOPLEVEL_TAG "@CPACK_TOPLEVEL_TAG@") +SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "0") Added: incubator/celix/trunk/Packaging.cmake URL: http://svn.apache.org/viewvc/incubator/celix/trunk/Packaging.cmake?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/Packaging.cmake (added) +++ incubator/celix/trunk/Packaging.cmake Thu Dec 9 12:06:28 2010 @@ -0,0 +1,148 @@ +GET_FILENAME_COMPONENT(__cmake_path ${CMAKE_COMMAND} PATH) +FIND_PROGRAM(CPACK_COMMAND cpack ${__cmake_path}) +MESSAGE(STATUS "Found CPack at: ${CPACK_COMMAND}") +IF(NOT CPACK_COMMAND) + MESSAGE(FATAL_ERROR "Need CPack!") +ENDIF(NOT CPACK_COMMAND) + +#IF(UNIX) +# SET(CPACK_GENERATOR "TGZ;STGZ") +#ENDIF(UNIX) +#IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") +# SET(CPACK_GENERATOR "TBZ2;STGZ") +#ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") +#IF(WIN32) +# SET(CPACK_GENERATOR "NSIS;ZIP") +#ENDIF(WIN32) + +SET(CPACK_GENERATOR "ZIP") + +ADD_CUSTOM_TARGET(bundles) +ADD_CUSTOM_TARGET(packages) + +MACRO(bundle) + PARSE_ARGUMENTS(BUNDLE "FILES;DIRECTORIES" "" ${ARGN}) + LIST(GET BUNDLE_DEFAULT_ARGS 0 BUNDLE_NAME) + + install (TARGETS ${BUNDLE_NAME} DESTINATION . COMPONENT ${BUNDLE_NAME}) + install (DIRECTORY MANIFEST DESTINATION . COMPONENT ${BUNDLE_NAME} FILES_MATCHING PATTERN "*" PATTERN ".svn" EXCLUDE) + + if (BUNDLE_FILES) + install (FILES ${BUNDLE_FILES} DESTINATION . COMPONENT ${BUNDLE_NAME}) + endif(BUNDLE_FILES) + if (BUNDLE_DIRECTORIES) + install (DIRECTORY ${BUNDLE_DIRECTORIES} DESTINATION . COMPONENT ${BUNDLE_NAME}) + endif(BUNDLE_DIRECTORIES) + + SET(__bundleTarget bundle_${BUNDLE_NAME}) + SET(__bundleConfig ${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${BUNDLE_NAME}-bundle.cmake) + + CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/CPackConfig.in ${__bundleConfig} @ONLY) + ADD_CUSTOM_TARGET(${__bundleTarget} + mkdir -p ${PROJECT_BINARY_DIR}/bundles \; + cd ${PROJECT_BINARY_DIR}/bundles \; + ${CPACK_COMMAND} --config "${__bundleConfig}" + ) + ADD_DEPENDENCIES(bundles ${__bundleTarget}) + ADD_DEPENDENCIES(${__bundleTarget} ${BUNDLE_NAME}) +ENDMACRO(bundle) + +MACRO(package) + PARSE_ARGUMENTS(PACKAGE "FILES;DIRECTORIES" "" ${ARGN}) + LIST(GET PACKAGE_DEFAULT_ARGS 0 PACKAGE_NAME) + + SET(PACKAGE_COMPONENT package_${PACKAGE_NAME}) + SET(__packageTarget package_${PACKAGE_NAME}) + SET(__bundleTarget bundle_${PACKAGE_NAME}) + SET(__packageConfig ${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${PACKAGE_NAME}-pkg.cmake) + + install (FILES ${PROJECT_BINARY_DIR}/bundles/${PACKAGE_NAME}.zip DESTINATION . COMPONENT ${PACKAGE_COMPONENT}) + + if (PACKAGE_FILES) + install (FILES ${PACKAGE_FILES} DESTINATION . COMPONENT ${PACKAGE_COMPONENT}) + endif(PACKAGE_FILES) + if (PACKAGE_DIRECTORIES) + install (DIRECTORY ${PACKAGE_DIRECTORIES} DESTINATION . COMPONENT ${PACKAGE_COMPONENT}) + endif(PACKAGE_DIRECTORIES) + + CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/CPackConfigPKG.in ${__packageConfig} @ONLY) + ADD_CUSTOM_TARGET(${__packageTarget} + mkdir -p ${PROJECT_BINARY_DIR}/packages \; + cd ${PROJECT_BINARY_DIR}/packages \; + ${CPACK_COMMAND} --config "${__packageConfig}" + ) + ADD_DEPENDENCIES(${__packageTarget} ${__bundleTarget}) + ADD_DEPENDENCIES(packages ${__packageTarget}) + ADD_CUSTOM_TARGET(clean_${__packageTarget} + rm ${PROJECT_BINARY_DIR}/packages/IBS-${PACKAGE_NAME} + ) +ENDMACRO(package) + + +ADD_CUSTOM_TARGET(deploy) +MACRO(deploy) + PARSE_ARGUMENTS(DEPLOY "BUNDLES" "" ${ARGN}) + LIST(GET DEPLOY_DEFAULT_ARGS 0 DEPLOY_NAME) + + SET(DEPLOY_COMPONENT deploy_${DEPLOY_NAME}) + SET(__deployTarget deploy_${DEPLOY_NAME}) + SET(__deployConfig ${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${DEPLOY_NAME}-deploy.cmake) + + CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/CPackConfigDeploy.in ${__deployConfig} @ONLY) + ADD_CUSTOM_TARGET(${__deployTarget} + mkdir -p ${PROJECT_BINARY_DIR}/deploy \; + cd ${PROJECT_BINARY_DIR}/deploy \; + ${CPACK_COMMAND} --config "${__deployConfig}" + ) + #install(FILES ${EXT_DIR}/celix/* DESTINATION . COMPONENT ${DEPLOY_COMPONENT}) + + SET(BUNDLES "") + foreach(BUNDLE ${DEPLOY_BUNDLES}) + add_custom_command(TARGET ${__deployTarget} + COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/bundles/${BUNDLE}.zip + ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip + ) + SET(BUNDLES "${BUNDLES} bundles/${BUNDLE}.zip") + ADD_DEPENDENCIES(${__deployTarget} bundle_${BUNDLE}) + endforeach(BUNDLE) + + CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/config.properties.in ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/config.properties @ONLY) + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME} DESTINATION . COMPONENT ${DEPLOY_COMPONENT}) + ADD_DEPENDENCIES(deploy ${__deployTarget}) + #ADD_CUSTOM_TARGET(clean_${__packageTarget} + # rm ${PROJECT_BINARY_DIR}/packages/IBS-${PACKAGE_NAME} + #) +ENDMACRO(deploy) + +MACRO(PARSE_ARGUMENTS prefix arg_names option_names) + SET(DEFAULT_ARGS) + FOREACH(arg_name ${arg_names}) + SET(${prefix}_${arg_name}) + ENDFOREACH(arg_name) + FOREACH(option ${option_names}) + SET(${prefix}_${option} FALSE) + ENDFOREACH(option) + + SET(current_arg_name DEFAULT_ARGS) + SET(current_arg_list) + FOREACH(arg ${ARGN}) + SET(larg_names ${arg_names}) + LIST(FIND larg_names "${arg}" is_arg_name) + IF (is_arg_name GREATER -1) + SET(${prefix}_${current_arg_name} ${current_arg_list}) + SET(current_arg_name ${arg}) + SET(current_arg_list) + ELSE (is_arg_name GREATER -1) + SET(loption_names ${option_names}) + LIST(FIND loption_names "${arg}" is_option) + IF (is_option GREATER -1) + SET(${prefix}_${arg} TRUE) + ELSE (is_option GREATER -1) + SET(current_arg_list ${current_arg_list} ${arg}) + ENDIF (is_option GREATER -1) + ENDIF (is_arg_name GREATER -1) + ENDFOREACH(arg) + SET(${prefix}_${current_arg_name} ${current_arg_list}) +ENDMACRO(PARSE_ARGUMENTS) + + Added: incubator/celix/trunk/config.properties URL: http://svn.apache.org/viewvc/incubator/celix/trunk/config.properties?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/config.properties (added) +++ incubator/celix/trunk/config.properties Thu Dec 9 12:06:28 2010 @@ -0,0 +1 @@ +cosgi.auto.start.1=build/bundles/receiver.zip build/bundles/sender.zip \ No newline at end of file Added: incubator/celix/trunk/config.properties.in URL: http://svn.apache.org/viewvc/incubator/celix/trunk/config.properties.in?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/config.properties.in (added) +++ incubator/celix/trunk/config.properties.in Thu Dec 9 12:06:28 2010 @@ -0,0 +1 @@ +cosgi.auto.start.1=@BUNDLES@ \ No newline at end of file Added: incubator/celix/trunk/launcher/CMakeLists.txt URL: http://svn.apache.org/viewvc/incubator/celix/trunk/launcher/CMakeLists.txt?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/launcher/CMakeLists.txt (added) +++ incubator/celix/trunk/launcher/CMakeLists.txt Thu Dec 9 12:06:28 2010 @@ -0,0 +1,6 @@ +add_executable(launcher launcher.c) + +include_directories("${PROJECT_SOURCE_DIR}/celix") +target_link_libraries(launcher framework) + +install(TARGETS launcher RUNTIME DESTINATION bin COMPONENT framework) \ No newline at end of file Added: incubator/celix/trunk/launcher/launcher.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/launcher/launcher.c?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/launcher/launcher.c (added) +++ incubator/celix/trunk/launcher/launcher.c Thu Dec 9 12:06:28 2010 @@ -0,0 +1,60 @@ + +#include +#include +#include +#include + +#include "framework.h" +#include "properties.h" +#include "headers.h" +#include "bundle_context.h" +#include "bundle.h" + +static void launcher_load_custom_bundles(void); +void shutdown(int signal); + +int running = 0; + +#include + +FRAMEWORK framework; + +int main(void) { + // Set signal handler + (void) signal(SIGINT, shutdown); + HASHTABLE config = loadProperties("config.properties"); + char * autoStart = getProperty(config, "cosgi.auto.start.1"); + framework = framework_create(); + fw_init(framework); + + // Start the system bundle + framework_start(framework); + + char delims[] = " "; + char * result; + LINKED_LIST bundles = linkedList_create(); + result = strtok(autoStart, delims); + while (result != NULL) { + char * location = strdup(result); + linkedList_addElement(bundles, location); + result = strtok(NULL, delims); + } + int i; + // Update according to Felix Main + // First install all bundles + // Afterwards start them + BUNDLE_CONTEXT context = bundle_getContext(framework->bundle); + for (i = 0; i < linkedList_size(bundles); i++) { + char * location = (char *) linkedList_get(bundles, i); + BUNDLE current = bundleContext_installBundle(context, location); + startBundle(current, 0); + } + + framework_waitForStop(framework); + return 0; +} + +void shutdown(int signal) { + framework_stop(framework); + framework_waitForStop(framework); +} Added: incubator/celix/trunk/sender/CMakeLists.txt URL: http://svn.apache.org/viewvc/incubator/celix/trunk/sender/CMakeLists.txt?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/sender/CMakeLists.txt (added) +++ incubator/celix/trunk/sender/CMakeLists.txt Thu Dec 9 12:06:28 2010 @@ -0,0 +1,7 @@ +add_library(sender SHARED test_activator listenerTest) +include_directories("${PROJECT_SOURCE_DIR}/celix" "${PROJECT_SOURCE_DIR}/dependency_manager") +include_directories("${PROJECT_SOURCE_DIR}/receiver") +target_link_libraries(sender framework dependency_manager) + +bundle(sender) +package(sender) Added: incubator/celix/trunk/sender/MANIFEST/MANIFEST.MF URL: http://svn.apache.org/viewvc/incubator/celix/trunk/sender/MANIFEST/MANIFEST.MF?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/sender/MANIFEST/MANIFEST.MF (added) +++ incubator/celix/trunk/sender/MANIFEST/MANIFEST.MF Thu Dec 9 12:06:28 2010 @@ -0,0 +1,4 @@ +Bundle-SymbolicName: sender +Bundle-Version: 1.0.0 +library: sender +Import-Service: serviceTest;version="[0.0.0,3.0.0]" Added: incubator/celix/trunk/sender/listenerTest.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/sender/listenerTest.c?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/sender/listenerTest.c (added) +++ incubator/celix/trunk/sender/listenerTest.c Thu Dec 9 12:06:28 2010 @@ -0,0 +1,16 @@ +/* + * listenerTest.c + * + * Created on: Apr 20, 2010 + * Author: dk489 + */ +#include "listenerTest.h" +#include +#include +#include + +void serviceChanged(SERVICE_LISTENER listener, SERVICE_EVENT event) { + printf("SERVICE EVENT: %i\n", event->type); +// free(event); + event = NULL; +} Added: incubator/celix/trunk/sender/listenerTest.h URL: http://svn.apache.org/viewvc/incubator/celix/trunk/sender/listenerTest.h?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/sender/listenerTest.h (added) +++ incubator/celix/trunk/sender/listenerTest.h Thu Dec 9 12:06:28 2010 @@ -0,0 +1,16 @@ +/* + * listenerTest.h + * + * Created on: Apr 20, 2010 + * Author: dk489 + */ + +#ifndef LISTENERTEST_H_ +#define LISTENERTEST_H_ + +#include "headers.h" + +void serviceChanged(SERVICE_LISTENER listener, SERVICE_EVENT event); + + +#endif /* LISTENERTEST_H_ */ Added: incubator/celix/trunk/sender/test_activator.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/sender/test_activator.c?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/sender/test_activator.c (added) +++ incubator/celix/trunk/sender/test_activator.c Thu Dec 9 12:06:28 2010 @@ -0,0 +1,126 @@ +/* + * activator.c + * + * Created on: Apr 20, 2010 + * Author: dk489 + */ +#include +#include +#include +#include "bundle_context.h" +#include "listenerTest.h" +#include "service_tracker.h" +#include "serviceTest.h" +#include "dependency_activator_base.h" +#include "dependency_manager.h" +#include "service_dependency.h" +#include "service_component_private.h" + +SERVICE_LISTENER listener; +BUNDLE_CONTEXT m_context; +SERVICE_TRACKER tracker; + +void * addingServ(void * handle, SERVICE_REFERENCE ref); + +void addedServ(void * handle, SERVICE_REFERENCE ref, void * service); + +void modifiedServ(void * handle, SERVICE_REFERENCE ref, void * service); + +void removedServ(void * handle, SERVICE_REFERENCE ref, void * service); + +struct sender { + SERVICE_TEST service; +}; + +typedef struct sender * SENDER; + +void * dm_create() { + SENDER s = (SENDER) malloc(sizeof(*s)); + return s; +} + +void dm_init(void * userData, BUNDLE_CONTEXT context, DEPENDENCY_MANAGER manager) { + SENDER s = (SENDER) userData; + SERVICE service = dependencyActivatorBase_createService(manager); + serviceComponent_setImplementation(service, userData); + SERVICE_DEPENDENCY dep = dependencyActivatorBase_createServiceDependency(manager); + serviceDependency_setRequired(dep, true); + serviceDependency_setService(dep, SERVICE_TEST_NAME, NULL); + serviceDependency_setAutoConfigure(dep, (void**) &s->service); + serviceComponent_addServiceDependency(service, dep); + dependencyManager_add(manager, service); +} + +void dm_destroy(void * userData, BUNDLE_CONTEXT context, DEPENDENCY_MANAGER manager) { + +} + +void service_init(void * userData) { + +} +void service_start(void * userData) { + SENDER s = (SENDER) userData; + s->service->doo(s->service->handle); +} +void service_stop(void * userData) { + +} +void service_destroy(void * userData) { + +} + +//void bundleActivator_start(void * userData, BUNDLE_CONTEXT context) { +// ARRAY_LIST refs; +// +// SERVICE_TEST st; +// SERVICE_TRACKER_CUSTOMIZER cust = (SERVICE_TRACKER_CUSTOMIZER) malloc(sizeof(*cust)); +// m_context = context; +// cust->addedService = addedServ; +// cust->addingService = addingServ; +// cust->modifiedService = modifiedServ; +// cust->removedService = removedServ; +// +// listener = (SERVICE_LISTENER) malloc(sizeof(*listener)); +// listener->serviceChanged = (void *) serviceChanged; +// addServiceListener(context, listener, "(test=test)"); +// tracker = tracker_createServiceTracker(context, (char *) SERVICE_TEST_NAME, cust); +// tracker_open(tracker); +// refs = tracker_getServices(tracker); +// printf("Size: %i\n", arrayList_size(refs)); +// //arrayList_clear(refs); +// //free(refs); +// if (arrayList_size(refs) > 0) { +// st = (SERVICE_TEST) arrayList_get(refs, 0); +// st->doo(st->handle); +// } +// //refs2 = getServiceReferences(context, (char *) SERVICE_TEST_NAME, strdup("(test=t*st)")); +// //printf("Size of getServiceRefs for TEST: %i\n", arrayList_size(refs2)); +// //refs2 = getServiceReferences(context, (char *) SERVICE_TEST_NAME, strdup("(!(test=testa))")); +// //printf("Size of getServiceRefs for TEST: %i\n", arrayList_size(refs2)); +// //refs2 = getServiceReferences(context, (char *) SERVICE_TEST_NAME, NULL); +// //printf("Size of getServiceRefs for TEST: %i\n", arrayList_size(refs2)); +//} + +//void bundleActivator_stop(void * userData, BUNDLE_CONTEXT context) { +// // removeServiceListener(context, listener); +// tracker_close(tracker); +// tracker_destroy(tracker); +// +//} + +void * addingServ(void * handle, SERVICE_REFERENCE ref) { + printf("Adding\n"); + return bundleContext_getService(m_context, ref); +} + +void addedServ(void * handle, SERVICE_REFERENCE ref, void * service) { + printf("Added\n"); +} + +void modifiedServ(void * handle, SERVICE_REFERENCE ref, void * service) { + printf("mod\n"); +} + +void removedServ(void * handle, SERVICE_REFERENCE ref, void * service) { + printf("rem\n"); +} Added: incubator/celix/trunk/target.cmake URL: http://svn.apache.org/viewvc/incubator/celix/trunk/target.cmake?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/target.cmake (added) +++ incubator/celix/trunk/target.cmake Thu Dec 9 12:06:28 2010 @@ -0,0 +1,6 @@ +deploy("name" BUNDLES receiver receiver-2.0 sender shell shell_tui) +deploy("shell test" BUNDLES shell) +deploy("hello_world" BUNDLES hello_world shell shell_tui) +deploy("wb" BUNDLES tracker publisherA publisherB shell shell_tui) +deploy("wb_dp" BUNDLES tracker_depman publisherA publisherB shell shell_tui) +deploy("echo" BUNDLES echo_server echo_client shell shell_tui) \ No newline at end of file Added: incubator/celix/trunk/test/CMakeLists.txt URL: http://svn.apache.org/viewvc/incubator/celix/trunk/test/CMakeLists.txt?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/test/CMakeLists.txt (added) +++ incubator/celix/trunk/test/CMakeLists.txt Thu Dec 9 12:06:28 2010 @@ -0,0 +1,5 @@ +add_executable(main main) +include_directories("${PROJECT_SOURCE_DIR}/celix") +target_link_libraries(main framework) + +add_definitions(-DUSE_FILE32API) \ No newline at end of file Added: incubator/celix/trunk/test/main.c URL: http://svn.apache.org/viewvc/incubator/celix/trunk/test/main.c?rev=1043922&view=auto ============================================================================== --- incubator/celix/trunk/test/main.c (added) +++ incubator/celix/trunk/test/main.c Thu Dec 9 12:06:28 2010 @@ -0,0 +1,68 @@ +/* + * main.c + * + * Created on: Apr 20, 2010 + * Author: alexanderb + */ + +#include +#include +#include +#include +#include +#include +#include "headers.h" +#include "bundle_activator.h" +#include "framework.h" +#include "properties.h" +#include "hashtable.h" +#include "hashtable_itr.h" +#include "filter.h" +#include "bundle_context.h" +#include "bundle.h" +#include "manifest.h" +#include "version.h" +#include "version_range.h" +#include "manifest_parser.h" +#include "linkedlist.h" +#include "linked_list_iterator.h" +#include "resolver.h" +#include "hash_map.h" +#include "module.h" +#include "bundle_cache.h" +#include "constants.h" + +void test(void ** ptr) { + ARRAY_LIST l; + ARRAY_LIST list = arrayList_create(); + *ptr = list; + +} + +int main( int argc, const char* argv[] ) +{ + // init fw etc testing +// FRAMEWORK framework = framework_create(); +// fw_init(framework); +// framework_start(framework); +// +// BUNDLE_CONTEXT context = framework->bundle->context; +// BUNDLE service = bundleContext_installBundle(context, (char *) "build/bundles/receiver.zip"); +// BUNDLE service2 = bundleContext_installBundle(context, (char *) "build/bundles/receiver-2.0.zip"); +// BUNDLE list = bundleContext_installBundle(context, (char *) "build/bundles/sender.zip"); +// startBundle(list, 0); +// startBundle(service, 0); +// startBundle(service2, 0); + + //stopBundle(service, 0); + //stopBundle(service2, 0); + //stopBundle(list, 0); + +// framework_stop(framework); + + ARRAY_LIST l; + test((void**)&l); + printf("Size: %d\n", arrayList_size(l)); + + return 0; +}