-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
70 lines (56 loc) · 3.09 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Mumsys library" default="options">
<property name="bindir" value="${project.basedir}/vendor/bin/" override="false" />
<target name="options" description="Options for phing">
<echo msg="Option for phing required: test|check|coverage|api|gitstats|all" />
</target>
<target name="test" description="Executes the unit tests">
<echo msg="Executing unit tests" />
<delete file="tests/phing-unittest.log" quiet="true" failonerror="false" />
<exec command="./runTests.sh" dir="tests" checkreturn="true" logoutput="true"/>
</target>
<target name="coverage" description="Executes the unit tests and generates the code coverage">
<echo msg="Generating code coverage report" />
<delete file="tests/phing-unittest.log" quiet="true" failonerror="false" />
<delete dir="docs/CodeCoverage" quiet="true" failonerror="false" />
<exec command="./runTestsCoverageCreate.sh" dir="tests" checkreturn="true" logoutput="true" />
</target>
<target name="api" description="Generates the API">
<echo msg="Generating the API" />
<exec command="./runApiCreate.sh" dir="tests" checkreturn="true" logoutput="true" />
</target>
<target name="gitstats" description="Generates git statistics">
<echo msg="Generating git statistics" />
<exec command="gitstats . docs/GitStats" dir="./" checkreturn="true" logoutput="true" />
</target>
<target name="check" description="Executes the coding style sniffer">
<echo msg="Executing the coding style sniffer" />
<exec command="./runCSCheck.sh -n ../src ./src bootstrap.php MumsysTestHelper.php"
dir="tests" checkreturn="true" logoutput="true"
/>
</target>
<target name="sca" description="Executes the static code analysis (sca) (low level here)">
<echo msg="Executing the static code analysis sniffer" />
<exec command="./runStaticCodeAnalysis.sh ../src/" dir="tests" checkreturn="true" logoutput="true" />
</target>
<target name="all" depends="check,coverage,api" description="Execute all main parts of the package (check,coverage,api)">
</target>
<!-- travis-ci service see also .travis-ci.yml file -->
<target name="travis" description="Run check,coverage,api on travis-ci">
<if>
<equals arg1="${env.USER}" arg2="travis" />
<then>
<!-- Externals first -->
<!-- <phing target="travis" haltonfailure="true" dir="${coredir}/some/path" /> -->
<echo msg="Copy configs" />
<copy file=".env-dist" tofile=".env"/>
<copy file="tests/config/default.php-dist" tofile="tests/config/default.php"/>
<copy file="tests/config/credentials.php-dist" tofile="tests/config/credentials.php"/>
</then>
<else>
<echo msg="Only the user travis should call the travis task!" />
<fail message="Only the user travis should call the travis task!" />
</else>
</if>
</target>
</project>