This repository has been archived by the owner on Feb 4, 2018. It is now read-only.
forked from hairmare/PoscHP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
143 lines (130 loc) · 4.51 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?xml version="1.0"?>
<project name="rabe-busmaster" default="test">
<!--
Main Buildfile used by jenkins to interact with the system.
-->
<!-- -->
<target name="build">
<exec executable="sh">
<arg value="build/clean.sh"/>
</exec>
<!-- update Autoloader -->
<exec executable="php" failonerror="true" dir="src/">
<arg value="../build/update-autoloader.php"/>
<arg value="."/>
<arg value="Bootstrap.map.php"/>
</exec>
<exec executable="git" failonerror="false">
<arg value="commit"/>
<arg value="-m"/>
<arg value="regenerated autoloader map"/>
<arg value="src/Bootstrap.map.php"/>
</exec>
<!-- update services.xml -->
<exec executable="php" failonerror="true" dir="etc/">
<arg value="../build/update-dic-service.php"/>
<arg value="../src/"/>
<arg value="services.xml"/>
</exec>
<exec executable="xmllint" failonerror="true" output="etc/services.xml.format" logError="true">
<arg value="--format"/>
<arg value="etc/services.xml"/>
</exec>
<exec executable="mv" failonerror="true">
<arg value="etc/services.xml.format"/>
<arg value="etc/services.xml"/>
</exec>
<exec executable="git" failonerror="false">
<arg value="commit"/>
<arg value="-m"/>
<arg value="autoupdated services.xml"/>
<arg value="etc/services.xml"/>
</exec>
<!-- update Bootstrap.dic.php -->
<exec executable="php" failonerror="true">
<arg value="./build/update-dic.php"/>
</exec>
<exec executable="git" failonerror="false">
<arg value="commit"/>
<arg value="-m"/>
<arg value="autogenerated dic"/>
<arg value="src/Bootstrap.dic.php"/>
</exec>
</target>
<!--
-->
<target name="test">
<exec executable="phpcs">
<arg value="-s"/> <!-- Show sniff codes in all reports -->
<arg value="--standard=PEAR"/>
<arg value="--ignore=README.md"/>
<arg value="--report=checkstyle"/>
<arg value="--report-file=build/checkstyle.xml"/>
<!-- dirs to scan -->
<arg value="src/"/>
<arg value="test/"/>
</exec>
<exec executable="phpmd">
<!-- dirs to scan -->
<arg value="src,test"/>
<arg value="xml"/>
<arg value="codesize,design,naming,unusedcode"/>
<arg value="--reportfile"/>
<arg value="build/pmd.xml"/>
</exec>
<exec dir="${basedir}" executable="phpunit">
<arg value="-c"/>
<arg value="phpunit.xml"/>
<!-- doesnt work from xml for some reason -->
<arg value="--log-junit"/>
<arg value="junit.xml"/>
</exec>
<exec executable="mv"> <!-- lol wut, I'll try removing this later -->
<arg value="junit.xml"/>
<arg value="build/junit.xml"/>
</exec>
</target>
<!--
-->
<target name="docs">
</target>
<!--
-->
<target name="deploy-local">
</target>
<!--
Deploy to webhost dir
This is used for building further packages that get deployed
everywhere else
-->
<target name="deploy-web">
<exec executable="cat" outputproperty="version">
<arg value="VERSION"/>
</exec>
<exec executable="cp" failonerror="true">
<arg value="build/rabe-busmaster-${version}.tar.bz2"/>
<arg value="/var/www/distfile-repo.jenkins-01.hq.rabe.ch/htdocs/"/>
</exec>
</target>
<target name="pkg">
<exec executable="cat" outputproperty="version">
<arg value="VERSION"/>
</exec>
<tar destfile="build/rabe-busmaster-${version}.tar.bz2"
basedir="." compression="bzip2"
excludes="build/**,**/services.xml"/>
</target>
<target name="bump-version">
<exec executable="awk" failonerror="true" output="VERSION">
<arg value="-F." />
<arg value='1{$NF+=1; OFS="."; print $0}'/>
<arg value="VERSION"/>
</exec>
<exec executable="git" failonerror="true">
<arg value="commit"/>
<arg value="-m"/>
<arg value="version bump"/>
<arg value="VERSION"/>
</exec>
</target>
</project>