This repository has been archived by the owner on Aug 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 232
/
build.xml
90 lines (76 loc) · 3.1 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="joindin" default="build" basedir=".">
<property name="source" value="src/system/application/"/>
<property name="apiv1tester" value="doc/apiv1_tester" />
<property name="basedir" value="."/>
<target name="clean" description="Clean up and create artifact directories">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>
<target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
<exec command="phpunit -c src/tests/phpunit.xml" logoutput="/dev/stdout" checkreturn="true" />
</target>
<target name="buildTasks" description="Run the phpmd, phpcs, phpdoc, phploc and lint tasks.">
<phingcall target="phpmd"/>
<phingcall target="phpcs"/>
<phingcall target="phploc"/>
<phingcall target="phplint"/>
</target>
<target name="phpmd" description="Generate pmd.xml using PHPMD">
<exec command="phpmd ${source} xml codesize,design,naming,unusedcode --reportfile ${basedir}/build/logs/pmd.xml" />
</target>
<target name="phploc" description="Generate phploc.csv">
<exec command="phploc --log-csv ${basedir}/build/logs/phploc.csv ${source}" />
</target>
<target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer">
<phpcodesniffer standard="doc/codesniffer/JoindIn/" verbosity="0">
<fileset dir="${source}">
<exclude name="views/**"/>
<exclude name="libraries/Template.php" />
</fileset>
<fileset dir="${apiv1tester}">
</fileset>
<formatter type="checkstyle" outfile="${basedir}/build/logs/checkstyle.xml" />
</phpcodesniffer>
</target>
<target name="phpcs-human-summary" description="Generate human-readable Codesniffer output">
<phpcodesniffer standard="doc/codesniffer/JoindIn/">
<fileset dir="${source}">
<exclude name="views/**"/>
<exclude name="libraries/Template.php" />
</fileset>
<formatter type="summary" usefile="false" />
</phpcodesniffer>
</target>
<target name="phpcs-human" description="Check codes style with PHP_CodeSniffer">
<phpcodesniffer standard="doc/codesniffer/JoindIn/">
<fileset dir="${source}">
<patternset>
<include name="**/${filename}" />
</patternset>
<exclude name="views/**"></exclude>
<exclude name="libraries/Template.php" />
</fileset>
</phpcodesniffer>
</target>
<target name="phplint" description="Run php -l over the fileset">
<phplint haltonfailure="true">
<fileset dir="${source}">
<patternset>
<include name="**/*.php"/>
</patternset>
</fileset>
</phplint>
</target>
<target name="build" depends="clean,buildTasks,phpunit"/>
<target name="launch">
<exec command="src/scripts/jenkinslaunch.sh" checkreturn="true"/>
</target>
</project>