incubator-celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abroekh...@apache.org
Subject svn commit: r1203196 - in /incubator/celix/trunk: cmake/CPackConfig.in cmake/Packaging.cmake deployment_admin/CMakeLists.txt
Date Thu, 17 Nov 2011 14:13:32 GMT
Author: abroekhuis
Date: Thu Nov 17 14:13:32 2011
New Revision: 1203196

URL: http://svn.apache.org/viewvc?rev=1203196&view=rev
Log:
Updates after merg

Modified:
    incubator/celix/trunk/cmake/CPackConfig.in
    incubator/celix/trunk/cmake/Packaging.cmake
    incubator/celix/trunk/deployment_admin/CMakeLists.txt

Modified: incubator/celix/trunk/cmake/CPackConfig.in
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/cmake/CPackConfig.in?rev=1203196&r1=1203195&r2=1203196&view=diff
==============================================================================
--- incubator/celix/trunk/cmake/CPackConfig.in (original)
+++ incubator/celix/trunk/cmake/CPackConfig.in Thu Nov 17 14:13:32 2011
@@ -17,23 +17,13 @@
 
 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_INSTALL_CMAKE_PROJECTS "@BUNDLE_BIN_DIR@;@BUNDLE_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")
-set(CPACK_INSTALLED_DIRECTORIES "@BUNDLE_SOURCE_DIR@/META-INF;/META-INF")
+#set(CPACK_INSTALLED_DIRECTORIES "@BUNDLE_SOURCE_DIR@/META-INF;/META-INF")

Modified: incubator/celix/trunk/cmake/Packaging.cmake
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/cmake/Packaging.cmake?rev=1203196&r1=1203195&r2=1203196&view=diff
==============================================================================
--- incubator/celix/trunk/cmake/Packaging.cmake (original)
+++ incubator/celix/trunk/cmake/Packaging.cmake Thu Nov 17 14:13:32 2011
@@ -22,49 +22,39 @@ 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)
+file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/bundles ${PROJECT_BINARY_DIR}/packages)
 
 MACRO(bundle)
-    PARSE_ARGUMENTS(BUNDLE "FILES;DIRECTORIES" "" ${ARGN})
+    PARSE_ARGUMENTS(BUNDLE "SOURCES;FILES;DIRECTORIES" "" ${ARGN})
     LIST(GET BUNDLE_DEFAULT_ARGS 0 BUNDLE_NAME)
     
-    #install (DIRECTORY META-INF DESTINATION . COMPONENT ${BUNDLE_NAME} FILES_MATCHING PATTERN
"*" PATTERN ".svn" EXCLUDE)
-	
-	install (TARGETS ${BUNDLE_NAME} DESTINATION . COMPONENT ${BUNDLE_NAME})
+	add_library(${BUNDLE_NAME} SHARED ${BUNDLE_SOURCES})
     
+    install (DIRECTORY META-INF DESTINATION . COMPONENT ${BUNDLE_NAME} FILES_MATCHING PATTERN
"*" PATTERN ".svn" EXCLUDE)
+	install (TARGETS ${BUNDLE_NAME} DESTINATION . COMPONENT ${BUNDLE_NAME})
     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)
-	SET(BUNDLE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-
+	SET(BUNDLE_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR})
 	CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/CPackConfig.in ${__bundleConfig} @ONLY)
