forked from mantisbt/mantisbt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
105 lines (89 loc) · 3.1 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="MantisBT" default="test">
<fileset dir="." id="fileset.deploy.id">
<!-- directories which should not be deployed -->
<exclude name="build/**"/>
<exclude name="doc/**"/>
<exclude name="docbook/**"/>
<exclude name="packages/**"/>
<exclude name="phing/**"/>
<exclude name="tests/**"/>
<!-- customisations and IDE settings -->
<exclude name="config_inc.php"/>
<exclude name="custom_constant_inc.php"/>
<exclude name="custom_strings_inc.php"/>
<exclude name="custom_functions_inc.php"/>
<exclude name="mantis_offline.php"/>
<exclude name="web.config"/>
<exclude name=".*"/>
<exclude name=".settings/**"/>
<!-- git repo -->
<exclude name=".git/**"/>
<!-- build file -->
<exclude name="phing.xml"/>
</fileset>
<includepath classpath="phing/tasks"/>
<taskdef name="extractMantisBTVersion" classname="mantisbt.ExtractMantisBTVersion"/>
<target name="init">
<mkdir dir="build"/>
</target>
<target name="test" depends="init">
<mkdir dir="build/test"/>
<phpunit printsummary="true" bootstrap="tests/bootstrap.php">
<formatter usefile="false" type="plain"/>
<formatter todir="build/test" type="xml"/>
<batchtest classpath="tests:core:core/classes:library">
<fileset dir="tests">
<include name="**/*Test.php"/>
</fileset>
</batchtest>
</phpunit>
</target>
<!-- requires a 512M memory limit to complete -->
<target name="phpdoc" depends="init">
<mkdir dir="build/phpdoc"/>
<phpdoc title="MantisBT API Docs" sourcecode="yes" destdir="build/phpdoc"
output="HTML:Smarty:PHP">
<fileset dir=".">
<include name="core/**/*.php" />
<include name="plugins/**/*.php" />
<include name="api/**/*.php" />
</fileset>
</phpdoc>
</target>
<target name="package" depends="init">
<extractMantisBTVersion file="core/constant_inc.php"/>
<!-- build tar gz file -->
<phingcall target="-package">
<property name="package.extension" value="tar.gz"/>
<property name="package.compression" value="gzip"/>
</phingcall>
<!-- build zip file -->
<phingcall target="-package">
<property name="package.extension" value="zip"/>
<property name="package.compression" value="zip"/>
</phingcall>
</target>
<target name="-package">
<if>
<equals arg1="${package.compression}" arg2="zip"/>
<then>
<zip destfile="build/mantisbt-${mantisbtversion}.${package.extension}">
<fileset refid="fileset.deploy.id"/>
</zip>
</then>
<else>
<tar destfile="build/mantisbt-${mantisbtversion}.${package.extension}" compression="${package.compression}">
<fileset refid="fileset.deploy.id"/>
</tar>
</else>
</if>
<filehash file="build/mantisbt-${mantisbtversion}.${package.extension}" hashtype="1" />
<echo file="build/mantisbt-${mantisbtversion}.${package.extension}.sha1" msg="${filehashvalue}"/>
<filehash file="build/mantisbt-${mantisbtversion}.${package.extension}" hashtype="0" />
<echo file="build/mantisbt-${mantisbtversion}.${package.extension}.md5" msg="${filehashvalue}"/>
</target>
<target name="clean">
<delete dir="build"/>
</target>
</project>