forked from kohana/kohana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
109 lines (95 loc) · 3.66 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
<project name="kohana" default="help" basedir=".">
<property environment="env"/>
<property name="repo" value="[email protected]:kohana/kohana.git"/>
<property name="branch" value="3.0.x"/>
<property name="tag" value="${env.TAG}"/>
<property name="submodules" value="system,modules/auth,modules/cache,modules/codebench,modules/database,modules/image,modules/oauth,modules/orm,modules/pagination,modules/unittest,modules/userguide"/>
<property name="release-excludes" value="**/.git,**/.git*,build.xml,phpunit.xml,DEVELOPERS.md,phpunitcc,code_coverage.xml,release-tag,TESTING.md,**/tests"/>
<!-- Clean up -->
<target name="help">
<echo message="USAGE"/>
<echo message="====="/>
<echo message="ant test Run unit tests."/>
<echo message="ant test-log Run unit tests with logging enabled."/>
<echo message="ant phpcs Run phpcs."/>
<echo message="ant phpcs-log Run phpcs with logging enabled."/>
</target>
<!-- Clean up -->
<target name="clean">
<delete dir="${basedir}/build"/>
<!-- Create build directories -->
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/release"/>
<mkdir dir="${basedir}/build/code-browser"/>
</target>
<!-- Check if a tag has been supplied -->
<target name="tag-supplied">
<echo message="TODO: Check if tag has been supplied."/>
</target>
<!-- Check if a specific tag exists -->
<target name="tag-exists" depends="tag-supplied">
<echo message="TODO: Check if tag (${tag}) exists."/>
</target>
<!-- Run unit tests -->
<target name="test">
<exec executable="phpunit" failonerror="true"/>
</target>
<!-- Run unit tests and generate junit.xml and clover.xml -->
<target name="test-log">
<exec executable="phpunit" failonerror="true">
<arg line="--coverage-html=${basedir}/build/coverage"/>
<arg line="--log-junit=${basedir}/build/logs/junit.xml"/>
<arg line="--coverage-clover=${basedir}/build/logs/clover.xml"/>
</exec>
</target>
<!-- Run PHP Code Sniffer -->
<target name="phpcs">
<exec executable="phpcs" failonerror="false">
<arg line="--standard=Kohana"/>
<arg line="--ignore=*.js,*.css,**/vendor/**"/>
<arg line="${basedir}"/>
</exec>
</target>
<!-- Run PHP Code Sniffer and generate checkstyle.xml -->
<target name="phpcs-log">
<exec executable="phpcs" failonerror="false" output="/dev/null">
<arg line="--standard=Kohana"/>
<arg line="--ignore=*.js,*.css,**/vendor/**"/>
<arg line="--report=checkstyle"/>
<arg line="--report-file=${basedir}/build/logs/checkstyle.xml"/>
<arg line="${basedir}"/>
</exec>
</target>
<!-- Run PHP Mess Detector and generate pmd.xml -->
<target name="phpmd-log">
<exec executable="phpmd">
<arg line="${basedir}" />
<arg line="xml" />
<arg line="codesize,unusedcode" />
<arg line="--exclude=**/vendor/**" />
<arg line="--reportfile ${basedir}/build/logs/pmd.xml" />
</exec>
</target>
<!-- Run PHP Copy/Paste Detector and generate pmd.xml -->
<target name="phpcpd-log">
<exec executable="phpcpd">
<arg line="--log-pmd ${basedir}/build/logs/pmd-cpd.xml ${basedir}" />
</exec>
</target>
<!-- Run PHP Depend and generate jdepend.xml -->
<target name="pdepend-log">
<exec executable="pdepend">
<arg line="--jdepend-xml=${basedir}/build/logs/jdepend.xml ${basedir}" />
</exec>
</target>
<!-- Run PHP CodeBrowser and generate output -->
<target name="phpcb-log">
<exec executable="phpcb">
<arg line="--log ${basedir}/build/logs --source ${basedir} --output ${basedir}/build/code-browser" />
</exec>
</target>
<!-- Hudson CI target -->
<target name="hudson" depends="clean,test-log,phpcs-log,phpmd-log,phpcpd-log,pdepend-log,phpcb-log">
</target>
</project>