587
|
1 |
.. ============================================================================
|
|
2 |
Name : developer_guide.rst
|
|
3 |
Part of : Helium
|
|
4 |
|
|
5 |
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
6 |
All rights reserved.
|
|
7 |
This component and the accompanying materials are made available
|
|
8 |
under the terms of the License "Eclipse Public License v1.0"
|
|
9 |
which accompanies this distribution, and is available
|
|
10 |
at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
11 |
|
|
12 |
Initial Contributors:
|
|
13 |
Nokia Corporation - initial contribution.
|
|
14 |
|
|
15 |
Contributors:
|
|
16 |
|
|
17 |
Description:
|
|
18 |
|
|
19 |
============================================================================
|
|
20 |
|
|
21 |
.. index::
|
|
22 |
module: Developer Guide
|
|
23 |
|
|
24 |
###################################
|
|
25 |
Developer Guide
|
|
26 |
###################################
|
|
27 |
|
|
28 |
.. contents::
|
|
29 |
|
|
30 |
Introduction
|
|
31 |
============
|
|
32 |
|
|
33 |
This describes various practices, procedures and conventions used within Helium. It should be read by all contributors to Helium along with the `Coding Conventions`_.
|
|
34 |
|
|
35 |
.. _`Coding Conventions`: coding_conventions.html
|
|
36 |
|
|
37 |
.. index::
|
|
38 |
single: Directory Structure
|
|
39 |
|
|
40 |
Directory structure
|
|
41 |
===================
|
|
42 |
|
|
43 |
The ``/helium`` directory structure consists of:
|
|
44 |
|
|
45 |
``/build``
|
|
46 |
This is not under source control. It is created on demand to store generated documentation, testing and coverage output and so on.
|
|
47 |
|
|
48 |
``/config``
|
|
49 |
Configuration files for parts of Helium. Some of these may only need to be defined in Helium, whereas others may be default configuration that may be overridden by a user.
|
|
50 |
|
|
51 |
``/doc``
|
|
52 |
All documentation related to Helium. Files are in .rst format (HTML versions can be generated under ``/build/doc`` using the ``hlm doc`` command).
|
|
53 |
|
|
54 |
``/external``
|
|
55 |
Applications and libraries that are maintained outside of the Helium team.
|
|
56 |
|
|
57 |
``/tests``
|
|
58 |
Test data for unit tests. All unit tests are co-located with the code under test.
|
|
59 |
|
|
60 |
``/tools``
|
|
61 |
A number of subdirectories for each stage of the build. Each directory may contain Ant scripts and other tools and scripts related to that stage.
|
|
62 |
|
|
63 |
``/tools/common``
|
|
64 |
Common libraries for Java, Perl and Python and XML schemas.
|
|
65 |
|
|
66 |
|
|
67 |
Ant script structure
|
|
68 |
--------------------
|
|
69 |
|
|
70 |
The ``helium.ant.xml`` file in the project root should be imported by each build configuration. This in turn imports the root files for each of the key build stages defined in the ``/tools`` directory. ``helium.ant.xml`` also defines a number of common Ant default properties.
|
|
71 |
|
|
72 |
|
|
73 |
.. index::
|
|
74 |
single: Custom Ant library
|
|
75 |
|
|
76 |
Custom Ant library
|
|
77 |
==================
|
|
78 |
|
|
79 |
All custom Ant tasks and loggers should be added as new component under the sf folder. If the component you are creating is Java based, then add
|
|
80 |
it inside the java folder. Your component directory must contain a build.xml file that imports the ${builder.dir}/java/macros.ant.xml file. Also the name
|
|
81 |
of the project must be the name of the future jar file e.g::
|
|
82 |
|
|
83 |
<?xml version="1.0"?>
|
|
84 |
<project name="mycomponent">
|
|
85 |
<import file="${builder.dir}/java/macros.ant.xml" />
|
|
86 |
</project>
|
|
87 |
|
|
88 |
The component also need an Ivy file (ivy.xml) in order to be detected and built. The file must defined the correct list of
|
|
89 |
dependencies for the component so it get built in the correct order.
|
|
90 |
|
|
91 |
.. index::
|
|
92 |
single: How to build the delivery?
|
|
93 |
|
|
94 |
How to build the delivery?
|
|
95 |
==========================
|
|
96 |
|
|
97 |
From Helium 9.0 onward, the delivery will be released as source code, without any pre-built binaries. In order to build
|
|
98 |
the release please follow the next instructions.
|
|
99 |
|
|
100 |
Building the dependencies
|
|
101 |
-------------------------
|
|
102 |
|
|
103 |
In order to build the Helium components you need to use the builder available under the helium directory::
|
|
104 |
|
|
105 |
> cd builder
|
|
106 |
> bld build
|
|
107 |
|
|
108 |
This will build all the components needed to create the Helium release: egg or jar files.
|
|
109 |
|
|
110 |
Retrieving Helium dependencies
|
|
111 |
------------------------------
|
|
112 |
|
|
113 |
Building the dependency will not bring Helium in a workable stage. It is a preparation stage where components could be unit tested in isolation for example.
|
|
114 |
Retrieving Helium dependencies based on the version of Helium you desire is then needed. The builder can achieve this operation by running the following command::
|
|
115 |
|
|
116 |
> cd builder
|
|
117 |
> bld -Dconfig=sf get-deps
|
|
118 |
|
|
119 |
The previous command will retrieve Helium sf configuration dependencies.
|
|
120 |
|
|
121 |
Packaging up the built version
|
|
122 |
------------------------------
|
|
123 |
|
|
124 |
Deliverable zip pacakge of binary version of Helium can be created using the following command::
|
|
125 |
|
|
126 |
> cd builder
|
|
127 |
> bld -Dconfig=sf create-releasable
|
|
128 |
|
|
129 |
The archive can be found under: build/helium-bin.zip
|
|
130 |
|
|
131 |
.. index::
|
|
132 |
single: Assertions
|
|
133 |
|
|
134 |
Assertions
|
|
135 |
==========
|
|
136 |
|
|
137 |
There are some basic assertion macros defined in ``common.ant.xml``. These can be used to check for correctness at the end of a target, e.g. checking that a file exists which the target was supposed to create.
|
|
138 |
|
|
139 |
The assertions can be enabled by defining the ``hlm.enable.asserts``. If ``hlm.enable.asserts`` is not enabled, macro will print warnings only.
|
|
140 |
There are several macros:
|
|
141 |
|
|
142 |
``hlm:assert``
|
|
143 |
A basic assertion that will check any task contained within it.
|
|
144 |
|
|
145 |
``hlm:assertFileExists``
|
|
146 |
Takes a file attribute and asserts that the file exists.
|
|
147 |
|
|
148 |
.. index::
|
|
149 |
single: Ivy Configuration
|
|
150 |
|
|
151 |
Ivy Configuration
|
|
152 |
=================
|
|
153 |
|
|
154 |
Ibiblio
|
|
155 |
-------
|
|
156 |
|
|
157 |
Libraries in Maven2 Ibiblio_ repository can use: ``helium/config/ivy/ivy.xml``
|
|
158 |
|
|
159 |
.. _Ibiblio: http://mirrors.ibiblio.org/pub/mirrors/maven2/
|
|
160 |
|
|
161 |
These parameters should be used, if library has passed legal tests: ``transitive="false"``, ``conf="subcon"``
|
|
162 |
Otherwise use: ``transitive="false"``, ``conf="core_install"``
|
|
163 |
|
|
164 |
Direct URLs
|
|
165 |
------------
|
|
166 |
|
|
167 |
Use these for a direct url link, if the library is needed for the subcon release::
|
|
168 |
|
|
169 |
helium/config/ivy/modules/jars_subcon-1.0.ivy.xml
|
|
170 |
helium/config/ivy/modules/eggs_subcon-1.0.ivy.xml
|
|
171 |
|
|
172 |
Otherwise add to these files for non subcon libraries::
|
|
173 |
|
|
174 |
helium/config/ivy/modules/eggs-1.0.ivy.xml
|
|
175 |
helium/config/ivy/modules/jars-1.0.ivy.xml
|
|
176 |
|
|
177 |
A new Ivy config file can be added for a non-jar or egg type file.
|