-	ADD_CUSTOM_TARGET(${__bundleTarget}
-		mkdir -p ${PROJECT_BINARY_DIR}/bundles \;
-		cd ${PROJECT_BINARY_DIR}/bundles \; 
-		${CPACK_COMMAND} --config "${__bundleConfig}"
+	ADD_CUSTOM_COMMAND(TARGET ${BUNDLE_NAME}
+		POST_BUILD
+		COMMAND ${CPACK_COMMAND} ARGS --config ${__bundleConfig}
+		COMMAND mkdir -p ${PROJECT_BINARY_DIR}/ziptojar \;
+			cd ${PROJECT_BINARY_DIR}/ziptojar \;
+			jar -xf ${PROJECT_BINARY_DIR}/bundles/${BUNDLE_NAME}.zip \;
+			jar -cfm ${PROJECT_BINARY_DIR}/bundles/${BUNDLE_NAME}.zip META-INF/MANIFEST.MF . \;
+			rm -rf ${PROJECT_BINARY_DIR}/ziptojar/*
+		WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/bundles
 	)
-	ADD_DEPENDENCIES(bundles ${__bundleTarget})
-	ADD_DEPENDENCIES(${__bundleTarget} ${BUNDLE_NAME})
+	SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_BINARY_DIR}/bundles/${BUNDLE_NAME}.zip)
 ENDMACRO(bundle)
 	
 MACRO(package)
@@ -72,9 +62,6 @@ MACRO(package)
     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})
 	
@@ -85,17 +72,18 @@ MACRO(package)
 	    install (DIRECTORY ${PACKAGE_DIRECTORIES} DESTINATION . COMPONENT ${PACKAGE_COMPONENT})
     endif(PACKAGE_DIRECTORIES)
 
+	SET(__packageConfig ${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${PACKAGE_NAME}-pkg.cmake)
 	CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/CPackConfigPKG.in ${__packageConfig} @ONLY)
-	ADD_CUSTOM_TARGET(${__packageTarget}
-		mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/packages \;
-		cd ${CMAKE_CURRENT_BINARY_DIR}/packages \; 
-		${CPACK_COMMAND} --config "${__packageConfig}"
+	ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_NAME}
+		POST_BUILD
+		COMMAND mkdir -p ${PROJECT_BINARY_DIR}/packages \;
+			cd ${PROJECT_BINARY_DIR}/packages \; 
+			${CPACK_COMMAND} --config "${__packageConfig}"
+		WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/packages
 	)
-	ADD_DEPENDENCIES(${__packageTarget} ${__bundleTarget})
-	ADD_DEPENDENCIES(packages ${__packageTarget})
-	ADD_CUSTOM_TARGET(clean_${__packageTarget}
-	    rm ${PROJECT_BINARY_DIR}/packages/IBS-${PACKAGE_NAME}
-    )
+	
+	GET_DIRECTORY_PROPERTY(PROPS ADDITIONAL_MAKE_CLEAN_FILES)
+	SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROPS};${PROJECT_BINARY_DIR}/packages/${PACKAGE_NAME}_pkg.zip")
 ENDMACRO(package)
 
 
@@ -106,25 +94,32 @@ MACRO(deploy)
 	
 	SET(DEPLOY_COMPONENT deploy_${DEPLOY_NAME})
 	SET(__deployTarget deploy_${DEPLOY_NAME})
-	SET(__deployConfig ${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${DEPLOY_NAME}-deploy.cmake)
+	#SET(__deployConfig ${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${DEPLOY_NAME}-deploy.cmake)
 		
-	CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/CPackConfigDeploy.in ${__deployConfig} @ONLY)
-	ADD_CUSTOM_TARGET(${__deployTarget}
-		mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/deploy \;
-		cd ${CMAKE_CURRENT_BINARY_DIR}/deploy \; 
-		${CPACK_COMMAND} --config "${__deployConfig}"
-	)
+	#SET(DEPLOY_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME})
+	#CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/CPackConfigDeploy.in ${__deployConfig} @ONLY)
 	#install(FILES ${EXT_DIR}/celix/* DESTINATION . COMPONENT ${DEPLOY_COMPONENT})
 	
 	SET(BUNDLES "")
-	foreach(BUNDLE ${DEPLOY_BUNDLES})
-		add_custom_command(TARGET ${__deployTarget}
+	SET(DEPS)
+	FOREACH(BUNDLE ${DEPLOY_BUNDLES})
+		SET(DEP_NAME ${DEPLOY_NAME}_${BUNDLE}) 
+		add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip
       		COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/bundles/${BUNDLE}.zip 
       			${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip
+  			DEPENDS ${BUNDLE}
+  			COMMENT "Deploying ${BUNDLE} to ${DEPLOY_NAME}"
       	)
 	    SET(BUNDLES "${BUNDLES} bundles/${BUNDLE}.zip")
-	    ADD_DEPENDENCIES(${__deployTarget} bundle_${BUNDLE})
-	endforeach(BUNDLE)
+	    SET(DEPS ${DEPS};${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip)
+	ENDFOREACH(BUNDLE)
+    ADD_CUSTOM_TARGET(${__deployTarget} 
+    	#mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/deploy \;
+		#	cd ${CMAKE_CURRENT_BINARY_DIR}/deploy \; 
+		#	${CPACK_COMMAND} --config "${__deployConfig}"
+    	DEPENDS ${DEPS} launcher
+    	COMMENT "Deploy target ${DEPLOY_NAME}")
+    ADD_DEPENDENCIES(deploy ${__deployTarget})
 	
 	CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/config.properties.in ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/config.properties
@ONLY)
 	
@@ -142,8 +137,10 @@ MACRO(deploy)
 	
 	CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/run.sh.in ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/run.sh
@ONLY)
 	
-	install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME} DESTINATION . COMPONENT
${DEPLOY_COMPONENT})
-	ADD_DEPENDENCIES(deploy ${__deployTarget})
+	GET_DIRECTORY_PROPERTY(PROPS ADDITIONAL_MAKE_CLEAN_FILES)
+	SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROPS};${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}")
+	
+	#install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME} DESTINATION . COMPONENT
${DEPLOY_COMPONENT})
 	#ADD_CUSTOM_TARGET(clean_${__packageTarget}
 	#    rm ${PROJECT_BINARY_DIR}/packages/IBS-${PACKAGE_NAME}
     #)

Modified: incubator/celix/trunk/deployment_admin/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/deployment_admin/CMakeLists.txt?rev=1203196&r1=1203195&r2=1203196&view=diff
==============================================================================
--- incubator/celix/trunk/deployment_admin/CMakeLists.txt (original)
+++ incubator/celix/trunk/deployment_admin/CMakeLists.txt Thu Nov 17 14:13:32 2011
@@ -22,7 +22,7 @@ include_directories("${PROJECT_SOURCE_DI
 include_directories("${PROJECT_SOURCE_DIR}/deployment_admin/private/include")
 
 link_directories("/opt/local/lib")
-add_library(deployment_admin SHARED
+bundle(deployment_admin SOURCES
 	private/src/deployment_package 
 	private/src/deployment_admin
 	private/src/deployment_admin_activator
@@ -32,6 +32,4 @@ add_library(deployment_admin SHARED
 )
 target_link_libraries(deployment_admin framework curl)
 
-bundle(deployment_admin)
-
 deploy("deployment-admin" BUNDLES deployment_admin shell shell_tui log_service log_writer)



Mime
View raw message