-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.xml
133 lines (111 loc) · 4.42 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
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project name="site" default="docs" basedir=".">
<!-- Initialization properties -->
<property name="project.name" value="site"/>
<!-- The source directory for our XML source documents which are
to be sytlized and transformed into XHTML. -->
<property name="docs.src" value="xdocs"/>
<!-- The destination directory for content generated from our XML
sources. -->
<property name="docs.dest" value="docs"/>
<property name="texen.work" value="target/texen"/>
<property name="texen.src" value="xdocs/stylesheets/texen"/>
<path id="classpath">
<fileset dir="./lib">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="prepare-texen">
<available classname="org.apache.velocity.texen.ant.TexenTask"
property="TexenTask.present">
<classpath refid="classpath"/>
</available>
</target>
<target depends="prepare-texen" name="prepare-error-texen" unless="TexenTask.present">
<echo>
TexenTask is not present! Please check to make sure that
velocity.jar is in your classpath.
</echo>
</target>
<target name="prepare">
<available classname="org.apache.velocity.anakia.AnakiaTask" property="AnakiaTask.present">
<classpath refid="classpath"/>
</available>
</target>
<target depends="prepare" name="prepare-error" unless="AnakiaTask.present">
<echo>
AnakiaTask is not present! Please check to make sure that
velocity.jar is in your classpath.
</echo>
</target>
<target name="docs" depends="prepare-error" if="AnakiaTask.present">
<taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask">
<classpath refid="classpath"/>
</taskdef>
<property name="anakia.check.date" value="true"/>
<anakia basedir="${docs.src}" destdir="${docs.dest}/"
extension=".html" style="./site.vsl"
projectFile="stylesheets/project.xml"
excludes="**/stylesheets/**,**/_template.xml"
includes="**/*.xml"
lastModifiedCheck="${anakia.check.date}"
templatePath="${docs.src}/stylesheets"
velocityPropertiesFile="build.props"
>
</anakia>
<copy todir="${docs.dest}/" filtering="no">
<fileset dir="${docs.src}/">
<!--
Ignore the Anakia style sheet used for processing
of the xdocs, and the unprocessed xdocs themselves,
but copy all other content to the directory which is
checked out on the server.
-->
<exclude name="**/*.xml"/>
<exclude name="**/stylesheets/**"/>
<!-- Editor-specific ignores. -->
<exclude name="**/*~"/>
<exclude name="**/.#*"/>
</fileset>
</copy>
<echo level="info">
The build process only rebuilds html files that are older than the corresponding xml file.
If a file is not updated, and you think it should be, try deleting the html file and rebuilding.
Or rebuild with the property: -Danakia.check.date=false
</echo>
<antcall target="FixCRLF"></antcall>
</target>
<target name="checkOS">
<condition property="os.windows">
<os family="windows"/>
</condition>
</target>
<!--
Anakia seems to get confused about line-endings in some html files on Windows.
This target can be used to restore the line endings.
-->
<target name="FixCRLF" description="Fix the line endings of HTML files on Windows" depends="checkOS" if="os.windows">
<echo level="info" message="Updating CRLF endings"/>
<fixcrlf srcdir="${docs.dest}" includes="**/*.html"/>
</target>
<target name="clean-docs">
<delete includeEmptyDirs="true">
<fileset dir="${docs.dest}" excludes=".svn/**"/>
</delete>
</target>
</project>