forked from cmb69/fa_xh
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
105 lines (96 loc) · 3.87 KB
/
build.xml
File metadata and controls
105 lines (96 loc) · 3.87 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
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Fa" default="help">
<fileset id="php-sources" dir=".">
<include name="index.php"/>
<include name="classes/*.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"/>
</phpcodesniffer>
</target>
<target name="mess" description="detects code flaws">
<phpmd>
<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="build" description="builds a distributable ZIP archive">
<fail unless="version" message="version is not defined!"/>
<exec command="git archive -o export.tar HEAD" checkreturn="true"/>
<untar file="export.tar" todir="export"/>
<delete file="export.tar"/>
<move todir="dist">
<fileset dir="export">
<include name="classes/Plugin.php"/>
<include name="version.nfo"/>
</fileset>
<filterchain>
<replacetokens>
<token key="FA_VERSION" value="${version}"/>
</replacetokens>
</filterchain>
</move>
<jsMin targetDir="dist" suffix="" failOnError="false">
<fileset dir="export">
<include name="**/*.min.js"/>
</fileset>
</jsMin>
<move todir="dist">
<fileset dir="export">
<include name="views/*.php"/>
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="\?=" replace="?php echo "/>
</replaceregexp>
</filterchain>
</move>
<move todir="dist">
<fileset dir="export">
<exclude name="build.xml"/>
<exclude name="composer.*"/>
<exclude name="pax_global_header"/>
<exclude name="README.md"/>
<exclude name="phpcompatinfo.*"/>
<exclude name="editors/ckeditor/convert.php"/>
<exclude name="editors/ckeditor/UPDATING.md"/>
<exclude name="editors/tinymce4/fontawesome/UPDATING.md"/>
</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="Fa_XH-${version}.zip" basedir="dist" prefix="fa/"/>
<delete dir="dist"/>
</target>
<target name="build-patch" description="builds a distributable update package">
<fail unless="patchee" message="patchee is not defined!"/>
<fail unless="version" message="version is not defined!"/>
<unzip file="Fa_XH-${version}.zip" todir="current"/>
<unzip file="${patchee}" todir="patchee"/>
<copy todir="dist">
<fileset dir="current">
<different targetdir="patchee" ignoreFileTimes="true"/>
</fileset>
</copy>
<delete>
<fileset dir="dist/fa">
<include name="config/config.php"/>
<include name="languages/??.php"/>
<include name="css/stylesheet.css"/>
</fileset>
</delete>
<zip destfile="Fa_XH-${version}-PATCH.zip" basedir="dist"
includeemptydirs="false"/>
<delete dir="patchee" quiet="true"/>
<delete dir="current" quiet="true"/>
<delete dir="dist" quiet="true"/>
</target>
</project>