forked from mtougeron/klout-sdk-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
116 lines (100 loc) · 4.24 KB
/
build.xml
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?xml version="1.0" encoding="UTF-8"?>
<project name="klout-sdk-php" default="build" basedir=".">
<property name="dir.output" value="${project.basedir}/build/artifacts" />
<property name="coverage" value="false" />
<property name="sdk_url" value="https://github.com/mtougeron/klout-sdk-php" />
<fileset id="src_files" dir="${project.basedir}/src" includes="**/*.php" />
<target name="phpunit" description="Run unit tests using PHPUnit">
<exec passthru="true" command="vendor/bin/phpunit" />
</target>
<target name="prepare" depends="clean">
<mkdir dir="${dir.output}"/>
<mkdir dir="${dir.output}/logs" />
</target>
<target name="create-staging" description="Creates a staging directory for zip and phar creation">
<delete dir="${dir.output}/staging" failonerror="false" quiet="true"/>
<mkdir dir="${dir.output}/staging"/>
<mkdir dir="${dir.output}/staging/Klout"/>
<mkdir dir="${dir.output}/staging/Guzzle"/>
<mkdir dir="${dir.output}/staging/Symfony"/>
<mkdir dir="${dir.output}/staging/Zend"/>
<patternset id="sdk-files">
<include name="**/*.php" />
<include name="**/*.pem" />
<include name="**/*.md5" />
<include name="**/LICENSE*" />
<include name="**/README*" />
<include name="**/CREDITS*" />
</patternset>
<!-- Copy deps -->
<copy file="${project.basedir}/build/klout-autoloader.php" tofile="${dir.output}/staging/klout-autoloader.php"/>
<copy todir="${dir.output}/staging">
<fileset dir="src">
<patternset refid="sdk-files"/>
</fileset>
</copy>
<copy file="${project.basedir}/LICENSE" tofile="${dir.output}/staging/Klout/LICENSE"/>
<!-- Copy Symfony dependencies -->
<copy todir="${dir.output}/staging">
<fileset dir="vendor/symfony/event-dispatcher">
<include name="**/*.php" />
</fileset>
</copy>
<copy todir="${dir.output}/staging">
<fileset dir="vendor/symfony/class-loader">
<include name="**/*.php" />
</fileset>
</copy>
<!-- Copy Guzzle deps -->
<copy todir="${dir.output}/staging">
<fileset dir="vendor/guzzle/guzzle/src">
<patternset refid="sdk-files"/>
</fileset>
</copy>
<!-- Copy Zend Framework deps -->
<copy todir="${dir.output}/staging/Zend">
<fileset dir="vendor/zendframework/zend-escaper/Zend">
<patternset refid="sdk-files"/>
</fileset>
</copy>
<copy todir="${dir.output}/staging/Zend">
<fileset dir="vendor/zendframework/zend-filter/Zend">
<patternset refid="sdk-files"/>
</fileset>
</copy>
<copy todir="${dir.output}/staging/Zend">
<fileset dir="vendor/zendframework/zend-stdlib/Zend">
<patternset refid="sdk-files"/>
</fileset>
</copy>
<copy todir="${dir.output}/staging/Zend">
<fileset dir="vendor/zendframework/zend-uri/Zend">
<patternset refid="sdk-files"/>
</fileset>
</copy>
<copy todir="${dir.output}/staging/Zend">
<fileset dir="vendor/zendframework/zend-validator/Zend">
<patternset refid="sdk-files"/>
</fileset>
</copy>
</target>
<target name="phar" depends="create-staging" description="Create a phar with an autoloader">
<pharpackage destfile="build/klout.phar" stub="build/phar-stub.php" basedir="${dir.output}/staging">
<fileset dir="${dir.output}/staging">
<include name="**/**"/>
</fileset>
<metadata>
<element name="link" value="${sdk_url}" />
</metadata>
</pharpackage>
</target>
<target name="clean" description="Deletes build artifacts">
<delete dir="${dir.output}"/>
</target>
<target name="phplint">
<phplint>
<fileset refid="src_files" />
</phplint>
</target>
<target name="build" depends="phplint, prepare, phpunit, phar"/>
</project>