You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by bp...@apache.org on 2016/01/18 19:37:43 UTC

[1/2] celix git commit: CELIX-236: Add build command

Repository: celix
Updated Branches:
  refs/heads/feature/CELIX-236_celix-boostrap a4939dee8 -> e5297485d


CELIX-236: Add build command


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

Branch: refs/heads/feature/CELIX-236_celix-boostrap
Commit: 2981447083fe090c4b15791a7861551a91484181
Parents: a4939de
Author: Bjoern Petri <bp...@apache.org>
Authored: Mon Jan 18 19:31:47 2016 +0100
Committer: Bjoern Petri <bp...@apache.org>
Committed: Mon Jan 18 19:31:47 2016 +0100

----------------------------------------------------------------------
 .../celix/bootstrap/argument_parser.py           | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/29814470/celix-bootstrap/celix/bootstrap/argument_parser.py
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/argument_parser.py b/celix-bootstrap/celix/bootstrap/argument_parser.py
index ad477f9..0fe2649 100644
--- a/celix-bootstrap/celix/bootstrap/argument_parser.py
+++ b/celix-bootstrap/celix/bootstrap/argument_parser.py
@@ -2,6 +2,7 @@
 import os
 import argparse
 from . import generators
+import subprocess
 
 def main() :
 	parser = argparse.ArgumentParser("celix-bootstrap")
@@ -10,9 +11,10 @@ def main() :
 	CREATE_BUNDLE_COMMAND = "create_bundle"
 
 	UPDATE_COMMAND = "update"
+	BUILD_COMMAND = "build"
 
 	#positional
-	parser.add_argument("command", help="The command to execute", choices=(CREATE_PROJECT_COMMAND, CREATE_BUNDLE_COMMAND, UPDATE_COMMAND))
+	parser.add_argument("command", help="The command to execute", choices=(CREATE_PROJECT_COMMAND, CREATE_BUNDLE_COMMAND, UPDATE_COMMAND, BUILD_COMMAND))
 	parser.add_argument("directory", help="The directory to work on")
 
 	#optional
@@ -29,6 +31,8 @@ def main() :
 		gm.createProject()
 	elif args.command == UPDATE_COMMAND :
 		gm.update()
+	elif args.command == BUILD_COMMAND :
+		gm.build()
 	else :
 		sys.exit()
 
@@ -58,3 +62,16 @@ class GeneratorMediator :
 		if os.path.isfile(os.path.join(self.gendir, "project.yaml")) :
 			print("Generating/updating project code")
 			self.projectGenerator.update()
+
+	def build(self) :
+		if not os.path.exists(self.gendir):
+			print("Creating Directory " + self.gendir)
+			os.makedirs(self.gendir)
+
+		cmake = subprocess.Popen(["cmake", os.getcwd()], cwd=self.gendir, stderr=subprocess.STDOUT)
+		if cmake.wait() != 0:
+			print("Cmake run failed. Do you perform to need an update run first?")
+		else:
+			make = subprocess.Popen(["make", "all", "deploy"], cwd=self.gendir, stderr=subprocess.STDOUT)
+			if make.wait() != 0:
+				print("Compilation failed. Please check your code")


[2/2] celix git commit: CELIX-236: Update README

Posted by bp...@apache.org.
CELIX-236: Update README


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

Branch: refs/heads/feature/CELIX-236_celix-boostrap
Commit: e5297485d2a2f825a60eb5581ea6e751091d4e52
Parents: 2981447
Author: Bjoern Petri <bp...@apache.org>
Authored: Mon Jan 18 19:37:23 2016 +0100
Committer: Bjoern Petri <bp...@apache.org>
Committed: Mon Jan 18 19:37:23 2016 +0100

----------------------------------------------------------------------
 celix-bootstrap/README.md | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/e5297485/celix-bootstrap/README.md
----------------------------------------------------------------------
diff --git a/celix-bootstrap/README.md b/celix-bootstrap/README.md
index ef63c8a..cbd1f58 100644
--- a/celix-bootstrap/README.md
+++ b/celix-bootstrap/README.md
@@ -38,19 +38,24 @@ Is good to known that you should not edit anything between the following comment
 You can setup a new Apache Celix project by executing following steps:
 * Choose a project directory and cd to it
 * Run `celix-bootstrap create_project .`
-* Edit the project.json file and ensure that the celix_install_dir points to the directory where Apache Celix is installed
+* Edit the project.yaml file and ensure that the celix_install_dir points to the directory where Apache Celix is installed
 * Run `celix-bootstrap update .` to generate the needed files
-* (Optional) Update the project.json file and run `celix-bootstrap update .` again to update the generated files
+* (Optional) Update the project.yaml file and run `celix-bootstrap update .` again to update the generated files
 * (Optional) Run `celix-bootstrap update . -e` to update the project source files one more time and remove the code generation parts
 
 You can create a new bundle by executing the following steps:
 * cd to the project directory
 * Run `celix-bootstrap create_bundle mybundle`
-* Edit the `mybundle/bundle.json` file to declare which components you like to create and what services those components depends on and/or provide
+* Edit the `mybundle/bundle.yaml` file to declare which components you like to create and what services those components depends on and/or provide
 * Run `celix-bootstrap update mybundle` to generate the neccesary files
-* Add the bundle to the project CMakeLists.txt file by adding the `add_subdirectory(mybundle)` line
+* Run `celix-bootstrap update .` to include the new bundle into the CMakeLists.txt 
 * Add code to the component and when providing service also add the necesarry code to the bundle activator
 * (Optional) Run `celix-bootstrap update . -e` to update the bundle source files one more time and remove the code generation parts
 
+You can build your whole project with the following step:
+* cd to the project directory
+* Run `celix-bootstrap build buildDirectory` to build and the deploy the code within the buildDirectory
+* In case the build was successful, you'll find several deployed configuration at buildDirectory/deploy
+
 Additional Info
 * You can use the -t argument to use a different set of template (project & bundle) files. The original template files can be found at ${celix-bootstrap_dir}/templates