-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
158 lines (141 loc) · 4.7 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
<?xml version="1.0"?>
<!-- Ant file for building from the command line
When running under windows, the 'fop' program
is called 'fop.bat' for the batch file.
Calling ant with
-Dfop=fop.bat
will define the property, and since ant properties
are immutable, the <property name="fop" ... setting
in here will then be ignored.
Kay Kasemir
-->
<project name="css_docbook" default="all">
<!-- Map all environment variables XYZ to ${env.XYZ} -->
<property environment="env"/>
<!-- Build directory -->
<property name="out" location="./out" />
<!-- XML-FO Processor -->
<property name="fop" value="fop" />
<!-- XSL Processor -->
<property name="xsltproc" value="xsltproc" />
<!-- Remove all that might have been built previously -->
<target name="clean">
<delete dir="${out}" />
</target>
<!-- Create build directory structure, check dependencies -->
<target name="prepare">
<mkdir dir="${out}" />
</target>
<!-- Generate HTML -->
<target name="html" depends="prepare">
<apply executable="${xsltproc}">
<arg value="--xinclude"/>
<arg value="--output"/>
<targetfile/>
<arg value="myhtml.xsl"/>
<srcfile/>
<fileset dir="src">
<include name="css_book.xml"/>
</fileset>
<mapper type="glob" from="*.xml" to="${out}/*.html"/>
</apply>
<copy todir="${out}" flatten="true">
<fileset dir="src">
<include name="**/*.png"/>
</fileset>
<fileset dir=".">
<include name="*.css"/>
</fileset>
<fileset dir=".">
<include name="*.html"/>
</fileset>
</copy>
</target>
<!-- Generate Eclipse help format -->
<target name="eclipse" depends="prepare">
<apply executable="${xsltproc}">
<arg value="--xinclude"/>
<arg value="--output"/>
<targetfile/>
<arg value="myeclipse.xsl"/>
<srcfile/>
<fileset dir="src">
<include name="org.csstudio.navigator.applaunch/chapter.xml" />
<include name="org.csstudio.utility.chat/chapter.xml" />
</fileset>
<mapper type="glob" from="*.xml" to="${out}/*.html"/>
</apply>
<copy todir="${out}" flatten="true">
<fileset dir="src">
<include name="**/*.png"/>
</fileset>
<fileset dir=".">
<include name="*.css"/>
</fileset>
</copy>
</target>
<!-- Generate Wiki -->
<target name="wiki" depends="prepare">
<apply executable="${xsltproc}">
<arg value="--output"/>
<targetfile/>
<arg value="wiki/docbook.xsl"/>
<srcfile/>
<fileset dir="src">
<include name="localization.xml"/>
<include name="preferences.xml"/>
<include name="intropages.xml"/>
</fileset>
<mapper type="glob" from="*.xml" to="${out}/*.tracwiki"/>
</apply>
</target>
<!-- Generate PDF -->
<target name="pdf" depends="prepare">
<apply executable="${fop}">
<arg value="-xsl"/>
<arg value="mypdf.xsl"/>
<arg value="-xml"/>
<srcfile/>
<arg value="-pdf"/>
<targetfile/>
<fileset dir="src">
<include name="css_book.xml"/>
</fileset>
<mapper type="glob" from="*.xml" to="${out}/*.pdf"/>
</apply>
</target>
<!-- Update and view PDF (on OS X) -->
<target name="pdfview" depends="clean,pdf">
<apply executable="open">
<srcfile/>
<fileset dir="${out}">
<include name="*.pdf"/>
</fileset>
</apply>
</target>
<!-- Update and view HTML (on OS X) -->
<target name="htmlview" depends="clean,html">
<apply executable="open">
<srcfile/>
<fileset dir="${out}">
<include name="css_book.html"/>
<include name="index.html"/>
</fileset>
</apply>
</target>
<!-- Push changes to repository -->
<target name="push">
<exec executable="hg">
<arg value="commit"/>
<arg value="-m"/>
<arg value="sync"/>
</exec>
<exec executable="hg">
<arg value="push"/>
</exec>
</target>
<!-- Run the whole chain -->
<target name="all" depends="clean,html,pdf">
<echo>=== Completed building ${ant.project.name} ===</echo>
</target>
</project>