buildframework/helium/tools/quality/lint.ant.xml
author Jon Chatten
Thu, 26 Aug 2010 13:41:01 +0100
changeset 630 31ef8a13d4f4
parent 628 7c4a911dc066
child 645 b8d81fa19e7d
permissions -rw-r--r--
sbs version 2.15.1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     2
<!-- 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     3
============================================================================ 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     4
Name        : lint.ant.xml 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     5
Part of     : Helium 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     6
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     7
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     8
All rights reserved.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
     9
This component and the accompanying materials are made available
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    10
under the terms of the License "Eclipse Public License v1.0"
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    11
which accompanies this distribution, and is available
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    12
at the URL "http://www.eclipse.org/legal/epl-v10.html".
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    13
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    14
Initial Contributors:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    15
Nokia Corporation - initial contribution.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    16
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    17
Contributors:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    18
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    19
Description:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    20
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    21
============================================================================
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    22
-->
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    23
<project name="lint" xmlns:hlm="http://www.nokia.com/helium"
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    24
                     xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    25
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    26
    <!-- Run AntLint on project Ant XML files. -->
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    27
    <target name="antlint">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    28
        <delete dir="${helium.build.dir}/jep"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    29
        <delete dir="${helium.build.dir}/python"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    30
        <delete dir="${helium.build.dir}/beanshell"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    31
        <delete file="${helium.build.dir}/test_jython.xml"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    32
        <mkdir dir="${helium.build.dir}/report/antlint" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    33
        <hlm:antlint>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    34
            <fileset dir="${helium.dir}/tools">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    35
                <include name="**/*.ant.xml"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    36
                <include name="**/build.xml"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    37
                <include name="**/*.antlib.xml"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    38
                <exclude name="tests/**"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    39
                <exclude name="**/test/test_*.xml"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    40
                <exclude name="external/**"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    41
                <exclude name="**/tests/data/**"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    42
                <exclude name="build/**"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    43
            </fileset>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    44
            <hlm:checkTabCharacter severity="error" enabled="true"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    45
            <hlm:checkPropertyName severity="warning" enabled="true" regexp="([a-z0-9[\\d\\_\\.\\@\\{\\}\\$]]*)" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    46
            <hlm:checkTargetName severity="warning" enabled="true" regexp="([a-z0-9[\\d\\-]]*)" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    47
            <hlm:checkIndentation severity="error" enabled="true"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    48
            <hlm:checkPresetDefMacroDefName severity="warning" enabled="true" regexp="([a-z0-9][a-zA-Z0-9]*)" />       
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    49
            <hlm:checkProjectName severity="warning" enabled="true" regexp="([a-z0-9[\\d\\.\\_\\-]]*)" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    50
            <hlm:checkDescription severity="warning" enabled="true"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    51
            <hlm:checkFileName severity="warning" enabled="true" regexp="^build.xml$|ant.xml$|antlib.xml$" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    52
            <hlm:checkRunTarget severity="warning" enabled="true"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    53
            <hlm:checkAntCall severity="warning" enabled="true"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    54
            <hlm:checkScriptSize severity="warning" enabled="true"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    55
            <hlm:checkUseOfIfInTargets severity="warning" enabled="true"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    56
            <hlm:checkJythonScript severity="error" enabled="true" outputDir="${helium.build.dir}/jep"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    57
            <hlm:checkScriptCondition severity="warning" enabled="true" outputDir="${helium.build.dir}/scriptcondition"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    58
            <hlm:checkPythonTasks severity="warning" enabled="true" outputDir="${helium.build.dir}/python"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    59
            <hlm:checkUseOfEqualsTask severity="warning" enabled="true"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    60
            <hlm:checkScriptDefNameAttributes severity="error" enabled="true"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    61
            <hlm:checkScriptDefStyle severity="warning" enabled="true"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    62
            <hlm:checkScriptDef severity="error" enabled="true" outputDir="${helium.build.dir}/beanshell"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    63
            <hlm:checkDuplicateNames severity="warning" enabled="true"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    64
            
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    65
            <!-- Reporters -->
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    66
            <hlm:antlintCheckstyleReporter file="${helium.build.dir}/report/antlint/antlint_report.xml" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    67
            <hlm:antlintConsoleReporter />            
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    68
        </hlm:antlint>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    69
        <fileset id="jep.files" dir="${helium.build.dir}">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    70
            <include name="jep/**/*.py"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    71
            <include name="python/**/*.py"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    72
        </fileset>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    73
        <antcall target="pylint" inheritRefs="true">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    74
            <reference refid="jep.files" torefid="python.files" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    75
        </antcall>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    76
        <cs:checkstyle config="${helium.dir}/builder/java/config/java_checkstyle_config.xml">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    77
            <fileset dir="${helium.build.dir}/beanshell" includes="**/*.java"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    78
            <formatter type="plain"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    79
        </cs:checkstyle>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    80
    </target>    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    81
        
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    82
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    83
    <!-- Checks FTL files for lint issues. -->
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    84
    <target name="ftllint">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    85
        <for param="file">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    86
            <path>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    87
                <fileset dir="${helium.dir}">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    88
                    <include name="**/*.ftl"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    89
                    <include name="**/*.rst"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    90
                    <exclude name="**/*.mk.ftl"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    91
                    <exclude name="build/**/*"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    92
                </fileset>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    93
            </path>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    94
            <sequential>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    95
                <loadfile srcfile="@{file}" property="tabs.in.ftl">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    96
                    <filterchain>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    97
                        <linecontainsregexp>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    98
                            <regexp pattern="\t"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
    99
                        </linecontainsregexp>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   100
                    </filterchain>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   101
                </loadfile>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   102
                <fail if="tabs.in.ftl" message="@{file} has tabs" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   103
            </sequential>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   104
        </for>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   105
    </target>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   106
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   107
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   108
    <target name="hlmlint" depends="antlint,ftllint"/>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   109
    
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   110
</project>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   111
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   112
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   113
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents:
diff changeset
   114