-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
157 lines (142 loc) · 5.88 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?xml version="1.0" encoding="UTF-8"?>
<project name="Pagamanger" default="help">
<fileset id="php-sources" dir=".">
<include name="admin.php"/>
<include name="classes/*.php"/>
</fileset>
<target name="help" description="lists available targets">
<exec executable="phing" passthru="true">
<arg value="-l"/>
</exec>
</target>
<target name="sniff" description="checks adherence to coding standards">
<exec executable="phpcs" passthru="true" checkreturn="true">
<arg value="--standard=PSR2"/>
<arg line="--runtime-set ignore_warnings_on_exit true"/>
<arg file="admin.php"/>
<arg file="classes"/>
<arg file="tests/unit"/>
<arg file="tests/attack"/>
</exec>
</target>
<target name="stan" description="run static analysis">
<exec executable="phpstan" passthru="true" checkreturn="true">
<arg value="--ansi"/>
<arg value="analyze"/>
</exec>
</target>
<target name="mess" description="detects code flaws">
<exec executable="phpmd" passthru="true" checkreturn="true">
<arg line="admin.php,classes ansi codesize,unusedcode"/>
</exec>
</target>
<target name="compat"
description="checks compatibility with PHP_CompatInfo">
<exec executable="phpcompatinfo" passthru="true" checkreturn="true">
<arg value="analyser:run"/>
<arg value="classes"/>
</exec>
</target>
<target name="unit-tests" description="runs all unit tests">
<exec executable="phpunit" passthru="true" checkreturn="true">
<arg value="--bootstrap"/>
<arg file="tests/unit/bootstrap.php"/>
<arg file="tests/unit"/>
</exec>
</target>
<target name="attack-tests" description="runs all attack tests">
<fail unless="env.CMSIMPLEDIR" message="CMSIMPLEDIR undefined!"/>
<exec executable="phpunit" passthru="true" checkreturn="true">
<arg file="tests/attack"/>
</exec>
</target>
<target name="all-tests" depends="unit-tests,attack-tests"
description="runs all tests"/>
<target name="coverage" description="generates coverage report">
<exec executable="phpunit" passthru="true" checkreturn="true">
<arg line="--configuration coverage.xml"/>
</exec>
</target>
<target name="gen-help" description="builds help.htm from README.md">
<exec executable="pandoc" passthru="true" checkreturn="true">
<arg value="-s"/>
<arg value="--eol=lf"/>
<arg value="--template=help/template.htm"/>
<arg value="-Vlang=en"/>
<arg line="-Vpagetitle="User Manual""/>
<arg value="-o"/>
<arg file="help/help.htm"/>
<arg file="README.md"/>
<arg line="-t html"/>
</exec>
<exec executable="pandoc" passthru="true" checkreturn="true">
<arg value="-s"/>
<arg value="--eol=lf"/>
<arg value="--template=help/template.htm"/>
<arg value="-Vlang=de"/>
<arg line="-Vpagetitle="Benutzerhandbuch""/>
<arg value="-o"/>
<arg file="help/help_de.htm"/>
<arg file="README_DE.md"/>
<arg line="-t html"/>
</exec>
</target>
<target name="build" description="builds distributable ZIP archive">
<exec executable="git" passthru="true" checkreturn="true">
<arg value="archive"/>
<arg value="-o"/>
<arg file="export.zip"/>
<arg value="HEAD"/>
</exec>
<unzip file="export.zip" todir="export"/>
<delete file="export.zip"/>
<exec executable="uglifyjs" checkreturn="true">
<arg file="export/pagemanager.js"/>
<arg value="--compress"/>
<arg value="--mangle"/>
<arg value="--output"/>
<arg file="export/pagemanager.js"/>
</exec>
<move todir="dist">
<fileset dir="export">
<exclude name=".github/**"/>
<exclude name="build.xml"/>
<exclude name="composer.*"/>
<exclude name="coverage.xml"/>
<exclude name="help/template.htm"/>
<exclude name="phpcompatinfo.*"/>
<exclude name="phpstan*.*"/>
<exclude name="README*.md"/>
<exclude name="teplad.xml"/>
<exclude name="tests/**"/>
</fileset>
</move>
<delete dir="export"/>
<copy file="dist/config/config.php" tofile="dist/config/defaultconfig.php"/>
<copy file="dist/languages/en.php" tofile="dist/languages/default.php"/>
<zip destfile="Pagemanager_XH-3.8-dev.zip" basedir="dist" prefix="pagemanager/"/>
<delete dir="dist"/>
</target>
<target name="build-patch" description="builds a distributable update package">
<fail unless="patchee" message="patchee is not defined!"/>
<unzip file="Pagemanager_XH-3.8-dev.zip" todir="current"/>
<unzip file="${patchee}" todir="patchee"/>
<copy todir="dist" includeemptydirs="false">
<fileset dir="current">
<different targetdir="patchee" ignoreFileTimes="true"/>
</fileset>
</copy>
<delete>
<fileset dir="dist/pagemanager">
<include name="config/config.php"/>
<include name="languages/??.php"/>
<include name="css/stylesheet.css"/>
</fileset>
</delete>
<zip destfile="Pagemanager_XH-3.8-dev-update-from-.zip" basedir="dist"
includeemptydirs="false"/>
<delete dir="patchee" quiet="true"/>
<delete dir="current" quiet="true"/>
<delete dir="dist" quiet="true"/>
</target>
</project>