-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.xml
159 lines (131 loc) · 4.47 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?xml version="1.0" encoding="utf-8"?>
<project name="phorkie" default="zip" basedir=".">
<!--
phorkie phing build file.
This script should provide a one-stop tool for all administrative
tasks around phorkie, like creating a release version,
tagging a release
-->
<property name="version" value="0.9.0" />
<property name="stability" value="beta" />
<property name="libdir" value="${phing.dir}/lib"/>
<property name="zipfile" value="${phing.project.name}-${version}.tar.bz2" />
<property name="pharfile" value="${phing.project.name}-${version}.phar" />
<property name="pharpath" value="${phing.dir}/dist/${pharfile}" />
<property name="distfile" value="dist/${zipfile}" />
<fileset id="fs.zip" dir=".">
<include name="data/**"/>
<include name="scripts/**"/>
<include name="src/**"/>
<include name="www/**"/>
<include name="ChangeLog"/>
<include name="LICENSE"/>
<include name="NEWS.rst"/>
<include name="README.rst"/>
<exclude name="**/.git/"/>
<exclude name="**/.gitignore/"/>
<exclude name="data/cache/**"/>
<exclude name="data/config.php"/>
<exclude name="www/**/.phar"/>
<exclude name="www/repos"/>
</fileset>
<fileset id="fs.phar" dir="${phing.dir}">
<include name="data/**"/>
<include name="lib/**"/>
<include name="scripts/**"/>
<include name="src/**"/>
<include name="www/**"/>
<include name="ChangeLog"/>
<include name="README.rst"/>
<exclude name="**/.git/"/>
<exclude name="**/.gitignore/"/>
<exclude name="data/cache/**"/>
<exclude name="data/config.php"/>
<exclude name="www/**/.phar"/>
<exclude name="www/repos/**"/>
<exclude name="lib/*/*/.github/**"/>
<exclude name="lib/*/*/doc/**"/>
<exclude name="lib/*/*/docs/**"/>
<exclude name="lib/*/*/examples/**"/>
<exclude name="lib/*/*/test/**"/>
<exclude name="lib/*/*/tests/**"/>
<exclude name="lib/*/*/.editorconfig"/>
<exclude name="lib/*/*/.travis.yml"/>
<exclude name="lib/*/*/build.properties*"/>
<exclude name="lib/*/*/build.xml"/>
<exclude name="lib/*/*/BUGS"/>
<exclude name="lib/*/*/CHANGELOG"/>
<exclude name="lib/*/*/LICENSE"/>
<exclude name="lib/*/*/README*"/>
<exclude name="lib/*/*/package.xml"/>
<exclude name="lib/*/*/phpunit.xml*"/>
<exclude name="lib/*/*/TODO"/>
</fileset>
<fileset id="fs.doc" dir=".">
<include name="README.rst"/>
<include name="NEWS.rst"/>
</fileset>
<target name="phar" depends="preparedirs,collectdeps"
description="Create phar file for release"
>
<delete file="${pharpath}"/>
<exec command="php scripts/build-rewritemap.php" dir="${phing.dir}"/>
<pharpackage basedir="${phing.dir}"
destfile="${pharpath}"
stub="${phing.dir}/src/stub-phar.php"
alias="phorkie.phar"
>
<fileset refid="fs.phar"/>
</pharpackage>
<exec executable="bzip2" dir="${phing.dir}/dist">
<arg value="-kf"/>
<arg file="${pharpath}"/>
</exec>
</target>
<target name="collectdeps" description="Copy package dependencies to lib/">
<delete dir="${libdir}"/>
<mkdir dir="${libdir}"/>
<exec executable="composer">
<arg value="install"/>
<arg value="--no-dev"/>
</exec>
</target>
<target name="zip" depends="preparedirs"
description="Create zip file for release"
>
<!--
The release file is for end users, so it is safe to
remove anything developer-related.
Test your zip with: unzip -l phorkie-0.1.0.zip
-->
<echo msg="Creating distribution zip for phorkie ${version}"/>
<delete file="${distfile}" failonerror="false"/>
<tar compression="bzip2" destfile="${distfile}"
prefix="${phing.project.name}-${version}/"
>
<fileset refid="fs.zip"/>
</tar>
</target>
<target name="docs" description="render documentation">
<rST format="html" uptodate="true">
<fileset refid="fs.doc"/>
<mapper type="regexp" from="^(.+?).rst$" to="dist/docs/\1.html"/>
</rST>
</target>
<target name="clean-docs" description="delete rendered documentation files">
<delete dir="dist/docs" includeemptydirs="yes"/>
</target>
<target name="release" depends="check,phar,zip"
description="Package the new version"
>
<!-- meta-target -->
</target>
<target name="preparedirs">
<mkdir dir="dist" />
</target>
<target name="check" depends="preparedirs"
description="Check variables"
>
<fail unless="version" message="Version not defined!" />
</target>
</project>