forked from Level42/NotJaxbBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
120 lines (102 loc) · 3.7 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
117
118
119
120
<?xml version="1.0" encoding="UTF-8"?>
<project name="NotJaxbBundle" default="build">
<property environment="env" />
<property name="build.dir" value="${env.WORKSPACE}/build" />
<target name="build" depends="clean, analyse" />
<target name="test" depends="clean, prepare, launch-tests" />
<target name="build-and-test" depends="clean, analyse, prepare, launch-tests" />
<target name="clean" description="Nettoyage des dossiers">
<delete dir="${build.dir}" />
<mkdir dir="${build.dir}" />
<mkdir dir="${build.dir}/doc" />
<mkdir dir="${build.dir}/qualimetry" />
<mkdir dir="${build.dir}/tests" />
<mkdir dir="${build.dir}/tests/coverage" />
<delete dir="${env.WORKSPACE}/Tests/app/cache" />
<delete dir="${env.WORKSPACE}/Tests/app/logs" />
</target>
<target name="clean-vendors" description="Nettoyage des dossiers vendor">
<delete dir="${env.WORKSPACE}/vendor" />
</target>
<target name="prepare" description="Préparation des tests">
<exec executable="wget">
<arg line="http://getcomposer.org/composer.phar" />
</exec>
<exec executable="php">
<arg line="composer.phar install" />
</exec>
</target>
<target name="launch-tests" description="Lancement des tests">
<exec executable="phpunit">
<arg
line="--log-junit=${build.dir}/tests/phpunit-result.xml
--coverage-clover=${build.dir}/tests/phpunit-coverage.xml
--coverage-html=${build.dir}/tests/coverage
--configuration=${env.WORKSPACE}/phpunit.xml" />
</exec>
</target>
<target name="analyse" description="Analyse des sources">
<sequential>
<antcall target="php-lint" />
<antcall target="pdepend" />
<antcall target="phpmd" />
<antcall target="phpcpd" />
<antcall target="phpcs" />
<antcall target="phpdoc" />
</sequential>
</target>
<target name="pdepend" description="Analyse de code et métriques">
<exec executable="pdepend">
<arg
line="--jdepend-xml=${build.dir}/qualimetry/jdepend-result.xml
--jdepend-chart=${build.dir}/qualimetry/jdepend-chart.svg
--overview-pyramid=${build.dir}/qualimetry/jdepend-pyramid.svg
--ignore=${env.WORKSPACE}/vendor/**,${env.WORKSPACE}/Tests/**
${env.WORKSPACE}" />
</exec>
</target>
<target name="phpmd" description="Détection de la complexité de code">
<exec executable="phpmd">
<arg
line="${env.WORKSPACE} xml codesize,unusedcode,naming
--exclude ${env.WORKSPACE}/vendor/**,${env.WORKSPACE}/Tests/**
--reportfile ${build.dir}/qualimetry/phpmd-result.xml" />
</exec>
</target>
<target name="phpcpd" description="Analyse de duplication de code">
<exec executable="phpcpd">
<arg
line="--log-pmd ${build.dir}/qualimetry/phpcpd-result.xml
--exclude vendor
--exclude cache
--exclude Tests
${env.WORKSPACE}" />
</exec>
</target>
<target name="phpdoc" description="Génération de la documentation">
<exec executable="phpdoc">
<arg
line="-d ${env.WORKSPACE}/ -t ${build.dir}/doc/ --ignore=${env.WORKSPACE}/vendor/**,${env.WORKSPACE}/Tests/**" />
</exec>
</target>
<target name="phpcs" description="Contrôle de l'indentation">
<exec executable="phpcs" output="${build.dir}/qualimetry/phpcs-result.xml">
<arg
line="--report=checkstyle
--standard=Symfony2
--extensions=php
--ignore=${env.WORKSPACE}/vendor/**,${env.WORKSPACE}/Tests/**
${env.WORKSPACE}" />
</exec>
</target>
<target name="php-lint" description="Analyse syntaxique">
<apply executable="php" failonerror="false">
<arg value="-l" />
<fileset dir="${env.WORKSPACE}">
<include name="**/*.php" />
<exclude name="**/vendor/**" />
<exclude name="**/cache/**" />
</fileset>
</apply>
</target>
</project>