-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.xml
More file actions
78 lines (71 loc) · 2.72 KB
/
build.xml
File metadata and controls
78 lines (71 loc) · 2.72 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="php-stratum" default="build" basedir=".">
<taskdef name="ReadSemanticVersion" classname="\SetBased\Phing\Task\ReadSemanticVersionTask"/>
<property name="VERSION" value="0.0.0"/>
<!-- Run composer update and executes various other updates -->
<target name="update">
<exec executable="composer" checkreturn="true" passthru="true">
<arg value="--ansi"/>
<arg value="update"/>
</exec>
<phing phingfile="build.xml" target="outdated" haltonfailure="true"/>
</target>
<!-- Show outdated packages -->
<target name="outdated">
<exec executable="composer" checkreturn="false" passthru="true">
<arg value="--ansi"/>
<arg value="outdated"/>
<arg value="--direct"/>
</exec>
</target>
<!-- Runs code inspection -->
<target name="inspection">
<exec executable="bin/phpstan" checkreturn="true" passthru="true">
<arg value="--ansi"/>
<arg value="analyse"/>
<arg value="src"/>
<arg value="--level=8"/>
</exec>
</target>
<!-- Runs all unit tests -->
<target name="unit">
<exec executable="bin/phpunit" passthru="true" checkreturn="true"/>
</target>
<!-- Creates a new version/release. -->
<target name="version">
<ReadSemanticVersion file=".version"
versionProperty="VERSION"
haltOnError="true"/>
<!-- Set version of application. -->
<reflexive>
<fileset dir=".">
<include name="src/Application/Stratum.php"/>
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="parent::__construct\('stratum', .*"
replace="parent::__construct('stratum', '${VERSION}');"/>
</replaceregexp>
</filterchain>
</reflexive>
<exec executable="git" checkreturn="true" passthru="true">
<arg value="commit"/>
<arg value="-a"/>
<arg value="-m"/>
<arg value="Release: ${VERSION}"/>
</exec>
<exec executable="git" checkreturn="true" passthru="true">
<arg value="push"/>
</exec>
<exec executable="git" checkreturn="true" passthru="true">
<arg value="tag"/>
<arg value="${VERSION}"/>
</exec>
<exec executable="git" checkreturn="true" passthru="true">
<arg value="push"/>
<arg value="origin"/>
<arg value="${VERSION}"/>
</exec>
</target>
<target name="build" depends="update,inspection,unit"/>
</project>