-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
84 lines (72 loc) · 3.28 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Tablesorter" default="help">
<fileset id="php-sources" dir=".">
<include name="index.php"/>
<include name="classes/*.php"/>
</fileset>
<fileset id="unit-tests" dir="tests/unit">
<include name="*Test.php"/>
</fileset>
<target name="help" description="lists available targets">
<exec command="phing -l" outputProperty="help"/>
<echo>${help}</echo>
</target>
<target name="sniff" description="checks adherence to coding standard">
<phpcodesniffer standard="PSR2">
<fileset refid="php-sources"/>
<fileset refid="unit-tests"/>
</phpcodesniffer>
</target>
<target name="mess" description="detects code flaws">
<phpmd rulesets="unusedcode">
<fileset refid="php-sources"/>
</phpmd>
</target>
<target name="compat" description="checks PHP requirements">
<exec command="phpcompatinfo analyser:run --alias current" logoutput="true"/>
</target>
<target name="unit-tests" description="runs all unit tests">
<phpunit haltonerror="true" haltonfailure="true">
<formatter type="plain" usefile="false"/>
<batchtest>
<fileset refid="unit-tests"/>
</batchtest>
</phpunit>
</target>
<target name="coverage" description="generates coverage report">
<exec command="phpdbg -qrr vendor/phpunit/phpunit/phpunit --configuration coverage.xml" logoutput="true"/>
</target>
<target name="gen-help" description="builds help.htm from README.md">
<exec command="pandoc -s --eol=lf --template=help/template.htm -Vlang=en -Vpagetitle="User Manual" -o help/help.htm README.md -t html" logoutput="true"/>
<exec command="pandoc -s --eol=lf --template=help/template.htm -Vlang=de -Vpagetitle="Benutzerhandbuch" -o help/help_de.htm README_DE.md -t html" logoutput="true"/>
</target>
<target name="build" description="builds a distributable ZIP archive">
<fail unless="version" message="version is not defined!"/>
<exec command="git archive -o export.zip HEAD" checkreturn="true"/>
<unzip file="export.zip" todir="export"/>
<delete file="export.zip"/>
<jsMin targetDir="dist" suffix="" failOnError="false">
<fileset dir="export">
<include name="*.min.js"/>
</fileset>
</jsMin>
<move todir="dist">
<fileset dir="export">
<exclude name="build.xml"/>
<exclude name="composer.*"/>
<exclude name="coverage.xml"/>
<exclude name="demo/**"/>
<exclude name="help/template.htm"/>
<exclude name="pax_global_header"/>
<exclude name="phpcompatinfo.*"/>
<exclude name="README*.md"/>
<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="Tablesorter_XH-${version}.zip" basedir="dist" prefix="tablesorter/"/>
<delete dir="dist"/>
</target>
</project>