root/release-kits/wirk2/ant-scripts/create-distribution.xml @ 16774

Revision 16774, 5.3 KB (checked in by oranfry, 12 years ago)

fixes to wirk2

Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="wirk2-create-distribution" default="create-distribution">
3
4    <target name="create-distribution">
5        <antcall target="export-gsdl-gli" />
6        <antcall target="dist-set-version" />
7        <antcall target="drop-in-binaries" />
8        <antcall target="drop-in-demo-collection" />
9        <antcall target="drop-in-docs" />
10        <antcall target="copy-server-to-root"/>
11        <antcall target="compile-gli" />
12        <antcall target="tweak-files" />
13    </target>
14
15    <target name="export-gsdl-gli">
16        <mkdir dir="distributions"/>
17        <delete dir="distributions/web"/>
18        <svn>
19            <export srcurl="${svn.root}/gsdl/${branch.path}"        destPath="distributions/web"/>
20            <export srcurl="${svn.root}/gli/${branch.path}"         destPath="distributions/web/gli"/>
21        </svn>
22    </target>
23
24    <target name="dist-set-version">
25        <echo level="info">Setting version in src/lib/gsdlconf.h</echo>
26        <rsr file="${basedir}/distributions/web/common-src/src/lib/gsdlconf.h" pattern="(#define GSDL_VERSION) &quot;.*&quot;" replacement="$1 &quot;${version}&quot;" />
27        <echo level="info">Setting version in etc/VERSION</echo>
28        <rsr file="${basedir}/distributions/web/etc/VERSION" pattern="(gsdl version: ).*" replacement="$1${version}" />
29    </target>
30   
31    <target name="drop-in-binaries">
32        <echo level="info">Dropping compiled binaries into distribution</echo>
33        <delete dir="${basedir}/distributions/web/bin/windows" />
34        <copy todir="${basedir}/distributions/web/bin/windows">
35            <fileset dir="${basedir}/gsdl/bin/windows" includes="**/*"/>
36        </copy>
37    </target>
38
39    <target name="drop-in-demo-collection">
40        <echo level="info">Dropping rebuilt demo collection into distribution</echo>
41        <delete dir="${basedir}/distributions/web/collect/demo" />
42        <copy todir="${basedir}/distributions/web/collect/demo">
43            <fileset dir="${basedir}/gsdl/collect/demo" includes="**/*"/>
44        </copy>
45    </target>
46
47    <target name="drop-in-docs">
48        <echo level="info">Dropping gsdl docs  into distribution</echo>
49        <copy todir="${basedir}/distributions/web" overwrite="true">
50            <fileset dir="${wirk2.home}/greenstone2/docs"/>
51        </copy>
52    </target>
53
54    <target name="copy-server-to-root">
55        <copy
56            todir="${basedir}/distributions/web"
57            file="${basedir}/distributions/web/bin/windows/server.exe"
58            overwrite="true"/>
59    </target>
60   
61    <target name="compile-gli">
62        <echo>Compiling gli...</echo>
63        <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makegli.bat"/>
64       
65        <echo>Creating jar...</echo>
66        <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makejar.bat"/>
67       
68        <echo>Cleaning up intermediate files...</echo>
69        <delete dir="${basedir}/distributions/web/gli/jar"/>
70        <delete dir="${basedir}/distributions/web/gli/classes/org"/>
71       
72        <echo>Putting gli server jar in a better place</echo>
73        <move file="${basedir}/distributions/web/gli/GLIServer.jar" todir="${basedir}/distributions/web/bin/java" />
74    </target>
75
76    <target name="tweak-files">
77        <echo level="info">Changing date and version in the docs</echo>
78        <!-- ar -->
79        <rsr file="${basedir}/distributions/web/READMEar.txt" pattern="(التاريخ : \s*)(.*)" replacement="$1${month.ar} ${current.year}" />
80        <rsr file="${basedir}/distributions/web/READMEar.txt" pattern="(النسخه : \s*)(.*)" replacement="$1${version}" />
81        <!-- es -->
82        <rsr file="${basedir}/distributions/web/READMEes.txt" pattern="^(Fecha\s*)(.*)" replacement="$1${month.es} de ${current.year}" />
83        <rsr file="${basedir}/distributions/web/READMEes.txt" pattern="^(Versi.?n\s*)(.*)" replacement="$1${version}" />
84        <!-- fr -->
85        <rsr file="${basedir}/distributions/web/READMEfr.txt" pattern="^(Date\s*)(.*)" replacement="$1${month.fr} ${current.year}" />
86        <rsr file="${basedir}/distributions/web/READMEfr.txt" pattern="^(Version\s*)(.*)" replacement="$1${version}" />
87        <!-- ru -->
88        <rsr file="${basedir}/distributions/web/READMEru.txt" pattern="^(Дата\s*)(.*)" replacement="$1${month.ru} ${current.year}" />
89        <rsr file="${basedir}/distributions/web/READMEru.txt" pattern="^(ВерсОя\s*)(.*)" replacement="$1${version}" />
90        <!-- en -->
91        <rsr file="${basedir}/distributions/web/READMEen.txt" pattern="^(Date\s*)(.*)" replacement="$1${month.default} ${current.year}" />
92        <rsr file="${basedir}/distributions/web/READMEen.txt" pattern="^(Version\s*)(.*)" replacement="$1${version}" />
93
94        <!-- Support.htm -->
95        <rsr file="${basedir}/distributions/web/Support.htm" pattern="^(\s*Greenstone Digital Library version: ).*(&lt;br&gt;.*)" replacement="$1${version}$2"/>
96        <rsr file="${basedir}/distributions/web/Support.htm" pattern="^(\s*&lt;input.* name=&quot;gsdl version&quot;.* value=&quot;).*(&quot;.*&gt;)" replacement="$1${version}$2"/>
97
98
99        <echo level="info">Removing signed gatherer</echo>
100        <delete file="${basedir}/distributions/web/bin/java/SignedGatherer.jar" />
101
102        <echo level="info">Removing some unneeded stuff</echo>
103        <delete file="${basedir}/distributions/web/gli/.greenstonestore" />
104        <delete dir="${basedir}/distributions/web/bin/linux" />
105        <delete><fileset dir="${basedir}/distributions/web" includes="*.bash,*.sh,*.csh,install-sh,configure,configure.in,config.sub,config.guess,config.h.in,configtest.pl,Makefile.in,aclocal.m4,acconfig.h,micotest.cpp,win32.mak,WIN32cfg.h,Install.txt"/></delete>
106        <delete><fileset dir="${basedir}/distributions/web/gli" includes="*.sh,*4gs3.bat"/></delete>
107    </target>
108
109</project>
Note: See TracBrowser for help on using the browser.