Welcome to mirror list, hosted at ThFree Co, Russian Federation.

build-ci-full.xml « tests - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c35253ea51a7cbae8271563d91cd77193de50b94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<project name="piwik-full-ci" default="all" basedir=".">

    <property file="build.properties"/>
    <property file="defaults.properties"/>

    <target name="clean">
        <delete dir="${basedir}/results"/>
    </target>

    <target name="prepare" depends="clean">
        <mkdir dir="${basedir}/../tmp/templates_c"/>
        <mkdir dir="${basedir}/../tmp/cache"/>
        <mkdir dir="${basedir}/../tmp/latest"/>
        <mkdir dir="${basedir}/../tmp/sessions"/>
        <mkdir dir="${basedir}/../tmp/assets"/>

        <mkdir dir="${basedir}/results/api"/>
        <mkdir dir="${basedir}/results/code-browser"/>
        <mkdir dir="${basedir}/results/coverage"/>
        <mkdir dir="${basedir}/results/logs"/>
        <mkdir dir="${basedir}/results/artifacts"/>

        <chmod perm="a+rw">
            <dirset dir="${basedir}/..">
                <include name="config"/>
                <include name="tmp"/>
                <include name="tmp/**"/>
                <include name="tests/lib/geoip-files" />
            </dirset>
        </chmod>
    </target>

    <!-- phpcpd: Copy and Paste Detection -->
    <target name="phpcpd">
        <exec dir="${basedir}" executable="phpcpd">
            <arg line="--log-pmd ${basedir}/results/logs/pmd-cpd.xml ${basedir}/../core ${basedir}/../plugins"/>
        </exec>
    </target>

    <!-- phpmd: PHP Mess Detector -->
    <target name="phpmd">
        <exec executable="phpmd">
            <arg line="${basedir}/../core/,${basedir}/../plugins/ xml codesize,unusedcode --reportfile ${basedir}/results/logs/pmd.xml"/>
        </exec>
    </target>

    <!-- pDepend: Static Code Analysis -->
    <target name="pdepend">
        <exec dir="${basedir}" executable="pdepend">
            <arg line="--jdepend-xml=results/logs/jdepend.xml ${basedir}/../core,${basedir}/../plugins/"/>
        </exec>
    </target>

    <target name="process-build-resources-mysqli" depends="prepare">
        <copy file="${basedir}/config/mysqli.template.php" tofile="${basedir}/../config/config.ini.php" overwrite="true">
            <filterset>
                <filtersfile file="${basedir}/build.properties"/>
            </filterset>
        </copy>
    </target>

    <target name="test-mysqli" depends="process-build-resources-mysqli">
        <exec executable="php" dir="${basedir}/PHPUnit" failonerror="false" failifexecutionfails="true">
            <arg line="-d zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
                       /usr/bin/phpunit"/>
        </exec>
    </target>

    <target name="process-build-resources-pdo-mysql" depends="prepare">
        <copy file="${basedir}/config/pdo_mysql.template.php" tofile="${basedir}/../config/config.ini.php" overwrite="true">
            <filterset>
                <filtersfile file="${basedir}/build.properties"/>
            </filterset>
        </copy>
    </target>

    <target name="test-pdo-mysql" depends="process-build-resources-pdo-mysql">
        <exec executable="php" dir="${basedir}/PHPUnit" failonerror="false" failifexecutionfails="true">
            <arg line="-d zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
                       /usr/bin/phpunit
                       --log-junit ${basedir}/results/logs/junit.xml
                       --coverage-clover ${basedir}/results/logs/clover.xml
                       --coverage-html ${basedir}/results/coverage"/>
        </exec>
    </target>

    <target name="tools-parallel" description="Run tools in parallel">
        <parallel>
            <antcall target="phpmd"/>
            <antcall target="pdepend"/>
            <antcall target="phpcpd"/>
        </parallel>
    </target>

    <target name="all" depends="prepare,tools-parallel,test-mysqli">
    </target>

</project>