-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
80 lines (70 loc) · 2.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Polyglot" default="help">
<target name="help" description="lists available targets">
<exec executable="phing" outputProperty="help">
<arg value="-l"/>
</exec>
<echo>${help}</echo>
</target>
<target name="sniff" description="checks adherence to coding standards">
<exec executable="phpcs" passthru="true" checkreturn="true">
<arg line="--standard=PSR2 --runtime-set ignore_warnings_on_exit true classes admin.php index.php polyglot_view.php"/>
</exec>
</target>
<target name="stan" description="runs static analyzer">
<exec executable="phpstan" passthru="true" checkreturn="true"/>
</target>
<target name="test" description="runs all developer tests">
<exec executable="phpunit" passthru="true" checkreturn="true"/>
</target>
<target name="coverage" description="generates coverage report">
<exec executable="phpunit" passthru="true" checkreturn="true">
<arg value="--coverage-html"/>
<arg file="coverage"/>
</exec>
</target>
<target name="sat" description="runs all checks" depends="sniff,stan,test"/>
<target name="gen-help" description="builds help.htm from README.md">
<exec executable="pandoc" passthru="true" checkreturn="true">
<arg line="-s --eol=lf --template=help/template.htm -Vlang=en -Vpagetitle="User Manual" -o help/help.htm README.md -t html"/>
</exec>
<exec executable="pandoc" passthru="true" checkreturn="true">
<arg line="-s --eol=lf --template=help/template.htm -Vlang=de -Vpagetitle="Benutzerhandbuch" -o help/help_de.htm README_de.md -t html"/>
</exec>
</target>
<target name="build" description="builds distributable ZIP archive">
<exec executable="git" passthru="true" checkreturn="true">
<arg line="archive -o export.zip HEAD"/>
</exec>
<unzip file="export.zip" todir="export"/>
<delete file="export.zip"/>
<move todir="dist">
<fileset dir="export">
<include name="views/*.php"/>
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="<\?(?!=)" replace="<?php "/>
</replaceregexp>
</filterchain>
</move>
<move todir="dist">
<fileset dir="export">
<exclude name=".github/**"/>
<exclude name=".phive/**"/>
<exclude name="tests/**"/>
<exclude name="README*.md"/>
<exclude name="build.xml"/>
<exclude name="composer.*"/>
<exclude name="phpstan.*"/>
<exclude name="phpunit.xml"/>
<exclude name="teplad.xml"/>
</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="Polyglot_XH-1.0.zip" basedir="dist" prefix="polyglot/"/>
<delete dir="dist"/>
</target>
</project>