buildframework/helium/tools/common/common.ant.xml
changeset 645 b8d81fa19e7d
parent 628 7c4a911dc066
equal deleted inserted replaced
643:27cf35f95864 645:b8d81fa19e7d
   151                 <if>
   151                 <if>
   152                     <not>
   152                     <not>
   153                         <isset property="email.from"/>
   153                         <isset property="email.from"/>
   154                     </not>
   154                     </not>
   155                     <then>
   155                     <then>
   156                         <hlm:ldap url="${email.ldap.server}" rootdn="${email.ldap.rootdn}" filter="uid=${env.USERNAME}" outputproperty="email.from" key="mail"/>
   156                         <hlm:ldap url="${email.ldap.server}" rootdn="${email.ldap.rootdn}" filter="uid=${env.USERNAME}" outputproperty="email.from" key="mail" failonerror="false"/>
   157                     </then>
   157                     </then>
   158                 </if>
   158                 </if>
   159             </then>   
   159             </then>   
   160         </if>        
   160         </if>        
   161     </target>
   161     </target>
   326     <!-- Displays the current version of Helium -->
   326     <!-- Displays the current version of Helium -->
   327     <target name="version" description="Displays the current version of Helium">
   327     <target name="version" description="Displays the current version of Helium">
   328         <echo message="Helium version: ${helium.version}" />
   328         <echo message="Helium version: ${helium.version}" />
   329     </target>
   329     </target>
   330         
   330         
   331         
   331     <!-- Checks the Ant configuration against a Helium data model.
   332     <!-- Checks the Ant configuration against a Helium data model. -->
   332     @deprecated Implementation of the feature has changed, and the target is not needed anymore. Instead use antlint target
       
   333     -->
   333     <target name="check">
   334     <target name="check">
   334         <hlm:antconfiglint>
   335         <hlm:antlint>
   335             <WrongTypePropertyCheck/>
   336             <fileset id="antlint.files" dir="${helium.dir}/tools">
   336         </hlm:antconfiglint>
   337                 <include name="**/*.ant.xml"/>
       
   338                 <include name="**/build.xml"/>
       
   339                 <include name="**/*.antlib.xml"/>
       
   340                 <exclude name="tests/**"/>
       
   341                 <exclude name="**/test/test_*.xml"/>
       
   342                 <exclude name="external/**"/>
       
   343                 <exclude name="**/tests/data/**"/>
       
   344                 <exclude name="build/**"/>
       
   345             </fileset>
       
   346             <hlm:checkPropertyTypeAndValueMismatch severity="error" />
       
   347             <hlm:antlintConsoleReporter />            
       
   348         </hlm:antlint>
   337     </target>
   349     </target>
   338     
   350     
   339     
   351     
   340     <!-- Generates an Ant XML database file.
   352     <!-- Generates an Ant XML database file.
   341         
   353         
   350         <delete dir="${helium.build.dir}/jep"/>
   362         <delete dir="${helium.build.dir}/jep"/>
   351         <delete dir="${helium.build.dir}/python"/>
   363         <delete dir="${helium.build.dir}/python"/>
   352         <delete dir="${helium.build.dir}/beanshell"/>
   364         <delete dir="${helium.build.dir}/beanshell"/>
   353         <delete file="${helium.build.dir}/test_jython.xml"/>
   365         <delete file="${helium.build.dir}/test_jython.xml"/>
   354         <mkdir dir="${helium.build.dir}/report/antlint" />
   366         <mkdir dir="${helium.build.dir}/report/antlint" />
       
   367         
       
   368         <pathconvert pathsep="${path.separator}" property="python.tools.path">
       
   369             <fileset dir="${helium.dir}/nokia_builder" includes="tools/pylint/**/*.egg" />
       
   370             <dirset dir="${helium.dir}/nokia_builder" includes="tools/pylint/**/*.egg" />
       
   371         </pathconvert>
   355         <hlm:antlint>
   372         <hlm:antlint>
   356             <fileset id="antlint.files" dir="${helium.dir}/tools">
   373             <fileset id="antlint.files" dir="${helium.dir}/tools">
   357                 <include name="**/*.ant.xml"/>
   374                 <include name="**/*.ant.xml"/>
   358                 <include name="**/build.xml"/>
   375                 <include name="**/build.xml"/>
   359                 <include name="**/*.antlib.xml"/>
   376                 <include name="**/*.antlib.xml"/>
   373             <hlm:checkFileName severity="warning" regexp="^build.xml$|ant.xml$|antlib.xml$" />
   390             <hlm:checkFileName severity="warning" regexp="^build.xml$|ant.xml$|antlib.xml$" />
   374             <hlm:checkRunTarget severity="warning" />
   391             <hlm:checkRunTarget severity="warning" />
   375             <hlm:checkAntCall severity="warning" />
   392             <hlm:checkAntCall severity="warning" />
   376             <hlm:checkScriptSize severity="warning" />
   393             <hlm:checkScriptSize severity="warning" />
   377             <hlm:checkUseOfIfInTargets severity="warning" />
   394             <hlm:checkUseOfIfInTargets severity="warning" />
   378             <hlm:checkJythonScript severity="error" outputDir="${helium.build.dir}/jep"/>
   395             <hlm:checkJythonScript severity="error"/>
   379             <hlm:checkScriptCondition severity="warning" outputDir="${helium.build.dir}/scriptcondition"/>
   396             <hlm:checkScriptCondition severity="warning" />
   380             <hlm:checkPythonTasks severity="warning" outputDir="${helium.build.dir}/python"/>
       
   381             <hlm:checkUseOfEqualsTask severity="warning" />
   397             <hlm:checkUseOfEqualsTask severity="warning" />
   382             <hlm:checkScriptDefNameAttributes severity="error" />
   398             <hlm:checkScriptDefAttributes severity="error" />
   383             <hlm:checkScriptDefStyle severity="warning" />
   399             <hlm:checkScriptDefStyle severity="warning" />
   384             <hlm:checkScriptDef severity="error" outputDir="${helium.build.dir}/beanshell"/>
   400             <hlm:checkScriptDefName severity="warning" regexp="([a-z0-9][a-zA-Z0-9]*)"/>
   385             <hlm:checkDuplicateNames severity="warning" />
   401             <hlm:checkDuplicateNames severity="warning" />
   386             <hlm:checkTryCatchBlock severity="warning" />
   402             <hlm:checkTryCatchBlock severity="warning" />
       
   403             <hlm:checkPropertyTypeAndValueMismatch severity="error" />
       
   404             <hlm:checkVariableTask severity="error" />
   387             
   405             
       
   406             <!-- external command executors -->
       
   407             <hlm:checkstyleExecutor outputDir="${helium.build.dir}/beanshell" config="builder/java/config/java_checkstyle_config.xml">
       
   408                 <formatter type="plain"/>
       
   409             </hlm:checkstyleExecutor>
       
   410             <hlm:pylintExecutor outputDir="${helium.build.dir}/python">
       
   411                 <env key="PYTHONPATH" value="${python.tools.path}"/>
       
   412                 <arg file="${helium.dir}/nokia_builder/tools/pylint/bin/pylint-script.py"/>
       
   413                 <arg value="--output-format=parseable"/>
       
   414                 <arg line="--rcfile=${helium.dir}/nokia_builder/config/pylintrc.txt"/>
       
   415             </hlm:pylintExecutor>
       
   416 
   388             <!-- Reporters -->
   417             <!-- Reporters -->
   389             <hlm:antlintCheckstyleReporter file="${helium.build.dir}/report/antlint/antlint_report.xml" />
   418             <hlm:antlintCheckstyleReporter file="${helium.build.dir}/report/antlint/antlint_report.xml" />
   390             <hlm:antlintConsoleReporter />            
   419             <hlm:antlintConsoleReporter />            
       
   420             
   391         </hlm:antlint>
   421         </hlm:antlint>
   392         <fileset id="jep.files" dir="${helium.build.dir}">
   422 
   393             <include name="jep/**/*.py"/>
       
   394             <include name="python/**/*.py"/>
       
   395         </fileset>
       
   396         <!--<antcall target="pylint" inheritRefs="true">
       
   397             <reference refid="jep.files" torefid="python.files" />
       
   398         </antcall>-->
       
   399         <cs:checkstyle config="builder/java/config/java_checkstyle_config.xml">
       
   400             <fileset dir="${helium.build.dir}/beanshell" includes="**/*.java"/>
       
   401             <formatter type="plain"/>
       
   402         </cs:checkstyle>
       
   403         
       
   404         <for param="file">
   423         <for param="file">
   405             <path>
   424             <path>
   406                 <fileset dir="${helium.dir}">
   425                 <fileset dir="${helium.dir}">
   407                     <include name="**/*.ftl"/>
   426                     <include name="**/*.ftl"/>
   408                     <include name="**/*.rst"/>
   427                     <include name="**/*.rst"/>
   420                 </loadfile>
   439                 </loadfile>
   421                 <fail if="tabs.in.ftl" message="@{file} has tabs" />
   440                 <fail if="tabs.in.ftl" message="@{file} has tabs" />
   422             </sequential>
   441             </sequential>
   423         </for>
   442         </for>
   424     </target>
   443     </target>
   425     
   444    
   426     
   445     
   427     <!-- This target can be use to clean up after a build finished or failed.
   446     <!-- This target can be use to clean up after a build finished or failed.
   428     
   447     
   429     This contains:
   448     This contains:
   430     * Unsubst build drive if the build finished.
   449     * Unsubst build drive if the build finished.