-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.xml
150 lines (141 loc) · 5.59 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* $Id$
*
* Copyright (c) 2008-2011 Andreas Heigl<[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* This is the ant-buildfile
*
* @category Org_Heigl
* @package Org_Heigl_Hyphenator
* @author Andreas Heigl <[email protected]>
* @copyright 2008-2011 Andreas Heigl<[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT-License
* @version 2.0.1
* @since 24.11.2011
*/
-->
<project name="Org_Heigl_Hyphenator" default="build" basedir=".">
<!-- This target deletes all temporary files from the directory -->
<target name="clean">
<delete includeemptydirs="true">
<fileset dir="${basedir}/build">
<include name="**/*" />
</fileset>
</delete>
</target>
<target name="build"
depends="sniff, clean, parseDic, test, api, manual.rst, distribute" />
<target name="test">
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/phpunit"/>
<mkdir dir="${basedir}/build/phpunit/coverage"/>
<delete includeemptydirs="true" verbose="false">
<fileset dir="${basedir}/build/phpunit/coverage">
<include name="**/*" />
</fileset>
</delete>
<exec executable="phpunit" dir="${basedir}" failonerror="on"/>
<exec executable="${basedir}/tools/removeBasePath.sh" dir="${basedir}/build/phpunit/coverage" failonerror="true">
<arg line="${basedir}/src/"/>
</exec>
</target>
<target name="api">
<mkdir dir="${basedir}/build/api"/>
<exec executable="phpdoc" dir="${basedir}" failonerror="on"/>
</target>
<target name="distribute">
<buildnumber />
<property file="build.number" />
<mkdir dir="${basedir}/dist"/>
<exec executable="${basedir}/tools/createPackage" dir="${basedir}/src" failonerror="true">
<arg value="make"/>
</exec>
<exec executable="pear" dir="${basedir}/src">
<arg value="package"/>
</exec>
<move todir="${basedir}/dist">
<fileset dir="${basedir}/src">
<include name="**/*.tgz"/>
</fileset>
</move>
<delete file="${basedir}/src/package.xml"/>
<zip destfile="dist/Org_Heigl_Hyphenator-Build_${build.number}.zip">
<zipfileset dir="build/api" prefix="documentation/api" />
<zipfileset dir="build/doc" prefix="documentation/manual" />
<zipfileset dir="build/phpunit/coverage" prefix="documentation/coverage" />
<zipfileset dir="src/Org/Heigl/Hyphenator" prefix="library/Org/Heigl/Hyphenator"/>
<fileset dir="." includes="CHANGELOG" />
<fileset dir="." includes="LICENSE" />
<fileset dir="." includes="README" />
</zip>
<antcall target="clean"/>
</target>
<target name="manual">
<mkdir dir="${basedir}/build/doc"/>
<delete includeemptydirs="true" verbose="true">
<fileset dir="${basedir}/build/doc">
<include name="**/*" />
</fileset>
</delete>
<exec executable="xsltproc" dir="${basedir}">
<arg line="--output build/doc/index.html doc/hyphenator.xsl doc/main.xml "/>
</exec>
<copy todir="${basedir}/build/doc/">
<fileset dir="${basedir}/doc/inc/"/>
</copy>
</target>
<target name="manual.rst">
<mkdir dir="${basedir}/build/doc"/>
<delete includeemptydirs="true" verbose="true">
<fileset dir="${basedir}/build/doc">
<include name="**/*" />
</fileset>
</delete>
<exec executable="sphinx-build" dir="${basedir}/docs">
<arg value="-b"/>
<arg value="html"/>
<arg value="."/>
<arg value="${basedir}/build/doc"/>
</exec>
</target>
<!--
Check the code using phpcs using the heigl.org-Standard
-->
<target name="sniff">
<exec executable="phpcs" dir="${basedir}/src" failonerror="true">
<arg value="--standard=HeiglOrg"/>
<arg value="-n"/>
<arg value="-p"/>
<arg value="."/>
</exec>
</target>
<!--
Parse the hyphenation files and create the ini-files
-->
<target name="parseDic">
<exec executable="${basedir}/tools/renderDicts" dir="${basedir}/tools/" failonerror="true"/>
<exec executable="git" dir="${basedir}/src/Org/Heigl/Hyphenator/share/files/" failonerror="true">
<arg line="diff --quiet --exit-code ."/>
</exec>
</target>
</project>