celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject svn commit: r1625367 - /celix/site/trunk/content/documentation/getting_started.md
Date Tue, 16 Sep 2014 20:03:55 GMT
Author: pnoltes
Date: Tue Sep 16 20:03:55 2014
New Revision: 1625367

URL: http://svn.apache.org/r1625367
Log:
CELIX-144: small update to the getting started guide

Modified:
    celix/site/trunk/content/documentation/getting_started.md

Modified: celix/site/trunk/content/documentation/getting_started.md
URL: http://svn.apache.org/viewvc/celix/site/trunk/content/documentation/getting_started.md?rev=1625367&r1=1625366&r2=1625367&view=diff
==============================================================================
--- celix/site/trunk/content/documentation/getting_started.md (original)
+++ celix/site/trunk/content/documentation/getting_started.md Tue Sep 16 20:03:55 2014
@@ -134,7 +134,7 @@ This CMakeLists.txt file declares that a
 
 The last part for the hello_world bundle is the bundle activator source. The bundle activator
is the entry point for an Apache Celix Bundle. Think of the bundle activator as the main function
for an bundle, whith the difference that is not only control the start of a bundle, but also
the stoppoing of a bundle. 
 
-Creating/starting and stopping/destroying is seperated in bunlde activator. This is done
to make a clear seperation between the instantion/creation of a structure (e.g. object) and
exposure of that instantation to other parts of the program. The same, but then reserve hold
for seperating stopping and destroying a bundle. For more detailed information why this is
important, please read the [Java theory and practice: Safe construction techniques](https://www.ibm.com/developerworks/library/j-jtp0618/)
article (altough this is oriented around Java, the principles applies any form of instantation
and exposure).
+Creating/starting and stopping/destroying is seperated in bundle activator. This is done
to make a clear seperation between the instantion/creation of a structure (e.g. object) and
exposure of that instantation to other parts of the program. The same, but then reserve hold
for seperating stopping and destroying a bundle. 
 
 
 	//${WS}/myproject/bundles/hello_world/private/src/activator.c
@@ -178,23 +178,49 @@ Creating/starting and stopping/destroyin
 	}
 	
 ###Building 
-TODO explain out of source building 
+One of the highly recommended features of CMake is the ability to do out of source builds,
the benefit is that all of the build results will go in a seperate directory without cluttering
the (source) project. To create the build directory and build the project execute the following
commands:
+
+	cd ${WS}
+	mkdir myproject-build
+	cd myproject-build
+	cmake ../myproject
+	make all  
+	
+Hopefully you will some some build results scrolling over the screen and actual build results
in the build directory. There should be a hello_world.zip in the bundles/hello_world directory,
this the actual bundle. But a bundle on its own has no real value, so lets setup a deployment
and run the Apache Celix framwork with this bundle.
 
 
 ###Running 
 
-TODO add deploy (with shell, shell_tui) and explain using full path + extension difference
with only a names
+To create a deployment for the hello_world bundle two things are needed: 
+	
+1. Add a deploy.cmake in the bundles/hello_world dir declaring what to deploy and under which
name.
+2. Append the deploy_targets() marco call to the end of the root CMakeLists.txt file (${WS}/myproject/CMakeLists.txt).
This marcro will look for deploy.cmake files, parse them and when make is runned create the
actual deployment structure. 
 
-	#${WS}/myproject/bundles/hello_world/deploy.cmake
+
+	${WS}/myproject/bundles/hello_world/deploy.cmake
 	deploy("myproject" BUNDLES 
 		${CELIX_BUNDLES_DIR}/shell.zip 
 		${CELIX_BUNDLES_DIR}/shell_tui.zip
 		hello_world
 	)
 	
-TODO explain add deploy_targets() to root CMakeLists.txt 
+After the deploy.cmake is created and the root CMakeLists.txt is updated, rerun make again
form the  build project. the make files genereated by CMake will ensure cmake is runned again
to update the actual make files.
+
+	cd ${WS}/myproject-build
+	make
+	
+Now a deploy directory myproject should be availabe in the deploy directory. This directory
contains - among other files - the run.sh script. This can be used to run the Apache Celix
framework with the declared bundles from the deploy.cmake.
+
+	cd ${WS}/myproject-build/deploy/myproject
+	sh run.sh
 
-TODO explain run.sh
+The hello_world bundle should be started and the famous "Hello World" text should be printed.
The shell and shell_tui bundle are also deployed and these can be used to query and control
the running. Below the commands to show which bundles are installed, how to print all known
shell commands and how to get help information for specific help command and how to stop the
a bundles (bundle 0 is the framework bundle) is shown:
+
+	ps 
+	help
+	help inspect
+	stop 0
+	
 
 ##Apache Celix Bundle Project in Eclipse
 TODO explain:
@@ -208,6 +234,8 @@ TODO explain:
 
 
 ##The Next Steps
+
+TODO
 explain:
 
  - service registration/lookup



Mime
View raw message