aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/build.xml
blob: 6a37d2011734601a2d3a811316b3c60ba113e148 (plain) (blame)
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
<?xml version="1.0"?>
<project name="SabreDAV" default="buildzip" basedir=".">

    <!-- Any default properties -->
    <property file="build.properties" />

    <!-- Where to write api documentation -->
    <property name="sabredav.apidocspath" value="docs/api" />

    <target name="buildzip" depends="init, test, clean">
        <mkdir dir="build" />
        <echo>Running composer</echo>
        <exec command="composer create-project --no-dev sabre/dav build/SabreDAV ${sabredav.version}" checkreturn="false" passthru="1" />
        <zip destfile="build/SabreDAV-${sabredav.version}.zip" basedir="build/SabreDAV" prefix="SabreDAV/" />
    </target>

    <target name="uploadzip" depends="buildzip">
        <echo>Uploading to Google Code</echo>
        <propertyprompt propertyName="googlecode.username" promptText="Enter your googlecode username" useExistingValue="true" />
        <propertyprompt propertyName="googlecode.password" promptText="Enter your googlecode password" useExistingValue="true" />
        <exec command="bin/googlecode_upload.py -s 'SabreDAV ${sabredav.version}' -p sabredav --labels=${sabredav.ucstability} -u '${googlecode.username}' -w '${googlecode.password}' build/SabreDAV-${sabredav.version}.zip" checkreturn="true" />
    </target>

    <target name="clean" depends="init">
        <echo msg="Removing build files (cleaning up distribution)" />
        <delete dir="docs/api" />
        <delete dir="build" />
    </target>

    <target name="markrelease" depends="init,clean,test">
        <echo>Creating Git release tag</echo>
        <exec command="git tag ${sabredav.version}" checkreturn="false" passthru="1" />
    </target>

    <target name="test">
        <phpunit haltonfailure="1" haltonerror="1" bootstrap="tests/bootstrap.php" haltonskipped="1" printsummary="1">
          <batchtest>
            <fileset dir="tests">
              <include name="**/*.php"/>
            </fileset>
          </batchtest>
        </phpunit>
    </target>

    <target name="apidocs" depends="init">

        <echo>Creating api documentation using PHP documentor</echo>
        <echo>Writing to ${sabredav.apidocspath}</echo>
        <exec command="phpdoc parse -t ${sabredav.apidocspath} -d lib/" passthru="1" />
        <exec command="bin/phpdocmd ${sabredav.apidocspath}/structure.xml ${sabredav.apidocspath} --lt %c" passthru="1" />
        <!--<delete file="${sabredav.apidocspath}/structure.xml" />-->

    </target>

    <target name="init">

        <!-- This sets SabreDAV version information -->
        <adhoc-task name="sabredav-version"><![CDATA[

            class SabreDAV_VersionTask extends Task {

                public function main() {

                    include_once 'lib/Sabre/DAV/Version.php';
                    $this->getProject()->setNewProperty('sabredav.version',\Sabre\DAV\Version::VERSION);
                    $this->getProject()->setNewProperty('sabredav.stability',\Sabre\DAV\Version::STABILITY);
                    $this->getProject()->setNewProperty('sabredav.ucstability',ucwords(Sabre\DAV\Version::STABILITY));

                }

            }

        ]]></adhoc-task>
        <sabredav-version />
        <echo>SabreDAV version ${sabredav.version}</echo>

    </target>

</project>