source: release-kits/shared/greenstone3/ant-scripts/rk3-targets.xml@ 19935

Last change on this file since 19935 was 19935, checked in by oranfry, 15 years ago

it's all good stuff

File size: 6.2 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<!--
3 ..........................................................
4 August 2008
5 Targets for Greenstone3 release kits
6 Oran Fry
7 ..........................................................
8-->
9
10<project name="rk3-targets">
11
12 <property name="version.major" value="3"/>
13
14 <!-- create the property set to be forwarded to greenstone3 -->
15 <propertyset id="forward.properties">
16 <propertyref prefix="forward."/>
17 <mapper type="glob" from="forward.*" to="*"/>
18
19 <propertyref name="app.version"/>
20 <propertyref name="branch.path"/>
21 <propertyref name="branch.revision"/>
22
23 </propertyset>
24
25 <target name="greenstone3-set-version-numbers">
26 <rsr
27 file="${greenstone3basedir}/resources/java/global.properties.in"
28 pattern="@gsdl3version@"
29 replacement="${version}" />
30 </target>
31
32 <target name="gs3-init">
33
34 <!-- don't let greenstone3 block and wait for user input to accept
35 the properties for the build -->
36 <property name="forward.properties.accepted" value="true"/>
37
38 <!-- make sure all c++ compilation is done statically -->
39 <property name="forward.compile.static" value="true"/>
40
41 <!-- show the property set to be forwarded to greenstone3 -->
42 <echo>Properties to be forwarded to greenstone3 build</echo>
43 <echoproperties><propertyset refid="forward.properties"/></echoproperties>
44
45 </target>
46
47 <target name="insert-uninstaller-jar">
48 <copy file="compiled/uninst.jar" tofile="distributions/web/uninst.jar"/>
49 </target>
50
51 <!--
52 inserts a copy of the release kit's own ant into the greenstone3
53 installation. the ant from the release kit is minified so is a good choice.
54 -->
55 <target name="insert-ant">
56
57 <!-- remove any existing ant -->
58 <delete dir="compiled/packages/ant"/>
59
60 <!-- windows copy -->
61 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
62 <copy todir="compiled/packages">
63 <fileset dir="${rk.home}/core" includes="ant/**/*"/>
64 </copy>
65
66 <!-- linux, mac copy-->
67 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
68 <exec executable="cp">
69 <arg value="-r"/>
70 <arg value="${rk.home}/core/ant"/>
71 <arg value="compiled/packages"/>
72 </exec>
73
74 <!-- otherwise fail -->
75 <else>
76 <fail>this target does not support the current os</fail>
77
78 </else></if></else></if>
79
80 </target>
81
82 <target name="generate-build-properties">
83 <copy file="${greenstone3.basedir}/build.properties.in" tofile="${greenstone3.basedir}/build.properties"/>
84 <if><bool><istrue value="${install.flax}"/></bool>
85 <rsr file="${greenstone3.basedir}/build.properties" pattern="^#install.flax\s*[=:].*" replacement="install.flax=true"/>
86 </if>
87 <if><bool><isset property="server.default.servlet"/></bool>
88 <rsr file="${greenstone3.basedir}/build.properties" pattern="^#?server.default.servlet\s*[=:].*" replacement="server.default.servlet=${server.default.servlet}"/>
89 </if>
90 </target>
91
92 <target name="checkout-greenstone3">
93 <svn>
94 <checkout url="${svn.root}/greenstone3/${branch.path}" destPath="compiled" revision="${branch.revision}"/>
95 <checkout url="${svn.root}/gli/${branch.path}" destPath="compiled/gli" revision="${branch.revision}"/>
96 </svn>
97 </target>
98
99 <target name="insert-xml-parser">
100 <copy todir="compiled/gs2build/perllib/cpan">
101 <fileset dir="${rk.home}/greenstone3" includes="XML-Parser/**/*"/>
102 </copy>
103 </target>
104
105 <target name="insert-documented-examples">
106 <echo>NOT IMPLEMENTED: Remember to put code in this target to grab and install the documented examples.</echo>
107 <!-- copy the doc eg colls from /home/nzdl - note we don't include the formatting ones -->
108 </target>
109
110 <target name="prepare-documentation">
111
112 <mkdir dir="compiled/gsdl-manuals"/>
113 <svn>
114 <checkout url="${svn.root}/documentation/${branch.path}/manuals" destPath="compiled/gsdl-manuals/manuals"/>
115 <checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="compiled/gsdl-manuals/shared"/>
116 </svn>
117 <path id="documentation.compile.classpath">
118 <fileset dir="compiled/gsdl-manuals">
119 <include name="**/*.jar"/>
120 </fileset>
121 <pathelement path="compiled/gsdl-manuals/shared"/>
122 <pathelement path="compiled/gsdl-manuals/manuals"/>
123 </path>
124 <javac srcdir="compiled/gsdl-manuals/shared"
125 destdir="compiled/gsdl-manuals/shared"
126 debug="on"
127 classpathref="documentation.compile.classpath">
128 <include name="*.java"/>
129 </javac>
130 <unzip src="compiled/gsdl-manuals/shared/fop.zip" dest="compiled/gsdl-manuals/shared"/>
131
132 <java classname="ApplyXSLT" classpathref="documentation.compile.classpath" output="compiled/gsdl-manuals/manuals/xml-source/en/help-en.xml">
133 <arg value="compiled/gsdl-manuals/manuals/processing/gen-gli-help-to-manual-chapter.xsl" />
134 <arg value="compiled/gli/help/en/help.xml" />
135 <arg value="compiled" />
136 </java>
137
138 <chmod perm="a+x" file="compiled/gsdl-manuals/shared/fop/fop.sh"/>
139 <echo>Run generate-pdf script</echo>
140 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
141 <exec dir="compiled/gsdl-manuals/manuals" executable="cmd">
142 <arg value="/C" />
143 <arg file="${basedir}/compiled/gsdl-manuals/manuals/generate-pdf.bat" />
144 <arg value="u" />
145 <arg value="en" />
146 </exec>
147 <else>
148 <exec dir="compiled/gsdl-manuals/manuals" executable="/bin/bash">
149 <arg line="generate-pdf.sh u en" />
150 </exec>
151 </else></if>
152 </target>
153
154 <target name="clean">
155 <antcall target="clean-compiled"/>
156 <antcall target="clean-distributions"/>
157 <antcall target="clean-components"/>
158 <antcall target="clean-installer"/>
159 <antcall target="clean-wrapped-installer"/>
160 </target>
161
162 <target name="clean-compiled">
163 <delete dir="compiled"/>
164 </target>
165
166 <target name="clean-distribution">
167 <delete dir="distributions"/>
168 </target>
169
170 <target name="clean-components">
171 <delete dir="components"/>
172 </target>
173
174 <target name="clean-installer">
175 <delete dir="installer"/>
176 </target>
177
178 <target name="clean-wrapped-installer">
179 <delete dir="wrapped-installer"/>
180 </target>
181
182 <target name="copy-greenstone3-installer-files">
183
184 <!-- the installer descriptors -->
185 <copy todir="installer" file="${rk.home}/greenstone3/installer/antinstall-config.xml" overwrite="true"/>
186 <copy todir="installer" file="${rk.home}/greenstone3/installer/build.xml" overwrite="true"/>
187
188 </target>
189
190</project>
Note: See TracBrowser for help on using the repository browser.