File: build.xml

package info (click to toggle)
php-phar-io-manifest 2.0.4-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 704 kB
  • sloc: php: 2,228; xml: 291; makefile: 14
file content (91 lines) | stat: -rw-r--r-- 3,801 bytes parent folder | download | duplicates (2)
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="manifest" default="setup">
    <property name="phive.bin" value="phive" />

    <target name="setup" depends="clean,install-tools,install-dependencies"/>

    <target name="clean" unless="clean.done" description="Cleanup build artifacts">
        <delete dir="${basedir}/tools"/>
        <delete dir="${basedir}/vendor"/>
        <delete file="${basedir}/src/autoload.php"/>

        <property name="clean.done" value="true"/>
    </target>

    <target name="prepare" unless="prepare.done" depends="clean" description="Prepare for build">
        <property name="prepare.done" value="true"/>
    </target>

    <target name="install-dependencies" description="Install dependencies with Composer">
        <exec executable="${basedir}/tools/composer" taskname="composer">
            <env key="COMPOSER_DISABLE_XDEBUG_WARN" value="1"/>
            <arg value="install"/>
            <arg value="--no-interaction"/>
            <arg value="--no-progress"/>
            <arg value="--no-ansi"/>
            <arg value="--optimize-autoloader"/>
        </exec>
    </target>

    <target name="install-tools" unless="tools-installed" depends="-tools-installed" description="Install tools with Phive">
        <exec executable="${phive.bin}" taskname="phive" failonerror="true">
            <arg value="--no-progress" />
            <arg value="install"/>
            <arg value="--copy" />
            <arg value="--trust-gpg-keys" />
            <!--        phpab,           phpunit,         phpstan,         psaml,           php-cs-fixer,    composer     -->
            <arg value="4AA394086372C20A,2A8299CE842DD38C,CF1A108D0E7AE720,12CE0F1D262429A5,E82B2FB314E9906E,CBB3D576F2A0946F" />
        </exec>
    </target>

    <target name="php-cs-fixer" depends="install-tools" description="Dry run php csfixer">
        <exec executable="${basedir}/tools/php-cs-fixer" failonerror="true">
            <arg value="fix" />
            <arg value="--dry-run" />
        </exec>
    </target>

    <target name="psalm" depends="install-tools,install-dependencies" description="Run psalm">
        <exec executable="${basedir}/tools/psalm" taskname="psalm-cache-clear">
            <arg value="--config=psalm.xml" />
            <arg value="--clear-cache" />
        </exec>

        <exec executable="${basedir}/tools/psalm" taskname="psalm" failonerror="true">
            <arg value="--config=psalm.xml" />
            <arg value="--show-info=true" />
            <arg value="--stats" />
        </exec>
    </target>

    <target name="psalm-baseline" depends="install-tools,install-dependencies" description="Run psalm">
        <exec executable="${basedir}/tools/psalm" taskname="psalm-cache-clear">
            <arg value="--config=psalm.xml" />
            <arg value="--clear-cache" />
        </exec>

        <exec executable="${basedir}/tools/psalm" taskname="psalm-baseline">
            <arg value="--config=psalm.xml" />
            <arg value="--set-baseline=build/psalm-baseline.xml" />
            <arg value="--show-info=false" />
        </exec>
    </target>

    <target name="test" depends="install-tools,install-dependencies" description="Run tests">
        <exec executable="${basedir}/tools/phpunit" taskname="phpunit"/>
    </target>

    <target name="phpunit-ci">
        <condition property="phpunit" value="phpunit.bat" else="phpunit">
            <os family="windows" />
        </condition>
        <exec executable="${basedir}/tools/${phpunit}" taskname="phpunit">
            <arg value="--coverage-clover build/logs/clover.xml" />
        </exec>
    </target>

    <target name="-tools-installed">
        <available file="${basedir}/tools/phpunit" property="tools-installed" type="file"/>
    </target>
</project>