buildframework/helium/doc/src/development/developer_guide.rst
author wbernard
Fri, 13 Aug 2010 14:59:05 +0300
changeset 628 7c4a911dc066
parent 588 c7c26511138f
child 645 b8d81fa19e7d
permissions -rw-r--r--
helium_11.0.0-e00f171ca185
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
..  ============================================================================ 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     2
    Name        : developer_guide.rst
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     3
    Part of     : Helium 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     4
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     5
    Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     6
    All rights reserved.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     7
    This component and the accompanying materials are made available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     8
    under the terms of the License "Eclipse Public License v1.0"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     9
    which accompanies this distribution, and is available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    10
    at the URL "http://www.eclipse.org/legal/epl-v10.html".
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    11
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    12
    Initial Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    13
    Nokia Corporation - initial contribution.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    14
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    15
    Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    16
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    17
    Description:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
    ============================================================================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    20
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    21
.. index::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    22
  module: Developer Guide
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    23
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    24
###################################
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
Developer Guide
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    26
###################################
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    27
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
.. contents::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
Introduction
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
============
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    32
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    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`_.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    35
.. _`Coding Conventions`: coding_conventions.html
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    36
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    37
.. index::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
  single: Directory Structure
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    39
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    40
Directory structure
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    41
===================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    42
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    43
The ``/helium`` directory structure consists of:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
``/build``
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    46
    This is not under source control. It is created on demand to store generated documentation, testing and coverage output and so on.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    48
``/config``
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    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.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    50
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    51
``/doc``
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    52
    All documentation related to Helium. Files are in .rst format (HTML versions can be generated under ``/build/doc`` using the ``hlm doc`` command).
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    54
``/external``
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    55
    Applications and libraries that are maintained outside of the Helium team.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    56
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    57
``/tests``
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    58
    Test data for unit tests. All unit tests are co-located with the code under test.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    59
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
``/tools``
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    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.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    62
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
``/tools/common``
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
    Common libraries for Java, Perl and Python and XML schemas.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    65
    
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    66
Anatomy of a library project
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    67
----------------------------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    68
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    69
::
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    70
   
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    71
   + builder
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    72
      - build.xml
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    73
      - bld.bat
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    74
      - bld
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    75
      + antlibs
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    76
         Ant specific dependencies needed to execute ant properly
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    77
         e.g: Java checkstyle, Code coverage tools
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    78
         The jar in that folder will not be used as compilation dependencies
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    79
   + <layer>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    80
       + doc
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    81
          General documentation of the project
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    82
       + settings
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    83
          + ivysettings.xml
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    84
       + deps
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    85
          + <org>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    86
             + <name>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    87
                + <rev>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    88
                   - <name>-<rev>.jar
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    89
          + ...
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    90
       + java
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    91
          + component1
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    92
          + componentn ...
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    93
       + python
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    94
          + component1
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    95
          + componentn ...
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    96
   + <layer> ...
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    97
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    98
Ant script structure
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    99
--------------------
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   100
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   101
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.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   102
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   103
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   104
.. index::
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   105
  single: Custom Ant libraries
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   106
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   107
Custom Ant libraries
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   108
====================
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   109
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   110
All custom Ant tasks, types and loggers should be added as new components under the ``/sf`` folder. If the component being created is Java-based, then add it inside the ``/java`` folder. The component directory must contain a ``build.xml`` file that imports ``${builder.dir}/java/macros.ant.xml``. Also the name of the project must be the name of the future JAR file e.g::
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   111
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   112
   <?xml version="1.0"?>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   113
   <project name="mycomponent">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   114
       <import file="${builder.dir}/java/macros.ant.xml" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   115
   </project> 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   116
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   117
The component also need an Ivy file (``ivy.xml``) in order to be detected and built. The file must define the correct list of dependencies for the component so it get built in the correct order.
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   118
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   119
Structure
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   120
---------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   121
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   122
A component is a self contained structure which implements a set of feature related to a specific domain (e.g: Diamonds, SCM). The following diagram shows 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   123
the physical structure of a component.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   124
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   125
::
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   126
   
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   127
   + <component_name>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   128
         - build.xml
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   129
         - ivy.xml
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   130
         + src
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   131
            + com
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   132
               + nokia
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   133
                   + helium
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   134
                      + <component_name>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   135
                          + ant
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   136
                             + taskdefs
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   137
                               source of the Ant tasks
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   138
                             + types
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   139
                               source of the Ant DataType 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   140
                             + listeners
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   141
                               source of the Ant Listener
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   142
                             + conditions
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   143
                               source of the Ant Conditions
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   144
         + tests
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   145
           - build.xml
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   146
           - bld.bat
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   147
           - bld.sh
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   148
           + antunits
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   149
              - test_xxx.ant.xml* - Unittest implemented using AntUnit  
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   150
           + data
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   151
             data used for the the unittests.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   152
           + src
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   153
             + com
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   154
                + nokia
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   155
                   + helium
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   156
                      + <component_name>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   157
                         + tests
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   158
                            source of junit unittests.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   159
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   160
build.xml file
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   161
--------------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   162
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   163
This is the simplest file you must have at component level, ``<name of the component>`` is really important
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   164
as it defines the future name of the JAR file.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   165
::
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   166
   
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   167
   <project name="<name of the component>">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   168
       <description>Component build file.</description>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   169
       <import file="../../builder/java/macros.ant.xml"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   170
   </project>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   171
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   172
ivy.xml file
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   173
------------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   174
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   175
The ``ivy.xml`` file is used to gather the relevant dependencies to build your component and to order
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   176
the build of the components correctly::
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   177
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   178
   <?xml version="1.0" encoding="ISO-8859-1"?>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   179
   <ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   180
          xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   181
       <info
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   182
          organisation="com.nokia.helium"
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   183
           module="<name of the component>"
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   184
           status="integration">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   185
       </info>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   186
       <dependencies>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   187
          <dependency name="<name of an another component>" rev="latest.integration" conf="default" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   188
          <dependency org="dom4j" name="dom4j" rev="1.2.9" conf="default" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   189
       </dependencies>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   190
   </ivy-module>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   191
   
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   192
More info about Ivy can be found from: http://ant.apache.org/ivy/
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   193
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   194
AntUnit files
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   195
-------------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   196
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   197
The builder will automatically test all the AntUnit files from ``<component>/tests/antunit``.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   198
Test must be written by keeping in mind that source tree must remain unmodified after the testing (please use the ``test.temp.dir``).
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   199
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   200
Test file example::
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   201
   
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   202
   <project name="test-<component>-<feature>" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   203
      <description>Helium unittests.</description>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   204
   
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   205
      <target name="setUp">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   206
         <delete dir="${test.temp.dir}" failonerror="false" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   207
         <mkdir dir="${test.temp.dir}" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   208
      </target>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   209
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   210
      <target name="tearDown">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   211
         <delete dir="${test.temp.dir}" failonerror="false" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   212
         <mkdir dir="${test.temp.dir}" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   213
      </target>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   214
      
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   215
      <target name="test-file-generation">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   216
         <echo message="foo-bar" file="${test.temp.dir}/demo.txt" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   217
         <au:assertFileExists file="${test.temp.dir}/demo.txt" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   218
      </target>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   219
   </project>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   220
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   221
Source code license
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   222
-------------------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   223
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   224
Each file should include the following license header::
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   225
   
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   226
   /*
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   227
    * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   228
    * All rights reserved.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   229
    * This component and the accompanying materials are made available
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   230
    * under the terms of the License "Eclipse Public License v1.0"
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   231
    * which accompanies this distribution, and is available
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   232
    * at the URL "http://www.eclipse.org/legal/epl-v10.html".
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   233
    *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   234
    * Initial Contributors:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   235
    * Nokia Corporation - initial contribution.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   236
    *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   237
    * Contributors:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   238
    *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   239
    * Description:  
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   240
    *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   241
    */
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   242
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   243
Documentation
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   244
-------------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   245
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   246
All classes and methods must be documented.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   247
Ant facade classes like task or type must be doclet documented. This implies the javadoc
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   248
to be user and not developer oriented, for instance examples of the task/type usage are really appreciated.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   249
Also all setter methods visible through Ant must be documented properly using *@ant.required* 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   250
or *@ant.not-required* javadoc style attributes.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   251
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   252
You can find more information on how to document Ant tasks using the doclet plugin on http://doclet.neuroning.com/. 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   253
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   254
General coding guidelines
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   255
-------------------------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   256
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   257
 * Java components must not use ``getProperty()`` with a hardcoded name coming from helium (e.g.: ``getProject().getProperty("helium.dir"))`` The only exceptions to this are:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   258
    * Ant listeners (the name of the property must be linked to the listener not to Helium!)
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   259
    * Code under the legacy component.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   260
 * It is forbidden to share unittest data between components (else it breaks the "self-contained" principle).
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   261
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   262
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   263
Ant type and task guidelines
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   264
----------------------------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   265
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   266
In order to match as must as  configurability concepts, Helium custom types and tasks must follow  development guidelines as 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   267
much as possible. You can find then on http://.apache.org/_task_guidelines.html.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   268
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   269
Logging
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   270
-------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   271
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   272
Developer must preferably use standard Ant logging for any user log output.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   273
Internal debug logging must be implemented using the log4j framework.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   274
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   275
 * ANT Listeners must use log4j logging framework - using Ant logging system might cause some looping issues.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   276
 * Ant ``Type`` and ``Task`` classes must use the Ant logging mechanism to report to the user.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   277
 * Generic framework code (that which doesn't link to Ant directly) must use log4j. 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   278
 * Usage of ``System.out.println()`` should be avoided.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   279
 * All the unhandled exceptions should be considered as errors and should be reported as such:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   280
    * use ``log("message", Project.MSG_ERR)`` under Ant.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   281
    * ``log.error()`` otherwise.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   282
    * Exceptions to this rule must be clearly commented under the code.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   283
 * Debug information:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   284
    * log4j framework (``log.debug()``) must be used to push information to the Helium debug log - so debug information is not
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   285
      directly visible by the user.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   286
    * The Ant logging framework can also be used to log Type/Task debug info (but log4j is preferred).
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   287
    * The ``printStackTrace()`` method should be used on below scenarios:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   288
       * At the time of an unknown exception.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   289
       * Should be used with exceptions other than ``BuildException``.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   290
       * In case it is difficult to debug the issue with ``Exception.getMessage()``.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   291
       * Use when debugging complex issues (this doesn't mean the line should remain in the code after development).
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   292
       * When it is required to print the all the information about the occurring ``Exception``. 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   293
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   294
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   295
This is an example on how to use logging::
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   296
   
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   297
   import org.apache.log4j.Logger;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   298
   
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   299
   class MyClass extends Task {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   300
       private static Logger log = Logger.getLogger(MyClass.class);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   301
       
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   302
       public void execute() {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   303
           log("Executing...");
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   304
           log.debug("some useful debug information.");
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   305
       }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   306
   }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   307
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   308
Please find more information on log4j from the online manual: http://logging.apache.org/log4j/1.2/manual.html.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   309
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   310
Debug log
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   311
``````````
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   312
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   313
The log4j debug output is written to ``hlm_debug.log`` that is stored under ``HELIUM_CACHE_DIR``. This may be set one of these two values::
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   314
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   315
    %TEMP%\helium\%USERNAME%\%JOB_ID%
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   316
    %TEMP%\helium\%USERNAME%
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   317
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   318
Ensure ``TEMP`` is set to a location that is visible to all so the file can be accessed from all accounts.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   319
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   320
Exceptions
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   321
----------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   322
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   323
Exceptional event reporting and handling is crutial in software development. Developer must make sure it is done accordingly
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   324
to the framework it is currently using:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   325
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   326
 * To report a build failure under Ant a ``BuildException`` must be used.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   327
    But we have to keep in mind that a ``BuildException`` is not tracked because it derives from ``RuntimeException``.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   328
    So we have to be careful with those and try to limit their puprose to the original usage: Ant build failure.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   329
 * It is preferable to use a meaningful exception type like ``FileNotFoundException``.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   330
 * Throwing or catching raw exceptions like ``Exception``, ``RuntimeException`` should be avoided.  
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   331
 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   332
Deprecation
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   333
-----------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   334
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   335
Deprecation is an inevitable in involving software. The usage of deprecation implies most of the time the replacement of a feature 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   336
by an newer. To make sure it has the minimum impact on the user, we need to provide both features for at least one major release, so 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   337
the customer has time to do the relevant modification to migrate. In order to ease as much as possible the deployment and the migration
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   338
to a newer version of any Ant object please follow this guidelines:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   339
 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   340
 * Ant attributes replacement
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   341
    * Use the @Deprecated annotation on the Java code to make sure this method is not in use anymore under our code.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   342
    * Log a warning message to the user using Ant logging. Please use the following template:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   343
        * The usage of the '<deprecated_attribute_name>' attribute is deprecated, please consider using the '<new_attribute_name>' attribute.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   344
    * Try to keep the functionality by adapting the code inside the deprecated setter to use the newer API.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   345
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   346
Example of Ant attribute deprecation for a Java task::
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   347
   
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   348
   @Deprecated
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   349
   public void setDb(File database) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   350
       log("The usage of the 'db' attribute is deprecated, please consider using the 'database' attribute.", Project.MSG_WARN);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   351
       this.database = database;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   352
   }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   353
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   354
 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   355
.. index::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   356
  single: How to build the delivery?
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   357
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   358
How to build the delivery?
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   359
==========================   
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   360
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   361
From Helium 9.0 onward, the delivery will be released as source code, without any pre-built binaries. In order to build the release please follow the next instructions.
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   362
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   363
Building the dependencies
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   364
-------------------------
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   365
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   366
In order to build the Helium components you need to use the builder available under the helium directory::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   367
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   368
   > cd builder
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   369
   > bld build
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   370
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   371
This will build all the components needed to create the Helium release: egg or jar files.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   372
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   373
Retrieving Helium dependencies
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   374
------------------------------
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   375
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   376
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. 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::
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   377
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   378
   > cd builder
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   379
   > bld -Dconfig=sf get-deps
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   380
  
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   381
The previous command will retrieve Helium sf configuration dependencies.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   382
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   383
Packaging up the built version
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   384
------------------------------
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   385
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   386
A deliverable ZIP package of binary version of Helium can be created using the following commands::
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   387
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   388
    > cd builder
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   389
    > bld -Dconfig=sf create-releasable
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   390
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   391
The archive can be found at ``build/helium-bin.zip``.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   392
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   393
.. index::
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   394
  single: Testing
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   395
  
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   396
Testing
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   397
=======
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   398
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   399
Components
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   400
-----------
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   401
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   402
Component tests can be run using::
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   403
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   404
    > cd builder
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   405
    > bld unittest
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   406
   
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   407
A specific type of tests can be selected using::
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   408
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   409
    > bld -Dcomponent.type=java unittest
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   410
   
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   411
A specific component can be selected using::
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   412
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   413
    > bld -Dcomponent=sbs unittest
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   414
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   415
Debug logs for component tests can be found at ``/build/components/<component>/xunit``.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   416
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   417
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   418
.. index::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   419
  single: Assertions
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   420
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   421
Assertions
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   422
==========
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   423
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   424
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.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   425
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   426
The assertions can be enabled by defining the ``hlm.enable.asserts``. If ``hlm.enable.asserts`` is not enabled, macro will print warnings only.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   427
There are several macros:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   428
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   429
``hlm:assert``
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   430
    A basic assertion that will check any task contained within it.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   431
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   432
``hlm:assertFileExists``
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   433
    Takes a file attribute and asserts that the file exists.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   434
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   435
.. index::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   436
  single: Ivy Configuration
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   437
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   438
Ivy Configuration
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   439
=================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   440
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   441
Ibiblio
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   442
-------
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   443
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   444
Libraries in Maven2 Ibiblio_ repository can use: ``helium/config/ivy/ivy.xml``
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   445
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   446
.. _Ibiblio: http://mirrors.ibiblio.org/pub/mirrors/maven2/
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   447
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   448
These parameters should be used, if library has passed legal tests: ``transitive="false"``, ``conf="subcon"``
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   449
Otherwise use: ``transitive="false"``, ``conf="core_install"``
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   450
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   451
Direct URLs
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   452
------------
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   453
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   454
Use these for a direct url link, if the library is needed for the subcon release::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   455
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   456
    helium/config/ivy/modules/jars_subcon-1.0.ivy.xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   457
    helium/config/ivy/modules/eggs_subcon-1.0.ivy.xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   458
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   459
Otherwise add to these files for non subcon libraries::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   460
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   461
    helium/config/ivy/modules/eggs-1.0.ivy.xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   462
    helium/config/ivy/modules/jars-1.0.ivy.xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   463
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   464
A new Ivy config file can be added for a non-jar or egg type file.
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   465
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   466
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   467
Feature enable Configuration
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   468
============================
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   469
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   470
If we are adding new features (which are similar to diamonds, coverage toosl), then those feature needs to enabled in the build sequence using 'feature.enabled' property.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   471
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   472
Using feature.enabled property we need to set intermediate property and that intermidiate property should have the name pattern as internal.feature.enabled.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   473
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   474
Intermidiate properties should be set using ant <condition> task. Do not use antcontrib <if> task (avoid as much as possible).
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   475
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   476
We need to trigger the targets using intermidiate property. 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   477
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   478
Target based feature testing
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   479
----------------------------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   480
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   481
And depending target should be called using intermediate property.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   482
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   483
Ex::
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   484
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   485
    feature.enabled = true
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   486
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   487
    <condition property="internal.feature.enabled">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   488
        <istrue value="${feature.enabled}"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   489
    </condition>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   490
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   491
    <target name="xyz" if="internal.feature.enabled"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   492
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   493
If any property is deprecated then that should be documented in the respective .ant.xml.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   494
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   495
Ex::
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   496
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   497
    <!-- Set to true to enable feature - deprecated: Start using feature.enabled property
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   498
    @type boolean
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   499
    @editable required
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   500
    @scope public
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   501
    @deprecated since 11.0 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   502
    -->
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   503
    <property name="old.feature" value="true"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   504
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   505
    feature.enabled = true
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   506
    old.feature = false
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   507
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   508
    <condition property="internal.feature.enabled">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   509
        <or>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   510
            <istrue value="${feature.enabled}"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   511
            <isset property="old.feature"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   512
        </or>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   513
    </condition>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   514
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   515
    <target name="xyz" if="internal.feature.enabled"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   516
        
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   517
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   518
Task base feature testing
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   519
-------------------------
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   520
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   521
If the if task is used inside a target it is then preferable to use the feature.enabled property directly:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   522
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   523
::
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   524
   
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   525
   <target name="target-name">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   526
       ...
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   527
       <if>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   528
          <or>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   529
              <istrue value="${feature.enabled}"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   530
              <isset property="old.feature"/>          
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   531
          </or>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   532
          <then>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   533
              ...
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   534
          </then>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   535
          ...
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   536
       </if>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   537
       ...
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   538
   </target>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   539
   
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   540
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   541
Of course the 'old.feature' will be kept for one major release and removed in the next one.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   542