This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 283
/
build.xml
89 lines (78 loc) · 3.15 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
<project name="Kimai" default="help">
<!-- values depending on the Kimai version and your development environment -->
<property name="release.version" value="1.3.5"/>
<property name="release.directory" location="/tmp/kimai/"/>
<!-- default target just dumps a copyright notice -->
<target name="help" description="Show help">
<echo>
Build file for Kimai - Open Source Time Tracking
Copyright (C) Kimai Team since 2006
See https://www.kimai.org/ for further informations
Distributed under the terms of the GPL v3
</echo>
</target>
<!-- Name and location of the release files -->
<property name="target.release.dir" location="${release.directory}/${release.version}/"/>
<property name="target.release.zip" location="${release.directory}/kimai_${release.version}.zip"/>
<!--
Creates a Kimai ZIP release by copying of required files and zipping everything afterwards.
-->
<target name="build" description="Creates a Kimai release ZIP archive">
<!-- cleanup release dir -->
<delete dir="${target.release.dir}"/>
<!-- create release directory -->
<mkdir dir="${target.release.dir}"/>
<!-- and copy all required files there -->
<copy todir="${target.release.dir}" includeemptydirs="true" overwrite="true">
<fileset dir=".">
<patternset id="always.exclude.files">
<exclude name=".project"/>
<exclude name=".git*"/>
<exclude name=".github/"/>
<exclude name=".travis*"/>
<exclude name=".scrutinizer.yml"/>
<exclude name=".styleci.yml"/>
<exclude name="composer.*"/>
<exclude name="phpunit.*"/>
<exclude name="kimai.json"/>
<exclude name="build.xml"/>
<exclude name="README.md"/>
<exclude name=".idea/"/>
<exclude name="includes/autoconf.php"/>
<exclude name="libraries/phpclasses/ultimatemysql/example*"/>
<exclude name="libraries/phpoffice/phpexcel/Examples/**"/>
<exclude name="libraries/phpoffice/phpexcel/unitTests/**"/>
<exclude name="libraries/symfony/yaml/Tests/**"/>
<exclude name="libraries/tecnickcom/tcpdf/examples/**"/>
<exclude name="temporary/"/>
<exclude name="tests/"/>
</patternset>
</fileset>
<fileset dir=".">
<patternset id="always.include.files">
<include name="temporary/.htaccess"/>
</patternset>
</fileset>
</copy>
<!-- deactivate debug extension -->
<move todir="${target.release.dir}/extensions/#ext_debug/">
<fileset dir="${target.release.dir}/extensions/ext_debug/"/>
</move>
<!-- empty status -->
<move file="${target.release.dir}/includes/version.php" tofile="${target.release.dir}/includes/version.php.modified">
<filterchain>
<tokenfilter>
<replaceregex pattern="(\$kga\['status'\] = \s*)\'[^\']+" replace="\1'" flags="i"/>
</tokenfilter>
</filterchain>
</move>
<move file="${target.release.dir}/includes/version.php.modified" tofile="${target.release.dir}/includes/version.php" />
<!-- create a ZIP file from all resources -->
<zip destfile="${target.release.zip}">
<fileset dir="${target.release.dir}"/>
</zip>
<!-- remove all temporary files -->
<delete dir="${target.release.dir}"/>
<echo>Created the release at: ${target.release.zip}</echo>
</target>
</project>