Difference between revisions of "SMILA/Development Guidelines"
|Line 142:||Line 142:|
* [[SMILA/Development Guidelines/Tuscany Integration|Tuscany Integration]]
* [[SMILA/Development Guidelines/Tuscany Integration|Tuscany Integration]]
Revision as of 09:39, 23 September 2008
- 1 Development requirements
- 1.1 Checkstyle
- 1.2 Eclipse code formatter profile.
- 1.3 Official JVM
- 1.4 OSGi
- 1.5 Version number
- 1.6 Project Setup
- 1.7 Creation of Bundles
- 1.8 Introduction to make.xml
- 1.9 Continuous Integration
- 1.10 File Header & Copyright Notice
- 1.11 Launch configurations for OSGi wih SCA
- 1.12 How to run/manage connectivity framework
- 1.13 XML Schemas, Namespace Convention and Versioning
- 1.14 Launch Files Naming Convention (.launch)
- 1.15 Generated Source Code goes into code/gen source folder (like Jaxb)
- 1.16 Sources of third party bundles
- 1.17 OSGi related information
- 1.18 Tuscany related information
- 2 How To
Each Eclipse project (Bundles) should follow the Brox Coding Conventions.
File containing checkstyle rules is avaliable in trunk at EILF.builder/checkstyle/brox_checks.xml
Eclipse checkstyle plugin.
The eclipse-cs Checkstyle plugin integrates the source code analyzer Checkstyle into Eclipse IDE. With the Checkstyle Eclipse plugin your code is constantly inspected for problems. Within the Eclipse workbench you are notified of problems via the Eclipse Problems View and source code annotations just as you would see with compiler errors or warnings. The Checkstyle Eclipse plugin can be obtained from the update site: http://eclipse-cs.sourceforge.net/update/ Instructions about how to set up the Checkstyle plugin for your project can be obtained from http://eclipse-cs.sourceforge.net/basic_setup_project.html To use plugin for all projects, select Window > Preferences menu in Eclipse, select Checkstyle preference page and. Click on the New button, select External Configuration File as Type and point to the location of the file brox_checks.xml
Checkstyle Configuration Profile should be named (while importing): "Brox Coding Conventions 1.06"
The complete manual and other information about the plugin may be obtained from http://eclipse-cs.sourceforge.net/
Eclipse code formatter profile.
Eclipse code formatter file is available in trunk at EILF.builder/eclipse-formatter/Eclipse-formatter-Brox-3.2-3.3.xml
To import Eclipse code formatter profile, download profile configuration file, select Window > Preferences in Eclipse and select Java > Code Style > Formatter preference page. Click on Import button and select formatter file.
Official JVM for this project is Java5.
the OSGi impl. of Equinox of eclipse 3.3 or later and the corresponding OSGi Spec(s)
until further notice all own created bundles are V0.5
The project folder setup is defined for this project at Brox Java Project Setup
Creation of Bundles
Description at Create a bundle (plug-in)
How to integrate new bundle into build process see: How to integrate new bundle into build process
How to integrate test bundle into build process see: How to integrate test bundle into build process
Introduction to make.xml
Everyone should be aware of the following workflow with bamboo.
Bamboo should improve the source code quality but it should not be used as a (junit)-test-server. Therefore each developer should check his code before committing it to subversion regarding:
- Compilation Errors
- Checkstyle (see Brox Coding Conventions)
- Tests: Run a local build with the build.xml to test all existing junit-tests.
- (see Development Guidelines for the setup)
- Be aware that running tests in eclipse doesn't mean that they run with the pdebbuild.
- Build-Process: Check if your Bundles and your Test-Bundle is fully integrated in the whole Build-Process
We have added a feature to the build.xml: The failed junit-tests are reported at the end of the build output.
Furthermore the full junit-reports are generate under eclipse.build/reports/junit/ and the error messages from the junit-reports are stored under eclipse.build/reports_errors_txt/.
Everyone should monitor the trunk at the build-server and if there is a "red"-build everyone should look if he has committed the error.
If the error could not be solved within the next build the developer should inform the developer-team that there is a problem with the build and that he is working on the solution.
File Header & Copyright Notice
Launch configurations for OSGi wih SCA
This information is outdated. It will be updated when Tuscany integration is stable Daniel Stucky: I had some trouble selecting the right Bundles that were required to execute my sample application (org.eclipse.eilf.framework.test). Don't use the "Add required Bundles" button in the launch configuration dialog. It adds additional bundles that are not needed and starts all bundles with the same start level. I selected the required bundles manually (through try and error) and assigned the following start levels:
- all org.eclipse bundles (except for the eilf bundles)
- all org.apache.tuscany bundles
- all other third party bundles
- (default) all org.eclipse.eilf bundles
- the bundle with the test application (org.eclipse.eilf.framework.test)
I don't know if all these start levels are required, at least I got it working with these settings. Setting all to default does NOT work !!!
How to run/manage connectivity framework
From this moment there is an ability to start EILF/SMILA as separate application:
- Update from SVN and refresh
- execute build and unzip eclipse.build/Application/ EILF-win32.win32.x86.zip to any folder
- Create folder "c:\data" and place some txt/htm files (for filesystem crawler)
- launch application by eclipse.exe -console or launch.cmd
- Run jconsole, and connect to local
- Open EILF/org.eclipse.econnectivity... branch in the jconsole
- Open MBeans/Operations tab
- Start FileSystem crawler by "startCrawl()" operation with passing "file" parameter
- Start Web crawler by "startCrawl()" operation with passing "web" parameter.
- Look at the Eclipse console log and enjoy ;)
XML Schemas, Namespace Convention and Versioning
This subject is still very open to discussion right now, but i suggest to do the following:
- when defining a schema a name space must be defined also
- the URL of the namespace shall be like so: http://org.eclipse.eilf/<rest of bundle as path>/<version>##- <rest of bundle as path> means that the '.' are converted to '/'. In case the bundle defines more than one schema then use the either packages or other properly identifying names (plz discuss this) to further qualify the name space.
- As we continue to develop the application, schemas will change over time. there are basically two options here: either encode the version in the *:name space or have an extra well defined attribute that needs to be added to the XML messages to tell which schema version it conforms to. Doing *:this with an attribute seem to be much more error prone (likely to be forgotten) and less xml-natural. (subject needs further discussion).
- Further it is not clear how and when we will version a particular schema as those under development might be still very volatile. So the current *:idea is to version a schema on a milestone and releases.
- Another idea is to integrate versioning in the daily build process where the version number may be constructed from
- date / time stamp
- build number
- revision number
Launch Files Naming Convention (.launch)
It is a good thing to share your launches and many do so already which helps greatly to run tests quickly from within Eclipse. However, in order that at least I don't get confused, we need to define a naming scheme for the .launches!
Preliminary Convention: <bundle name>[_config name].launch
The [config name] part is optional and needed when several .launches exist for the same bundle with diff. settings.
Generated Source Code goes into code/gen source folder (like Jaxb)
All generated source code (eg. JAXB) goes into the distinct source code folder code/gen. Where possible all generated classes should also have their own package. Reasons:
- separate generated source code from handwritten
- easier filtering for checkstyle
(see previous Description in How to implement a Crawler)
Sources of third party bundles
If you have to implement third party bundles into the smila project, please insert the sources into the "3rdPartySources"-folder, not into the new bundle folder. Each third party bundle should have an own folder, that is extended with versionnumber, e.g. 3rdPartySources\org.apache.tomcat-6.0.16\apache-tomcat-6.0.16-src.zip