-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·68 lines (58 loc) · 2.49 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="build" name="moveittest">
<target depends="prepare,lint,composer,phpunit,phpcs,phpcs-sast" name="build"/>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build/doc"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/code-browser"/>
</target>
<target depends="clean" description="Prepare for build" name="prepare">
<mkdir dir="${basedir}/build/doc"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/code-browser"/>
</target>
<target description="Perform syntax check of sourcecode files" name="lint">
<apply executable="php" failonerror="true">
<arg value="-l"/>
<fileset dir="${basedir}/src">
<include name="**/*.php"/>
<exclude name="vendor/"/>
<modified/>
</fileset>
</apply>
</target>
<target description="Installing dependencies" name="composer">
<exec executable="wget" failonerror="true">
<!--<arg value="-nc"/>-->
<arg value="https://getcomposer.org/composer.phar"/>
<arg value="-O"/>
<arg value="composer.phar"/>
</exec>
<exec executable="php" failonerror="true">
<arg value="composer.phar"/>
<arg value="install"/>
<arg value="--prefer-dist"/>
<arg value="--no-progress"/>
</exec>
</target>
<target description="Run unit tests with PHPUnit" name="phpunit">
<exec dir="./t" executable="./run_tests.sh" failonerror="true">
</exec>
</target>
<target description="Find coding standard violations using PHP_CodeSniffer and create log file." name="phpcs">
<exec executable="vendor/bin/phpcs">
<arg value="--standard=PSR2" />
<!--<arg value="\-\report=checkstyle" />-->
<!--<arg value="\-\-report-file=${basedir}/build/logs/phpcs.xml" />-->
<arg path="${basedir}/src" />
</exec>
</target>
<target description="SAST security checks." name="phpcs-sast">
<exec executable="vendor/bin/phpcs">
<arg value="--standard=vendor/pheromone/phpcs-security-audit/example_base_ruleset.xml" />
<arg path="${basedir}/src" />
</exec>
</target>
</project>