celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [16/50] celix git commit: CELIX-335: Fix bundle command in PackagegingLegacy. Update celix-bootstrap for updated CMake commands
Date Mon, 11 Apr 2016 10:54:43 GMT
CELIX-335: Fix bundle command in PackagegingLegacy. Update celix-bootstrap for updated CMake
commands


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

Branch: refs/heads/release/celix-2.0.0
Commit: 1eb9eb01f1db3b78d3f0d6840fddfc660ce1cf6f
Parents: 9934f75
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Fri Feb 5 10:13:21 2016 +0100
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Fri Feb 5 10:13:21 2016 +0100

----------------------------------------------------------------------
 .gitignore                                      |  1 +
 celix-bootstrap/celix/bootstrap/generators.py   | 10 -----
 .../bootstrap/templates/bundle/CMakeLists.txt   | 46 ++++++++++----------
 .../bootstrap/templates/bundle/deploy.cmake     | 14 ------
 cmake/cmake_celix/PackagingLegacy.cmake         | 18 ++++++--
 config_admin/CMakeLists.txt                     | 11 ++++-
 config_admin/example/CMakeLists.txt             |  4 +-
 7 files changed, 51 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 6c1ab95..50221c0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,4 @@ build
 *.swp
 .idea
 nbproject
+*.pyc

http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/celix-bootstrap/celix/bootstrap/generators.py
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/generators.py b/celix-bootstrap/celix/bootstrap/generators.py
index e9d469b..4c6769e 100644
--- a/celix-bootstrap/celix/bootstrap/generators.py
+++ b/celix-bootstrap/celix/bootstrap/generators.py
@@ -97,10 +97,6 @@ class Bundle(BaseGenerator):
 		options = ["-D", "bundleFile=%s" % self.descriptor]
 		self.update_file("CMakeLists.txt", "CMakeLists.txt", options, "#")	
 		
-	def update_deploy_file(self) :
-		options = ["-D", "bundleFile=%s" % self.descriptor]
-		self.update_file("deploy.cmake", "deploy.cmake", options, "#")	
-
 	def update_activator(self) :
 		options = ["-D", "bundleFile=%s" % self.descriptor]
 		self.update_file("bundle_activator.c", "private/src/bundle_activator.c", options)
@@ -129,7 +125,6 @@ class Bundle(BaseGenerator):
 			print("%s does not exist or does not contain a bundle.yaml file" % self.gendir)
 		else :
 			self.update_cmakelists()	
-			self.update_deploy_file()
 			self.update_activator()
 			if 'components' in bd and bd['components'] is not None:
 				for comp in bd['components'] :
@@ -149,10 +144,6 @@ class Project(BaseGenerator):
                 options = ["-D", "projectFile=%s" % self.descriptor]
                 self.update_file("CMakeLists.txt", "CMakeLists.txt", options, "#")      
 
-        def update_deploy_file(self) :
-                options = ["-D", "projectFile=%s" % self.descriptor]
-                self.update_file("deploy.cmake", "deploy.cmake", options, "#")  
-
         def create(self) :
                 self.update_file(os.path.join(self.template_dir, self.profile, "%s.yaml"
% self.profile),  "%s.yaml" % self.profile, [], None)  
 
@@ -162,4 +153,3 @@ class Project(BaseGenerator):
                         print("%s does not exist or does not contain a project.yaml file"
% self.gendir)
                 else :
                         self.update_cmakelists()        
-                        self.update_deploy_file()

http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt b/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
index 5e1cdd8..d96c422 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
@@ -14,27 +14,6 @@
 #}}
 #{{end}}
 
