-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.xml
100 lines (85 loc) · 4.34 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
<?xml version="1.0" encoding="UTF-8" ?>
<project name="loteria-api" basedir="." default="build">
<property name="dir-reports" value="./var/_reports" />
<property name="dir-source" value="./src" />
<property name="dir-datasources-ext" value="./var/ext" />
<property name="dir-datasources-xml" value="./var/xml" />
<property name="dir-datasources-zip" value="./var/zip" />
<property name="dir-vendor" value="./vendor" />
<!-- ======================== -->
<!-- = (Default) Build Task = -->
<!-- ======================== -->
<target name="build">
<phingcall target="clean"></phingcall>
<phingcall target="structure"></phingcall>
<phingcall target="composer"></phingcall>
<phingcall target="phpunit"></phingcall>
<phingcall target="metrics"></phingcall>
<phingcall target="load-datasources"></phingcall>
</target>
<!-- ============== -->
<!-- = Clean Task = -->
<!-- ============== -->
<target name="clean">
<echo msg="Cleaning build directories ..." />
<delete dir="${dir-reports}" quiet="true" />
<delete dir="${dir-datasources-ext}" quiet="true" />
<delete dir="${dir-datasources-xml}" quiet="true" />
<delete dir="${dir-datasources-zip}" quiet="true" />
<delete dir="${dir-vendor}" quiet="true" />
<delete file="./composer.lock" quiet="true" />
<delete file="./composer.phar" quiet="true" />
</target>
<!-- ================== -->
<!-- = Structure Task = -->
<!-- ================== -->
<target name="structure">
<echo msg="Creating structure ..." />
<mkdir dir="${dir-reports}" />
<mkdir dir="${dir-datasources-ext}" />
<mkdir dir="${dir-datasources-xml}" />
<mkdir dir="${dir-datasources-zip}" />
</target>
<!-- ============ -->
<!-- = Composer = -->
<!-- ============ -->
<target name="composer">
<echo msg="Download composer ..." />
<exec command="wget 'https://getcomposer.org/composer.phar'" />
<echo msg="Running composer install ..." />
<exec command="php composer.phar install --dev" logoutput="true" escape="false" />
</target>
<!-- ================ -->
<!-- = PHPUnit Task = -->
<!-- ================ -->
<target name="phpunit">
<echo msg="Running unit tests ..." />
<exec command="vendor/bin/phpunit" logoutput="true" escape="false" />
</target>
<!-- ================ -->
<!-- = Metrics Task = -->
<!-- ================ -->
<target name="metrics">
<echo msg="Running metrics tools ..." />
<echo msg="# PHPCPD ..." />
<exec command="vendor/bin/phpcpd --log-pmd ${dir-reports}/cpd.xml ${dir-source}" logoutput="true" escape="false" />
<echo msg="# PDepend ..." />
<exec command="vendor/bin/pdepend -d memory_limit=1G --jdepend-xml=${dir-reports}/jdepend.xml --summary-xml=${dir-reports}/jdepend-summary.xml --jdepend-chart=${dir-reports}/jdepend.svg --overview-pyramid=${dir-reports}/jdepend-pyramid.svg ${dir-source}" logoutput="true" escape="false" />
<echo msg="# PHP Code Sniffer ..." />
<exec command="vendor/bin/phpcs --standard=PSR2 -p -s --report-full=${dir-reports}/codesniffer-full.txt --report-summary=${dir-reports}/codesniffer-summary.txt --report-xml=${dir-reports}/codesniffer.xml --report-checkstyle=${dir-reports}/codesniffer-checkstyle.xml --report-gitblame=${dir-reports}/codesniffer-gitblame.txt ${dir-source}" logoutput="true" escape="false" />
<echo msg="# PHP Mess Detector ..." />
<exec command="vendor/bin/phpmd ${dir-source} text cleancode,codesize,controversial,design,naming,unusedcode --reportfile ${dir-reports}/phpmd.txt" logoutput="true" escape="false" />
<echo msg="# PHP Loc ..." />
<exec command="vendor/bin/phploc --progress --log-xml=${dir-reports}/phploc.xml ${dir-source}" logoutput="true" escape="false" />
</target>
<!-- ==================== -->
<!-- = Load Datasources = -->
<!-- ==================== -->
<target name="load-datasources">
<echo msg="Load Datasources ..." />
<exec command="bin/consumer" logoutput="true" />
</target>
<!-- ================================= -->
<!-- = Based in the project Manowars = -->
<!-- ================================= -->
</project>