-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.jenkins.xml
62 lines (53 loc) · 1.74 KB
/
build.jenkins.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
<?xml version="1.0"?>
<project basedir="." default="build">
<property name="rootdir" value="${project.basedir}/" override="true" />
<property name="bindir" value="${rootdir}vendor/bin/" override="false" />
<target name="build" depends="prepare,lint,phpunit,phpcs,phpmd" />
<target name="prepare" depends="clean">
<mkdir dir="${rootdir}build/coverage/" />
<mkdir dir="${rootdir}build/logs/" />
</target>
<target name="clean">
<if>
<available file="${rootdir}build/" type="dir" />
<then>
<delete dir="${rootdir}build/" />
</then>
</if>
</target>
<target name="lint">
<phplint haltonfailure="true">
<fileset dir="${rootdir}">
<include name="src/" />
<exclude name="src/*/Resource/" />
<include name="application/function/" />
<include name="application/script/" />
<include name="test/unit/" />
</fileset>
</phplint>
</target>
<target name="phpunit">
<exec executable="${bindir}phpunit" passthru="true">
<arg line="-c ${rootdir}phpunit.xml" />
<arg line="--log-junit ${rootdir}build/logs/junit.xml" />
<arg line="--coverage-clover ${rootdir}build/logs/clover.xml" />
<arg line="--coverage-html ${rootdir}build/coverage/" />
<arg line="--coverage-crap4j ${rootdir}build/logs/crap4j.xml" />
</exec>
</target>
<target name="phpcs">
<exec executable="${bindir}phpcs" passthru="true">
<arg line="-p" />
<arg line="--report=checkstyle" />
<arg line="--report-file=${rootdir}build/logs/checkstyle.xml" />
</exec>
</target>
<target name="phpmd">
<exec executable="${bindir}phpmd" passthru="true">
<arg line="${rootdir}src" />
<arg line="xml" />
<arg line="${rootdir}phpmd.xml" />
<arg line="--reportfile ${rootdir}build/logs/pmd.xml" />
</exec>
</target>
</project>