| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 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 |
<project name="defguide" default="html"> |
| 27 |
|
| 28 |
<property file="build.properties"/> |
| 29 |
|
| 30 |
<path id="lib.classpath"> |
| 31 |
<fileset dir="${ant.home}/lib"> |
| 32 |
<include name="*.jar"/> |
| 33 |
</fileset> |
| 34 |
<fileset dir="${fop.home}"> |
| 35 |
<include name="**/*.jar"/> |
| 36 |
</fileset> |
| 37 |
<fileset dir="${usr.share.java}"> |
| 38 |
<include name="**/*.jar"/> |
| 39 |
</fileset> |
| 40 |
<pathelement location="${usr.share.java}"/> |
| 41 |
</path> |
| 42 |
|
| 43 |
<path id="xep.classpath"> |
| 44 |
<fileset dir="${xep.home}/lib"> |
| 45 |
<include name="*.jar"/> |
| 46 |
</fileset> |
| 47 |
</path> |
| 48 |
|
| 49 |
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask"/> |
| 50 |
|
| 51 |
<target name="usage"> |
| 52 |
<echo message="Use the -projecthelp option instead"/> |
| 53 |
</target> |
| 54 |
|
| 55 |
<target name="clean" description="Clean the build directory"> |
| 56 |
<delete dir="build"/> |
| 57 |
</target> |
| 58 |
|
| 59 |
<target name="init" description="Check runtime configuration"> |
| 60 |
<echo message="java.version: ${java.version}"/> |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
<fail> |
| 79 |
<condition> |
| 80 |
<not><available file="build.properties"/></not> |
| 81 |
</condition> |
| 82 |
Please create your build.properties from build.properties.tmpl ! |
| 83 |
</fail> |
| 84 |
|
| 85 |
<fail> |
| 86 |
<condition> |
| 87 |
<not><available classname="com.thaiopensource.relaxng.util.Driver"/></not> |
| 88 |
</condition> |
| 89 |
RELAX NG Support(jing) NOT Present ! |
| 90 |
</fail> |
| 91 |
|
| 92 |
<fail> |
| 93 |
<condition> |
| 94 |
<not><available classname="com.icl.saxon.StyleSheet" classpathref="lib.classpath"/></not> |
| 95 |
</condition> |
| 96 |
Saxon 6.5 Support NOT Present ! |
| 97 |
</fail> |
| 98 |
</target> |
| 99 |
|
| 100 |
<target name="validate" depends="init" description="Validate document"> |
| 101 |
<jing rngfile="${docbook5.home}/rng/docbook.rng" file="source/defguide.xml"/> |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
</target> |
| 106 |
|
| 107 |
<target name="all" description="Generate document - pdf,html"> |
| 108 |
<antcall target="defguide"/> |
| 109 |
<antcall target="pdf"/> |
| 110 |
<antcall target="html"/> |
| 111 |
</target> |
| 112 |
|
| 113 |
<target name="po.init"> |
| 114 |
<uptodate property="po.isUpToDate" targetfile="po/zh.po"> |
| 115 |
<srcfiles dir="source" includes="defguide.xml"/> |
| 116 |
</uptodate> |
| 117 |
</target> |
| 118 |
|
| 119 |
|
| 120 |
<target name="updatepo" depends="po.init" unless="po.isUpToDate" description="Update PO file"> |
| 121 |
<echo message="Making defguide.pot ..."/> |
| 122 |
<exec dir="${basedir}/po" executable="python" failonerror="true"> |
| 123 |
<arg value="../xml2po/xml2po.py"/> |
| 124 |
<arg value="-o"/> |
| 125 |
<arg value="defguide.pot"/> |
| 126 |
<arg value="../source/defguide.xml"/> |
| 127 |
</exec> |
| 128 |
|
| 129 |
<echo message="Merging zh.po ..."/> |
| 130 |
<exec dir="${basedir}" executable="msgmerge"> |
| 131 |
<arg value="--sort-by-file"/> |
| 132 |
<arg value="--width=80"/> |
| 133 |
<arg value="-o"/> |
| 134 |
<arg value="po/zh.po.new"/> |
| 135 |
<arg value="po/zh.po"/> |
| 136 |
<arg value="po/defguide.pot"/> |
| 137 |
</exec> |
| 138 |
<move file="po/zh.po.new" tofile="po/zh.po"/> |
| 139 |
</target> |
| 140 |
|
| 141 |
<target name="translate.init" depends="updatepo"> |
| 142 |
<uptodate property="translate.isUpToDate" targetfile="build/defguide-zh.xml"> |
| 143 |
<srcfiles dir="source" includes="defguide.xml"/> |
| 144 |
<srcfiles dir="po" includes="zh.po"/> |
| 145 |
</uptodate> |
| 146 |
</target> |
| 147 |
|
| 148 |
|
| 149 |
<target name="translate" depends="translate.init" unless="translate.isUpToDate" |
| 150 |
description="Translate document"> |
| 151 |
<mkdir dir="build"/> |
| 152 |
<echo message="Translating defguide-zh.xml ..."/> |
| 153 |
<exec dir="${basedir}/xml2po" executable="python" failonerror="true"> |
| 154 |
<arg value="xml2po.py"/> |
| 155 |
<arg value="-l"/> |
| 156 |
<arg value="zh-cn"/> |
| 157 |
<arg value="-p"/> |
| 158 |
<arg value="../po/zh.po"/> |
| 159 |
<arg value="-o"/> |
| 160 |
<arg value="../build/defguide-zh.xml"/> |
| 161 |
<arg value="../source/defguide.xml"/> |
| 162 |
</exec> |
| 163 |
<delete file="xml2po/.xml2po.mo"/> |
| 164 |
</target> |
| 165 |
|
| 166 |
<target name="html.init"> |
| 167 |
<uptodate property="html.isUpToDate" targetfile="build/html/.done"> |
| 168 |
<srcfiles dir="source" includes="defguide.xml"/> |
| 169 |
<srcfiles dir="po" includes="zh.po"/> |
| 170 |
<srcfiles dir="stylesheets" includes="html.xsl"/> |
| 171 |
<srcfiles dir="stylesheets/zh" includes="html.xsl"/> |
| 172 |
</uptodate> |
| 173 |
</target> |
| 174 |
|
| 175 |
|
| 176 |
<target name="html" depends="init,translate,html.init" unless="html.isUpToDate" |
| 177 |
description="Generate document - html"> |
| 178 |
<copy todir="build/schema"> |
| 179 |
<fileset dir="source/schema"/> |
| 180 |
</copy> |
| 181 |
<copy todir="build/html/images"> |
| 182 |
<fileset dir="${docbook.xsl}/images" includes="**/*.png"/> |
| 183 |
</copy> |
| 184 |
<copy todir="build/html/figures"> |
| 185 |
<fileset dir="source/figures"/> |
| 186 |
</copy> |
| 187 |
<copy todir="build/examples"> |
| 188 |
<fileset dir="../en/examples"/> |
| 189 |
</copy> |
| 190 |
|
| 191 |
<echo message="Making html ..."/> |
| 192 |
<java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m" |
| 193 |
failonerror="true" dir="${basedir}/build/html"> |
| 194 |
<jvmarg value="-Xss512k"/> |
| 195 |
<classpath refid="lib.classpath"/> |
| 196 |
<arg value="-x"/> |
| 197 |
<arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> |
| 198 |
<arg value="-y"/> |
| 199 |
<arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> |
| 200 |
<arg value="-r"/> |
| 201 |
<arg value="org.apache.xml.resolver.tools.CatalogResolver"/> |
| 202 |
<arg value="../defguide-zh.xml"/> |
| 203 |
<arg value="../../stylesheets/zh/html.xsl"/> |
| 204 |
</java> |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
<touch file="build/html/.done"/> |
| 211 |
</target> |
| 212 |
|
| 213 |
<target name="pdf.init"> |
| 214 |
<uptodate property="pdf.isUpToDate" targetfile="build/defguide-zh.pdf"> |
| 215 |
<srcfiles dir="source" includes="defguide.xml"/> |
| 216 |
<srcfiles dir="po" includes="zh.po"/> |
| 217 |
<srcfiles dir="stylesheets" includes="fo.xsl"/> |
| 218 |
<srcfiles dir="stylesheets/zh" includes="fo.xsl"/> |
| 219 |
</uptodate> |
| 220 |
</target> |
| 221 |
|
| 222 |
|
| 223 |
<target name="pdf" depends="init,translate,pdf.init" unless="pdf.isUpToDate" |
| 224 |
description="Generate document - pdf"> |
| 225 |
<copy todir="build/schema"> |
| 226 |
<fileset dir="source/schema"/> |
| 227 |
</copy> |
| 228 |
<copy todir="build/images"> |
| 229 |
<fileset dir="${docbook.xsl}/images" includes="**/*.png"/> |
| 230 |
</copy> |
| 231 |
<copy todir="build/figures"> |
| 232 |
<fileset dir="source/figures" /> |
| 233 |
</copy> |
| 234 |
<copy todir="build/examples"> |
| 235 |
<fileset dir="../en/examples"/> |
| 236 |
</copy> |
| 237 |
|
| 238 |
<echo message="Making fo ..."/> |
| 239 |
<java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m" |
| 240 |
failonerror="true" dir="${basedir}/build"> |
| 241 |
<jvmarg value="-Xss512k"/> |
| 242 |
<classpath refid="lib.classpath"/> |
| 243 |
<arg value="-x"/> |
| 244 |
<arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> |
| 245 |
<arg value="-y"/> |
| 246 |
<arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> |
| 247 |
<arg value="-r"/> |
| 248 |
<arg value="org.apache.xml.resolver.tools.CatalogResolver"/> |
| 249 |
<arg value="-o"/> |
| 250 |
<arg value="defguide-zh.fo"/> |
| 251 |
<arg value="defguide-zh.xml"/> |
| 252 |
<arg value="../stylesheets/zh/fo.xsl"/> |
| 253 |
<arg value="fop1.extensions=1"/> |
| 254 |
<arg value="title.font.family=${fop.title.font.family}"/> |
| 255 |
<arg value="body.font.family=${fop.body.font.family}"/> |
| 256 |
<arg value="sans.font.family=${fop.sans.font.family}"/> |
| 257 |
<arg value="ingbat.font.family=${fop.ingbat.font.family}"/> |
| 258 |
<arg value="monospace.font.family=${fop.monospace.font.family}"/> |
| 259 |
</java> |
| 260 |
|
| 261 |
<echo message="Making pdf ..."/> |
| 262 |
<java classname="${fop.class}" fork="true" maxmemory="1024m" |
| 263 |
failonerror="true" dir="${basedir}/build"> |
| 264 |
<classpath refid="lib.classpath"/> |
| 265 |
<arg value="-c"/> |
| 266 |
<arg value="${fop.home}/conf/userconfig.xml"/> |
| 267 |
<arg value="defguide-zh.fo"/> |
| 268 |
<arg value="defguide-zh.pdf"/> |
| 269 |
</java> |
| 270 |
</target> |
| 271 |
|
| 272 |
|
| 273 |
<target name="pdf-xep" depends="init,translate,pdf.init" unless="pdf.isUpToDate" |
| 274 |
description="Generate document - pdf - xep"> |
| 275 |
<copy todir="build/schema"> |
| 276 |
<fileset dir="source/schema"/> |
| 277 |
</copy> |
| 278 |
<copy todir="build/images"> |
| 279 |
<fileset dir="${docbook.xsl}/images" includes="**/*.png"/> |
| 280 |
</copy> |
| 281 |
<copy todir="build/figures"> |
| 282 |
<fileset dir="source/figures" /> |
| 283 |
</copy> |
| 284 |
<copy todir="build/examples"> |
| 285 |
<fileset dir="../en/examples"/> |
| 286 |
</copy> |
| 287 |
|
| 288 |
<echo message="Making fo ..."/> |
| 289 |
<java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m" |
| 290 |
failonerror="true" dir="${basedir}/build"> |
| 291 |
<jvmarg value="-Xss1m"/> |
| 292 |
<classpath refid="lib.classpath"/> |
| 293 |
<arg value="-x"/> |
| 294 |
<arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> |
| 295 |
<arg value="-y"/> |
| 296 |
<arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> |
| 297 |
<arg value="-r"/> |
| 298 |
<arg value="org.apache.xml.resolver.tools.CatalogResolver"/> |
| 299 |
<arg value="-o"/> |
| 300 |
<arg value="defguide-zh.fo"/> |
| 301 |
<arg value="defguide-zh.xml"/> |
| 302 |
<arg value="../stylesheets/zh/fo.xsl"/> |
| 303 |
<arg value="xep.extensions=1"/> |
| 304 |
</java> |
| 305 |
|
| 306 |
<echo message="Making pdf ..."/> |
| 307 |
<java classname="com.renderx.xep.XSLDriver" fork="true" maxmemory="1536m" |
| 308 |
failonerror="true" dir="${basedir}/build"> |
| 309 |
<jvmarg value="-Xss512k"/> |
| 310 |
<classpath refid="xep.classpath"/> |
| 311 |
<arg value="-DCONFIG=${xep.home}/xep.xml"/> |
| 312 |
<arg value="-quiet"/> |
| 313 |
<arg value="defguide-zh.fo"/> |
| 314 |
<arg value="defguide-zh.pdf"/> |
| 315 |
</java> |
| 316 |
</target> |
| 317 |
|
| 318 |
<target name="defguide.init"> |
| 319 |
<uptodate property="defguide.isUpToDate" targetfile="build/defguide.pdf"> |
| 320 |
<srcfiles dir="source" includes="defguide.xml"/> |
| 321 |
</uptodate> |
| 322 |
</target> |
| 323 |
|
| 324 |
|
| 325 |
<target name="defguide" depends="init,defguide.init" unless="defguide.isUpToDate" |
| 326 |
description="Generate document - defguide(en)"> |
| 327 |
<copy todir="build/schema"> |
| 328 |
<fileset dir="source/schema"/> |
| 329 |
</copy> |
| 330 |
<copy todir="build/images"> |
| 331 |
<fileset dir="${docbook.xsl}/images" includes="**/*.png"/> |
| 332 |
</copy> |
| 333 |
<copy todir="build/figures"> |
| 334 |
<fileset dir="source/figures" /> |
| 335 |
</copy> |
| 336 |
<copy todir="build/examples"> |
| 337 |
<fileset dir="../en/examples"/> |
| 338 |
</copy> |
| 339 |
<copy file="source/defguide.xml" todir="build"/> |
| 340 |
|
| 341 |
<echo message="Making fo ..."/> |
| 342 |
<java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m" |
| 343 |
failonerror="true" dir="${basedir}/build"> |
| 344 |
<jvmarg value="-Xss512k"/> |
| 345 |
<classpath refid="lib.classpath"/> |
| 346 |
<arg value="-x"/> |
| 347 |
<arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> |
| 348 |
<arg value="-y"/> |
| 349 |
<arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> |
| 350 |
<arg value="-r"/> |
| 351 |
<arg value="org.apache.xml.resolver.tools.CatalogResolver"/> |
| 352 |
<arg value="-o"/> |
| 353 |
<arg value="defguide.fo"/> |
| 354 |
<arg value="defguide.xml"/> |
| 355 |
<arg value="../stylesheets/fo.xsl"/> |
| 356 |
<arg value="fop1.extensions=1"/> |
| 357 |
<arg value="title.font.family=${fop.title.font.family}"/> |
| 358 |
<arg value="body.font.family=${fop.body.font.family}"/> |
| 359 |
<arg value="sans.font.family=${fop.sans.font.family}"/> |
| 360 |
<arg value="ingbat.font.family=${fop.ingbat.font.family}"/> |
| 361 |
<arg value="monospace.font.family=${fop.monospace.font.family}"/> |
| 362 |
</java> |
| 363 |
|
| 364 |
<echo message="Making pdf ..."/> |
| 365 |
<java classname="${fop.class}" fork="true" maxmemory="1024m" |
| 366 |
failonerror="true" dir="${basedir}/build"> |
| 367 |
<classpath refid="lib.classpath"/> |
| 368 |
<arg value="-c"/> |
| 369 |
<arg value="${fop.home}/conf/userconfig.xml"/> |
| 370 |
<arg value="defguide.fo"/> |
| 371 |
<arg value="defguide.pdf"/> |
| 372 |
</java> |
| 373 |
</target> |
| 374 |
|
| 375 |
|
| 376 |
<target name="defguide-xep" depends="init,defguide.init" unless="defguide.isUpToDate" |
| 377 |
description="Generate document - defguide(en) - xep"> |
| 378 |
<copy todir="build/schema"> |
| 379 |
<fileset dir="source/schema"/> |
| 380 |
</copy> |
| 381 |
<copy todir="build/images"> |
| 382 |
<fileset dir="${docbook.xsl}/images" includes="**/*.png"/> |
| 383 |
</copy> |
| 384 |
<copy todir="build/figures"> |
| 385 |
<fileset dir="source/figures" /> |
| 386 |
</copy> |
| 387 |
<copy todir="build/examples"> |
| 388 |
<fileset dir="../en/examples"/> |
| 389 |
</copy> |
| 390 |
<copy file="source/defguide.xml" todir="build"/> |
| 391 |
|
| 392 |
<echo message="Making fo ..."/> |
| 393 |
<java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m" |
| 394 |
failonerror="true" dir="${basedir}/build"> |
| 395 |
<jvmarg value="-Xss1m"/> |
| 396 |
<classpath refid="lib.classpath"/> |
| 397 |
<arg value="-x"/> |
| 398 |
<arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> |
| 399 |
<arg value="-y"/> |
| 400 |
<arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> |
| 401 |
<arg value="-r"/> |
| 402 |
<arg value="org.apache.xml.resolver.tools.CatalogResolver"/> |
| 403 |
<arg value="-o"/> |
| 404 |
<arg value="defguide.fo"/> |
| 405 |
<arg value="defguide.xml"/> |
| 406 |
<arg value="../stylesheets/fo.xsl"/> |
| 407 |
<arg value="xep.extensions=1"/> |
| 408 |
</java> |
| 409 |
|
| 410 |
<echo message="Making pdf ..."/> |
| 411 |
<java classname="com.renderx.xep.XSLDriver" fork="true" maxmemory="1536m" |
| 412 |
failonerror="true" dir="${basedir}/build"> |
| 413 |
<jvmarg value="-Xss512k"/> |
| 414 |
<classpath refid="xep.classpath"/> |
| 415 |
<arg value="-DCONFIG=${xep.home}/xep.xml"/> |
| 416 |
<arg value="-quiet"/> |
| 417 |
<arg value="defguide.fo"/> |
| 418 |
<arg value="defguide.pdf"/> |
| 419 |
</java> |
| 420 |
</target> |
| 421 |
|
| 422 |
<target name="defguide-html.init"> |
| 423 |
<uptodate property="defguide-html.isUpToDate" targetfile="build/defguide/.done"> |
| 424 |
<srcfiles dir="source" includes="defguide.xml"/> |
| 425 |
<srcfiles dir="stylesheets" includes="html.xsl"/> |
| 426 |
</uptodate> |
| 427 |
</target> |
| 428 |
|
| 429 |
|
| 430 |
<target name="defguide-html" depends="init,defguide-html.init" unless="defguide-html.isUpToDate" |
| 431 |
description="Generate document - defguide(en) - html"> |
| 432 |
<copy todir="build/schema"> |
| 433 |
<fileset dir="source/schema"/> |
| 434 |
</copy> |
| 435 |
<copy todir="build/defguide/images"> |
| 436 |
<fileset dir="${docbook.xsl}/images" includes="**/*.png"/> |
| 437 |
</copy> |
| 438 |
<copy todir="build/defguide/figures"> |
| 439 |
<fileset dir="source/figures" /> |
| 440 |
</copy> |
| 441 |
<copy todir="build/examples"> |
| 442 |
<fileset dir="../en/examples"/> |
| 443 |
</copy> |
| 444 |
<copy file="source/defguide.xml" todir="build"/> |
| 445 |
|
| 446 |
<echo message="Making html ..."/> |
| 447 |
<java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m" |
| 448 |
failonerror="true" dir="${basedir}/build/defguide"> |
| 449 |
<jvmarg value="-Xss512k"/> |
| 450 |
<classpath refid="lib.classpath"/> |
| 451 |
<arg value="-x"/> |
| 452 |
<arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> |
| 453 |
<arg value="-y"/> |
| 454 |
<arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> |
| 455 |
<arg value="-r"/> |
| 456 |
<arg value="org.apache.xml.resolver.tools.CatalogResolver"/> |
| 457 |
<arg value="../defguide.xml"/> |
| 458 |
<arg value="../../stylesheets/html.xsl"/> |
| 459 |
</java> |
| 460 |
<touch file="build/defguide/.done"/> |
| 461 |
</target> |
| 462 |
</project> |