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

Last change on this file since 17340 was 17340, checked in by oranfry, 12 years ago

a target to do the version number replacements on a greenstone3 checkout

File size: 6.9 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 <target name="make-installer-files-concrete">
13
14 <!-- calculate the size of some components -->
15 <echo>Calculating the size of some components</echo>
16
17 <!-- core greenstone3 system (keep in sync with installer build.xml files) -->
18 <length property="component.bytesize.core" mode="all">
19 <fileset dir="${basedir}/distribution/greenstone3" includes="bin/**/*,docs/**/*,gli/**/*,gs2build/**/*,lib/**/*,web/**/*,resources/**/*,winutil/**/*"/>
20 </length>
21 <math result="component.megabytesize.core" operand1="${component.bytesize.core}" operation="/" operand2="1048576" datatype="int"/>
22 <property name="component.size.core" value="${component.megabytesize.core} MB"/>
23
24 <!-- source code (keep in sync with installer build.xml files) -->
25 <length property="component.bytesize.sourcecode" mode="all"><fileset dir="${basedir}/distribution/greenstone3" includes="src/**/*"/></length>
26 <math result="component.megabytesize.sourcecode" operand1="${component.bytesize.sourcecode}" operation="/" operand2="1048576" datatype="int"/>
27 <property name="component.size.sourcecode" value="${component.megabytesize.sourcecode} MB"/>
28
29 <!-- tomcat -->
30 <length property="component.bytesize.tomcat" mode="all"><fileset dir="${basedir}/distribution/greenstone3" includes="packages/tomcat/**/*"/></length>
31 <math result="component.megabytesize.tomcat" operand1="${component.bytesize.tomcat}" operation="/" operand2="1048576" datatype="int"/>
32 <property name="component.size.tomcat" value="${component.megabytesize.tomcat} MB"/>
33
34 <!-- ant -->
35 <length property="component.bytesize.ant" mode="all"><fileset dir="${basedir}/distribution/greenstone3" includes="packages/ant/**/*"/></length>
36 <math result="component.megabytesize.ant" operand1="${component.bytesize.ant}" operation="/" operand2="1048576" datatype="int"/>
37 <property name="component.size.ant" value="${component.megabytesize.ant} MB"/>
38
39 <!-- show the calculated sizes -->
40 <echo>component.size.core: ${component.size.core}</echo>
41 <echo>component.size.sourcecode: ${component.size.sourcecode}</echo>
42 <echo>component.size.tomcat: ${component.size.tomcat}</echo>
43 <echo>component.size.ant: ${component.size.ant}</echo>
44 <if>
45 <bool><equals arg1="windows" arg2="${rk.os}"/></bool>
46 <echo>component.size.windows-java: ${component.size.windows-java}</echo>
47 <else><if>
48 <bool><equals arg1="linux" arg2="${rk.os}"/></bool>
49 <echo>component.size.linux-java: ${component.size.linux-java}</echo>
50 </if></else>
51 </if>
52
53
54 <!-- put the concrete values of things in the config -->
55 <rsr file="${basedir}/installer/antinstall-config.xml">
56 <job pattern="@version@" replacement="${version}"/>
57 <job pattern="@component.size.core@" replacement="${component.size.core}"/>
58 <job pattern="@component.size.sourcecode@" replacement="${component.size.sourcecode}"/>
59 <job pattern="@component.size.linux-java@" replacement="${component.size.linux-java}"/>
60 <job pattern="@component.size.windows-java@" replacement="${component.size.windows-java}"/>
61 <job pattern="@component.size.tomcat@" replacement="${component.size.tomcat}"/>
62 <job pattern="@component.size.ant@" replacement="${component.size.ant}"/>
63 </rsr>
64
65 <rsr file="${basedir}/installer/build.xml">
66 <job pattern="@version@" replacement="${version}"/>
67 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
68 </rsr>
69
70 <!-- put the concrete values of things in the text -->
71 <!-- default -->
72 <rsr file="${basedir}/installer/classes/resources/LanguagePack.properties">
73 <job pattern="@version@" replacement="${version}"/>
74 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
75 <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
76 <job pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
77 </rsr>
78
79 <!-- chinese -->
80 <rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties">
81 <job pattern="@version@" replacement="${version}"/>
82 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
83 <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
84 <job pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
85 </rsr>
86
87 <!-- os specific replacements -->
88 <if>
89 <bool><equals arg1="windows" arg2="${rk.os}"/></bool>
90 <rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@bundled.version.java@" replacement="${bundled.version.windows-java}"/>
91 <rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@bundled.version.java@" replacement="${bundled.version.windows-java}"/>
92 <rsr file="${basedir}/installer/build.xml" pattern="@java.extracted@" replacement="${windows-java.extracted}"/>
93
94 <else><if>
95 <bool><equals arg1="linux" arg2="${rk.os}"/></bool>
96 <rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@bundled.version.java@" replacement="${bundled.version.linux-java}"/>
97 <rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@bundled.version.java@" replacement="${bundled.version.linux-java}"/>
98 <rsr file="${basedir}/installer/build.xml" pattern="@java.extracted@" replacement="${linux-java.extracted}"/>
99
100 </if></else>
101
102 </if>
103
104 </target>
105
106 <!-- useful for unix release-kits only -->
107 <target name="compile-search4j">
108 <copy todir="${basedir}/greenstone3"><fileset dir="${rk.home}/packages" includes="search4j/**/*"/></copy>
109 <chmod perm="ug+x" file="${basedir}/greenstone3/search4j/compile.sh"/>
110 <exec dir="${basedir}/greenstone3/search4j" executable="${basedir}/greenstone3/search4j/compile.sh"/>
111 <move file="${basedir}/greenstone3/search4j/search4j" todir="${basedir}/greenstone3/bin"/>
112 <chmod perm="ug+x" file="${basedir}/greenstone3/bin/search4j"/>
113 </target>
114
115 <target name="compile-uninstaller">
116 <echo>Compiling Uninstaller</echo>
117 <mkdir dir="${basedir}/greenstone3/uninstaller/build" />
118
119 <javac
120 srcdir="${rk.home}/uninstaller"
121 destdir="${basedir}/greenstone3/uninstaller/build" />
122
123 <copy todir="${basedir}/greenstone3/uninstaller/build">
124 <fileset dir="${rk.home}/uninstaller" includes="*.properties"/>
125 </copy>
126
127 <jar
128 destfile="${basedir}/greenstone3/uninstaller/Uninstall.jar"
129 manifest="${rk.home}/uninstaller/manifest.mf"
130 basedir="${basedir}/greenstone3/uninstaller/build" />
131
132 </target>
133
134 <target name="insert-uninstaller">
135 <copy file="greenstone3/uninstaller/Uninstall.jar" todir="distribution/greenstone3" />
136 </target>
137
138 <target name="greenstone3-set-version-numbers">
139 <rsr
140 file="${greenstone3basedir}/resources/java/global.properties.in"
141 pattern="@gsdl3version@"
142 replacement="${version}" />
143 </target>
144
145</project>
Note: See TracBrowser for help on using the repository browser.