root/release-kits/cdrk2/ant-scripts/build.xml @ 18768

Revision 18768, 6.9 KB (checked in by oranfry, 11 years ago)

more required externals and lots more functionality

Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<!--
3        ..........................................................
4        March 2009
5        CD Release Kit for Greenstone2 (cdrk2)
6        Oran Fry
7        ..........................................................
8-->
9
10<project name="cdrk2-build" default="cdrk2">
11
12    <!-- CONSTANTS -->
13
14    <!-- for the benefit of the shared scripts, set release-kit home -->
15    <property name="rk.name" value="cdrk2"/>
16    <property name="rk.home" value="${cdrk2.home}" />
17    <property name="rk.os" value="multi" />
18    <property name="os.suffix" value="AnyPlatform"/>
19   
20    <!-- IMPORT OTHER ANT SCRIPTS -->
21    <import file="shared-ant-scripts/init.xml"/>
22    <import file="../greenstone2/ant-scripts/rk2-targets.xml"/>
23
24    <!-- figure out where the compiled software is coming from -->
25    <property name="software.archive.linux" value="http://greenstone.org/release-snapshots/cdrom-components-${version}-linux.tar.gz"/>
26    <property name="software.archive.windows" value="http://greenstone.org/release-snapshots/cdrom-components-${version}-windows.tar.gz"/>
27    <property name="software.archive.mac" value="http://greenstone.org/release-snapshots/cdrom-components-${version}-mac.tar.gz"/>
28
29    <!-- THE MAIN TARGET -->
30    <target name="cdrk2" depends="init">
31        <antcall target="checkout-and-compile-documentation"/>
32        <antcall target="build-tutorials"/>
33        <antcall target="build-documentation"/>
34        <antcall target="export-documented-example-collections"/>
35        <antcall target="insert-readmes"/>
36        <antcall target="insert-software"/>
37        <antcall target="create-image"/>
38    </target>
39
40    <target name="checkout-and-compile-documentation">
41        <svn>
42            <checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="documentation/shared"/>
43        </svn>     
44        <javac srcdir="documentation/shared" destdir="documentation/shared" debug="on">
45            <include name="*.java"/>
46        </javac>
47
48    </target>
49
50    <target name="build-tutorials">
51        <svn>
52            <checkout url="${svn.root}/documentation/${branch.path}/tutorials" destPath="documentation/tutorials"/>
53            <checkout url="${svn.root}/gli/${branch.path}" destPath="documentation/gli"/>
54            <checkout url="${svn.root}/gsdl/${branch.path}/perllib" destPath="documentation/perllib"/>
55            <checkout url="${svn.root}/gsdl/${branch.path}/macros" destPath="documentation/macros"/>
56        </svn>
57
58        <delete dir="documentation/tutorials/html"/>
59        <exec dir="documentation/tutorials" executable="/bin/bash">
60            <arg value="generate-html.sh"/>
61            <env key="GSDLHOME" value="${basedir}/documentation"/>
62        </exec>
63
64        <delete dir="cdrom/Tutorial Exercises"/>
65        <copy todir="cdrom/Tutorial Exercises/English"><fileset dir="documentation/tutorials/html/en"/></copy>
66        <copy todir="cdrom/Tutorial Exercises/French"><fileset dir="documentation/tutorials/html/fr"/></copy>
67        <copy todir="cdrom/Tutorial Exercises/Spanish"><fileset dir="documentation/tutorials/html/es"/></copy>
68        <copy todir="cdrom/Tutorial Exercises/Russian"><fileset dir="documentation/tutorials/html/ru"/></copy>
69    </target>
70
71    <target name="build-documentation">
72        <svn>
73            <checkout url="${svn.root}/documentation/${branch.path}/manuals" destPath="documentation/manuals"/>
74            <checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="documentation/shared"/>
75            <checkout url="${svn.root}/gli/${branch.path}" destPath="documentation/gli"/>
76        </svn>
77        <unzip src="documentation/shared/fop.zip" dest="documentation/shared"/>
78        <chmod perm="a+x" file="documentation/shared/fop/fop.sh"/>
79
80        <antcall target="generate-gli-chapter"><param name="language" value="en"/></antcall>
81        <antcall target="generate-gli-chapter"><param name="language" value="fr"/></antcall>
82        <antcall target="generate-gli-chapter"><param name="language" value="es"/></antcall>
83        <antcall target="generate-gli-chapter"><param name="language" value="ru"/></antcall>
84
85        <delete dir="documentation/manuals/build"/>
86        <exec dir="documentation/manuals" executable="/bin/bash">
87            <arg value="generate-pdf.sh"/>
88            <arg value="all"/>
89            <arg value="en es ru fr"/>
90        </exec>
91
92        <exec spawn="true" dir="documentation/manuals" executable="/bin/bash">
93            <arg value="generate-pdf.sh"/>
94            <arg value="Install"/>
95            <arg value="ar"/>
96        </exec>
97
98        <delete dir="cdrom/Documentation"/>
99        <copy todir="cdrom/Documentation/English"><fileset dir="documentation/manuals/build/en/pdf"/></copy>
100        <copy todir="cdrom/Documentation/French"><fileset dir="documentation/manuals/build/fr/pdf"/></copy>
101        <copy todir="cdrom/Documentation/Spanish"><fileset dir="documentation/manuals/build/es/pdf"/></copy>
102        <copy todir="cdrom/Documentation/Russian"><fileset dir="documentation/manuals/build/ru/pdf"/></copy>
103        <copy todir="cdrom/Documentation/Arabic"><fileset dir="documentation/manuals/build/ar/pdf"/></copy>
104    </target>
105
106    <target name="export-documented-example-collections">
107        <svn>
108            <export srcurl="${svn.root}/documented-example-collections/${branch.path}" destPath="cdrom/Documented Example Collections"/>
109        </svn>
110    </target>
111
112
113    <target name="generate-gli-chapter">
114        <path id="documentation.compile.classpath">
115            <fileset dir="documentation">
116                <include name="**/*.jar"/>
117            </fileset>
118            <pathelement path="documentation/gli/classes"/>
119            <pathelement path="documentation/shared"/>
120            <pathelement path="documentation/manuals"/>
121        </path>
122        <java classname="ApplyXSLT" classpathref="documentation.compile.classpath" output="documentation/manuals/xml-source/${language}/help-${language}.xml">
123            <arg value="documentation/manuals/processing/gen-gli-help-to-manual-chapter.xsl" />
124            <arg value="documentation/gli/help/${language}/help.xml" />
125            <arg value="compiled" />
126        </java>
127        <copy file="documentation/manuals/xml-source/${language}/help-${language}.xml" todir="documentation/manuals"/>
128    </target>
129
130    <target name="insert-readmes">
131        <copy todir="cdrom"><fileset dir="${rk.home}/greenstone2/docs"/></copy>
132        <antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${basedir}/cdrom"/></antcall>
133    </target>
134
135    <target name="insert-software">
136        <antcall target="insert-software-linux"/>
137        <antcall target="insert-software-windows"/>
138<!--
139        <antcall target="insert-software-mac"/>
140-->
141    </target>
142
143    <target name="insert-software-linux">
144        <mkdir dir="cdrom/Software"/>
145        <mkdir dir="software"/>
146        <get src="${software.archive.linux}" dest="software/linux.tar.gz"/>
147        <untar src="software/linux.tar.gz" dest="cdrom/Software" compression="gzip" overwrite="true"/>
148    </target>
149
150    <target name="insert-software-windows">
151        <mkdir dir="cdrom/Software"/>
152        <mkdir dir="software"/>
153        <get src="${software.archive.windows}" dest="software/windows.tar.gz"/>
154        <untar src="software/windows.tar.gz" dest="cdrom/Software" compression="gzip" overwrite="true"/>
155    </target>
156
157    <target name="create-image">
158        <mkdir dir="products"/>
159        <!-- mkisofs -o products/Greenstone-CDROM.iso -J -R -D cdrom -->
160        <exec executable="mkisofs">
161            <arg value="-input-charset"/>
162            <arg value="utf-8"/>
163            <arg value="-o"/>
164            <arg value="products/Greenstone-CDROM-${version}.iso"/>
165            <arg value="-J"/>
166            <arg value="-R"/>
167            <arg value="-D"/>
168            <arg value="cdrom"/>
169        </exec>
170    </target>
171
172</project>
Note: See TracBrowser for help on using the browser.