-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
build.xml
69 lines (58 loc) · 2.54 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="paypal-rest-sdk-php" basedir="." default="all">
<property name="release.dir" value="${basedir}/release" />
<property name="output.dir" value="${basedir}/build" />
<property name="phplint.out" value="${output.dir}/phplint.txt" />
<property name="phploc.out" value="${output.dir}/phploc.xml" />
<property name="coverage.dir" value="${output.dir}/coverage" />
<property name="coverage.out" value="${coverage.dir}/junit.xml" />
<property name="clover.out" value="${coverage.dir}/clover.xml" />
<property name="test.dir" value="${output.dir}/test" />
<property name="coverage.out" value="${coverage.dir}/junit.xml" />
<property name="clover.out" value="${coverage.dir}/clover.xml" />
<fileset id="src.files" dir="${basedir}/lib" includes="**/*.php" />
<target name="composer-init" description="Downloads composer.phar if not available locally">
<if>
<available file="composer.phar" />
<then>
<echo>Composer is installed</echo>
</then>
<else>
<echo message="Installing composer" />
<exec command="curl -s http://getcomposer.org/installer | php" />
<exec command="php composer.phar install --dev" />
</else>
</if>
</target>
<target name="phplint">
<delete file="${phplint.out}"/>
<apply executable="php" failonerror="true" output="${phplint.out}" append="true">
<arg value="-l" />
<fileset refid="src.files" />
</apply>
</target>
<target name="phploc">
<exec command="phploc.bat --log-xml ${phploc.out} ." dir="${basedir}/lib" />
</target>
<target name="coverage">
<mkdir dir="${output.dir}/coverage"/>
<exec command="phpunit.bat --coverage-html=${coverage.dir} --coverage-clover=${clover.out} --log-junit=${coverage.out} --exclude-group=PayPal\\Api\\*" />
</target>
<target name="clean" description="Deletes build artifacts">
<delete dir="${output.dir}"/>
<mkdir dir="${output.dir}"/>
</target>
<target name="test" description="Runs test cases">
<exec command="phpunit.bat --testdox-html=${test.dir}/testdox.html --log-junit=${test.dir}/junit.xml"/>
</target>
<!-- Requires phing -->
<target name="convert-test-report">
<mkdir dir="build/test/report"/>
<phpunitreport infile="build/test/junit.xml"
format="frames"
todir="build/test/report" />
</target>
<target name="build" depends="test" description="Builds SDK" />
<target name="report" depends="phplint, coverage, phploc" description="Runs code checks and coverage reports" />
<target name="all" depends="clean, test, build, report" description="Do everything" />
</project>