-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbuild.xml
102 lines (90 loc) · 3.46 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="MyRadio" default="build">
<property name="vendordir" value="${basedir}/src/vendor/bin" />
<target name="build" depends="prepare,composer,lint,pdepend,phpmd-ci,phpcs-ci,eslint-ci,phpdox"/>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
<delete dir="${basedir}/build/phpdox"/>
</target>
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
<mkdir dir="${basedir}/build/phpdox"/>
</target>
<target name="composer" description="Installs and updates composer dependencies">
<exec executable="composer" failonerror="true">
<arg value="update" />
<arg value="--prefer-dist" />
<arg value="--no-progress" />
</exec>
</target>
<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${basedir}/src">
<include name="**/*.php" />
<exclude name="**/vendor/**" />
<modified />
</fileset>
<!--
<fileset dir="${basedir}/tests">
<include name="**/*.php" />
<modified />
</fileset>
-->
</apply>
</target>
<target name="pdepend" description="Calculate software metrics using PHP_Depend">
<exec executable="${vendordir}/pdepend">
<arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
<arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
<arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
<arg value="--ignore=vendor" />
<arg path="${basedir}/src" />
</exec>
</target>
<target name="phpmd-ci" description="Perform project mess detection using PHPMD creating a log file">
<exec executable="${vendordir}/phpmd">
<arg path="${basedir}/src" />
<arg value="xml" />
<arg value="${basedir}/build/phpmd.xml" />
<arg value="--reportfile" />
<arg value="${basedir}/build/logs/pmd.xml" />
<arg value="--exclude" />
<arg value="vendor" />
</exec>
</target>
<target name="phpcs-ci" description="Find coding standard violations using PHP_CodeSniffer">
<exec executable="${vendordir}/phpcs">
<arg value="--report-checkstyle=${basedir}/build/logs/checkstyle.xml" />
<arg value="--report-summary" />
<arg value="--standard=PSR2" />
<arg value="--ignore=*.min.*,*/vendor/*,*/PublicAPI/rtfm/*,*/Public/js/*" />
<arg value="--exclude=Squiz.Classes.ValidClassName,PSR1.Files.SideEffects" />
<arg path="${basedir}/src" />
<arg value="-p" />
</exec>
</target>
<target name="eslint-ci" description="Lint JS with ESLint">
<exec executable="eslint"> <!-- On system, not composer -->
<arg value="--config=${basedir}/.eslintrc.json" />
<arg value="--ignore-path=${basedir}/.eslintignore" />
<arg value="--format=checkstyle" />
<arg value="--output-file=${basedir}/build/logs/eslint.xml" />
<arg path="${basedir}/src/Public/js" />
</exec>
</target>
<target name="phpdox" description="Generate API documentation using phpDox">
<exec executable="${vendordir}/phpdox" />
</target>
<!--
<target name="phpunit" description="Run unit tests with PHPUnit">
<exec executable="${vendordir}/phpunit" failonerror="true"/>
</target>
-->
</project>