-
-SET(
-	BUNDLE_NAME 
-#{{ 
-#cog.outl("\t\"%s\"" % bundle['name']) 
-#}}
-"mybundle" #do not edit, generated code
-#{{end}}
-)
-
-SET(
-	BUNDLE_SYMBOLICNAME 
-#{{ 
-#cog.outl("\t\"%s\"" % bundle['symbolicName']) 
-#}}
-"org.example.mybundle" #do not edit, generated code
-#{{end}}
-)
-
-SET(BUNDLE_VERSION "0.0.1")
-
 include_directories(
         ${CELIX_INCLUDE_DIR}/dependency_manager
         "private/include"
@@ -49,8 +28,11 @@ include_directories(
 
 )
 
-bundle(
+add_bundle(
 #{{ 
+#cog.outl("\tNAME \"%s\"" % bundle['name'])
+#cog.outl("\tSYMBOLIC_NAME \"%s\"" % bundle['symbolicName']) 
+#cog.outl("\tVERSION \"0.0.1\"")
 #cog.outl("\t%s SOURCES" % bundle['name']) 
 #cog.outl("\t\tprivate/src/bundle_activator")
 #for comp in bundle['components'] :
@@ -74,3 +56,23 @@ target_link_libraries(${BUNDLE_LIB} ${CELIX_FRAMEWORK_LIBRARY} -Wl,-all_load
dep
 else()
 target_link_libraries(${BUNDLE_LIB} -Wl,--whole-archive dependency_manager -Wl,--no-whole-archive
${CELIX_FRAMEWORK_LIBRARY} ${CELIX_UTILS_LIBRARY})
 ENDIF()
+
+#{{
+#cog.outl("add_deploy(%s_deploy" % bundle['name'])
+#cog.outl("\tCOPY")
+#cog.outl("\tNAME \"%s\"" % bundle['name'])
+#cog.outl("\tBUNDLES")
+#cog.outl("\t\t${CELIX_BUNDLES_DIR}/shell.zip")
+#cog.outl("\t\t${CELIX_BUNDLES_DIR}/dm_shell.zip")
+#cog.outl("\t\t${CELIX_BUNDLES_DIR}/shell_tui.zip")
+#cog.outl("\t\t${CELIX_BUNDLES_DIR}/log_service.zip")
+#cog.outl("\t\t%s" % bundle['name'])
+#cog.outl(")")
+#}}
+add_deploy(mybundle_deploy
+    COPY
+    NAME "mybundle"
+    BUNDLES 
+        mybundle
+)
+#{{end}}

http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake b/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
deleted file mode 100644
index 2f80596..0000000
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-#{{
-#import yaml
-#bundle = None 
-#with open(bundleFile) as input :
-#       bundle = yaml.load(input)
-#cog.outl("deploy( \"%s\" BUNDLES" % bundle['name'])
-#cog.outl("\t${CELIX_BUNDLES_DIR}/shell.zip")
-#cog.outl("\t${CELIX_BUNDLES_DIR}/dm_shell.zip")
-#cog.outl("\t${CELIX_BUNDLES_DIR}/shell_tui.zip")
-#cog.outl("\t${CELIX_BUNDLES_DIR}/log_service.zip")
-#cog.outl("\t%s" % bundle['name'])
-#cog.outl(")")
-#}}
-#{{end}}

http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/cmake/cmake_celix/PackagingLegacy.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/PackagingLegacy.cmake b/cmake/cmake_celix/PackagingLegacy.cmake
index 58667cd..0802552 100644
--- a/cmake/cmake_celix/PackagingLegacy.cmake
+++ b/cmake/cmake_celix/PackagingLegacy.cmake
@@ -27,7 +27,7 @@ macro(SET_HEADERS HEADERS)
     endif()
 endmacro()
 
-function(bundles)
+function(bundle)
     list(GET ARGN 0 BUNDLE)
     list(REMOVE_AT ARGN 0)
 
@@ -45,27 +45,36 @@ function(bundles)
 
     if(BUNDLE_FILES)
         bundle_files(${BUNDLE} ${BUNDLE_FILES} DESTINATION .)
+    endif()
+
     if(BUNDLE_EXPORT_VERSION) 
         message(WARNING "EXPORT_VERSION argument not supported")
     endif()
+
     if(BUNDLE_LINK_LIBRARIES) 
         target_link_libraries(${BUNDLE} ${BUNDLE_LINK_LIBRARIES})
     endif()
+
     if(BUNDLE_PRIVATE_LIBRARIES) 
         bundle_private_libs(${BUNDLE} ${BUNDLE_PRIVATE_LIBS})
     endif()
+
     if(BUNDLE_EXPORT_LIBRARIES)
         bundle_export_libs(${BUNDLE} ${BUNDLE_PRIVATE_LIBS})
     endif()
+
     if(BUNDLE_IMPORT_LIBRARIES)
         message(FATAL_ERROR "TODO IMPORT LIBRARIES")
     endif()
+
     if(BUNDLE_DIRECTORIES)
         message(WARNING "DIRECTORIES argument not supported")
     endif()
+
     if(BUNDLE_INSTALL_FILES)
         message(WARNING "INSTALL_FILES argument not supported")
     endif()
+
     if(BUNDLE_INSTALL)
         bundle_install(${BUNDLE})
     endif()
@@ -73,17 +82,20 @@ function(bundles)
     if(BUNDLE_NAME)
         bundle_name(${BUNDLE} ${BUNDLE_NAME})
     endif()
+
     if(BUNDLE_SYMBOLICNAME)
         bundle_symbolic_name(${BUNDLE} ${BUNDLE_SYMBOLICNAME})
     endif()
+
     if(BUNDLE_VERSION)
         bundle_version(${BUNDLE} ${BUNDLE_VERSION})
     endif()
+
     if (BUNDLE_HEADERS)
         bundle_headers(${BUNDLE} ${BUNDLE_HEADERS})
     endif()
 
-    message(STATUS "bundle function is deprecated. update to add_bundle")
+    message(STATUS "bundle function is deprecated. update target '${BUNDLE}' to add_bundle")
 endfunction()
 
 
@@ -104,5 +116,5 @@ function(deploy)
     if(DEPLOY_ENDPOINTS)
         deploy_bundles_dir(${DEPLOY} DIR_NAME "endpoints" BUNDLES ${DEPLOY_ENDPOINTS})
     endif()
-    message(STATUS "deploy function is deprecated. update to add_deploy")
+    message(STATUS "deploy function is deprecated. update target '${DEPLOY}' to add_deploy")
 endfunction()

http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/config_admin/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/CMakeLists.txt b/config_admin/CMakeLists.txt
index de06600..8087662 100644
--- a/config_admin/CMakeLists.txt
+++ b/config_admin/CMakeLists.txt
@@ -45,7 +45,14 @@ if (CONFIG_ADMIN)
    endif(ENABLE_TESTING)
 	
 
-	add_deploy("config_admin1" BUNDLES config_admin shell shell_tui log_service log_writer example_test)
-	add_deploy("config_admin2" BUNDLES config_admin shell shell_tui log_service log_writer bundle_managed_service
bundle_configuring)
+   add_deploy(config_admin_deploy 
+       NAME "config_admin"
+       BUNDLES 
+        config_admin 
+        shell shell_tui 
+        log_service 
+        log_writer 
+        config_admin_example
+   )
 
 endif (CONFIG_ADMIN)

http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/config_admin/example/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/example/CMakeLists.txt b/config_admin/example/CMakeLists.txt
index b19c73b..2d92d0a 100644
--- a/config_admin/example/CMakeLists.txt
+++ b/config_admin/example/CMakeLists.txt
@@ -2,12 +2,12 @@
 
 SET(
 	BUNDLE_NAME 
-"config_admin_example"
+    "config_admin_example"
 )
 
 SET(
 	BUNDLE_SYMBOLICNAME 
-"org.apache.celix.config_admin.example"
+    "org.apache.celix.config_admin.example"
 )
 
 SET(BUNDLE_VERSION "0.0.1")


Mime
View raw message