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

Revision 17833, 6.1 KB (checked in by oranfry, 11 years ago)

make sure uninstaller makes it into source releases

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