summaryrefslogtreecommitdiffstats
path: root/build.xml
blob: 4b27678ac3be45202b308e89a03e5209f5cb0ce2 (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
<?xml version="1.0" encoding="UTF-8"?>
 <project name="php-ssrs" basedir="." default="app">
    <property name="builddir" value="${ws}/build" />

    <target name="clean">
        <echo msg="Clean..." />
        <delete dir="${builddir}" />
    </target>

    <target name="prepare">
        <echo msg="Prepare..." />
        <mkdir dir="${builddir}" />
        <mkdir dir="${builddir}/logs" />
        <mkdir dir="${builddir}/logs/coverage" />
        <mkdir dir="${builddir}/docs" />
    </target>

    <!-- Deploy app -->
    <target name="app">
        <echo msg="Prepare app..." />
    </target>

    <!-- PHP API Documentation -->
    <target name="phpdoc">
        <echo msg="PHP Documentor..." />
        <phpdoc title="API Documentation"
                destdir="${builddir}/docs"
                sourcecode="yes"
                defaultpackagename="php-ssrs"
                output="HTML:Smarty:PHP">
            <fileset dir="source">
                <include name="**/*.php" />
            </fileset>
        </phpdoc>
    </target>

    <!-- PHP copy/paste analysis -->
    <target name="phpcpd">
        <echo msg="PHP Copy/Paste..." />
        <exec command="phpcpd --log-pmd '${builddir}/logs/pmd.xml' source" escape="false" />
    </target>

    <!-- PHP dependency checker -->
    <target name="pdepend">
        <echo msg="PHP Depend..." />
        <exec command="pdepend --jdepend-xml='${builddir}/logs/jdepend.xml' '${ws}/source'" escape="false" />
    </target>

    <!-- PHP CodeSniffer -->
    <target name="phpcs">
        <echo msg="PHP CodeSniffer..." />
        <exec command="phpcs --tab-width=4 --extensions=php --standard=Iw --report=checkstyle '${ws}/source' > '${builddir}/logs/checkstyle.xml'" escape="false" />
    </target>

    <!-- Unit Tests & coverage analysis -->
    <target name="phpunit">
        <echo msg="PHP Unit..." />
        <exec command="phpunit --configuration '${ws}/source/tests/phpunit.xml' --log-junit '${builddir}/logs/phpunit.xml' --coverage-clover '${builddir}/logs/coverage/clover.xml' '${ws}/source/tests'" />
    </target>
</project>