buildframework/helium/doc/src/tutorials/configuration/HowtoCreateANewSignal.rst
changeset 179 d8ac696cc51f
parent 1 be27ed110b50
equal deleted inserted replaced
1:be27ed110b50 179:d8ac696cc51f
    46    
    46    
    47    </project>   
    47    </project>   
    48 
    48 
    49 
    49 
    50 
    50 
    51 To declare a new signal to the framework you need to define a new signalConfig reference.
    51 To declare a new signal to the framework you need to define a new signalListenerConfig reference.
    52 You also need to create a signalInput configuration to define your signal behaviour.
    52 You also need to create a signalInput configuration to define your signal behaviour.
    53 
    53 
    54 .. code-block:: xml
    54 .. code-block:: xml
    55  
    55  
    56    <hlm:signalInput id="customActionSignalInput" failbuild="defer"/>
    56    <hlm:signalInput id="customActionSignalInput" failbuild="defer"/>
    57    
    57    
    58    <hlm:signalListenerConfig id="customActionSignal" name="custom-action" message="custom-action target ended.">
    58    <hlm:signalListenerConfig id="customActionSignal" target="custom-action" message="custom-action target ended.">
    59       <signalNotifierInput>
    59       <signalNotifierInput>
    60           <signalInput refid="customActionSignalInput" />
    60           <signalInput refid="customActionSignalInput" />
    61           <notifierInput file="${artifact}" />
    61           <notifierInput file="${artifact}" />
    62       </signalNotifierInput>
    62       </signalNotifierInput>
    63       <hlm:targetCondition>
    63       <hlm:targetCondition>
    64          <not><available file="${artifact}"/></not>            
    64          <not><available file="${artifact}"/></not>            
    65       </hlm:targetCondition>
    65       </hlm:targetCondition>
    66    </hlm:signalConfig>
    66    </hlm:signalListenerConfig>
    67 
    67 
    68 
    68 
    69 The signalListenerConfig defines which target to listen and raise signal for. The target name is defined through the **name** attribute.
    69 The signalListenerConfig defines which target to listen and raise signal for. The target name is defined through the **target** attribute.
    70 Then the nested **targetCondition** element is used to configure how the signal should be triggered.
    70 Then the nested **targetCondition** element is used to configure how the signal should be triggered.
    71 This element accepts any nested `Ant conditions <http://ant.apache.org/manual/CoreTasks/conditions.html>`_.
    71 This element accepts any nested `Ant conditions <http://ant.apache.org/manual/CoreTasks/conditions.html>`_.
    72 In this case the signal will get raised only id the file is not present after the execution of the **custom-action** target.
    72 In this case the signal will get raised only if the file is not present after the execution of the **custom-action** target.
    73 
    73 
    74 The framework then uses the defined signalInput from the signalNotifierInput configuration to know how to behave when the signal is raised. In the previous example it will
    74 The framework then uses the defined signalInput from the signalNotifierInput configuration to know how to behave when the signal is raised. In the previous example it will
    75 simply keep running and fail the build at the end. Then files defined by the nested notifierInput will be passed to the notifier.
    75 simply keep running and fail the build at the end. Then files defined by the nested notifierInput will be passed to the notifier.
    76 
    76 
    77 The execution of the **custom-action custom-dummy** build sequence will happen entirely even if the artifact is not 
    77 The execution of the **custom-action custom-dummy** build sequence will happen entirely even if the artifact is not