root/release-kits/mark3/ant-scripts/create-components.xml @ 17712

Revision 17712, 6.6 KB (checked in by oranfry, 12 years ago)

create a compressed zipfile of the sourcecode component, for download

Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="mark3-create-components" default="create-components">
3
4    <!-- create components from the distribution folder -->
5
6    <!-- 1st level -->
7    <target name="create-components">
8        <antcall target="prepare-components" />
9        <antcall target="compress-components" />
10    </target>
11
12    <!-- 2nd level -->
13    <target name="prepare-components">
14        <antcall target="prepare-core-component" />
15        <antcall target="prepare-sourcecode-component" />
16        <antcall target="prepare-ant-component" />
17        <antcall target="prepare-tomcat-component" />
18        <antcall target="prepare-sourcecode-core-component" />
19        <antcall target="prepare-imagemagick-component" />
20        <antcall target="prepare-ghostscript-component" />
21    </target>
22
23    <target name="compress-components">
24        <antcall target="compress-core-component" />
25        <antcall target="compress-sourcecode-component" />
26        <antcall target="compress-ant-component" />
27        <antcall target="compress-tomcat-component" />
28        <antcall target="compress-sourcecode-core-component" />
29        <antcall target="compress-imagemagick-component" />
30        <antcall target="compress-ghostscript-component" />
31    </target>
32
33    <!-- 3rd level -->
34    <!-- core -->
35    <target name="prepare-core-component">
36
37        <delete dir="components/tmp/core"/>
38        <mkdir dir="components/tmp/core"/>
39               
40        <copy todir="components/tmp/core" overwrite="true">
41            <fileset dir="distribution/greenstone3">
42                <include name="**/*"/>
43
44                <!-- exclude sourcecode -->
45                <exclude name="src"/>
46                <exclude name="src/**/*"/>
47                <exclude name="gs2build/common-src"/>
48                <exclude name="gs2build/common-src/**/*"/>
49                <exclude name="gs2build/build-src"/>
50                <exclude name="gs2build/build-src/**/*"/>
51                <exclude name="gs2build/runtime-src"/>
52                <exclude name="gs2build/runtime-src/**/*"/>
53               
54                <!-- exclude ant -->
55                <exclude name="packages/ant"/>
56                <exclude name="packages/ant/**/*"/>
57
58                <!-- exclude tomcat -->
59                <exclude name="packages/tomcat"/>
60                <exclude name="packages/tomcat/**/*"/>
61
62                <!-- exclude imagemagick -->
63                <exclude name="gs2build/bin/darwin/imagemagick"/>
64                <exclude name="gs2build/bin/darwin/imagemagick/**/*"/>
65
66            </fileset>
67        </copy>
68               
69        <zip destfile="components/core.comp" basedir="components/tmp/core" compress="false" />
70    </target>
71   
72    <target name="compress-core-component">
73        <sevenzip task="encode" input="components/core.comp" output="components/core.lzma" dictionnary="26"/>
74    </target>
75   
76    <!-- sourcecode-core -->
77    <target name="prepare-sourcecode-core-component">
78        <delete dir="components/tmp/sourcecode-core"/>
79        <mkdir dir="components/tmp/sourcecode-core"/>
80
81        <copy todir="components/tmp/sourcecode-core" overwrite="true">
82            <fileset dir="distribution/source">
83                <include name="gli/**/*"/>
84                <include name="docs/**/*"/>
85                <include name="resources/**/*"/>
86                <include name="web/**/*"/>
87                <include name="gs2build/etc/**/*"/>
88                <include name="gs2build/setup.bash"/>
89                <include name="build.xml"/>
90                <include name="build.properties"/>
91                <include name="*.sh"/>
92                <include name="*.txt"/>
93            </fileset>
94        </copy>
95        <zip destfile="components/sourcecode-core.comp" basedir="components/tmp/sourcecode-core" compress="false" includes="**/*"/>
96    </target>
97   
98    <target name="compress-sourcecode-core-component">
99        <sevenzip task="encode" input="components/sourcecode-core.comp" output="components/sourcecode-core.lzma" dictionnary="26"/>
100    </target>
101
102
103    <!-- sourcecode -->
104    <target name="prepare-sourcecode-component">
105
106        <delete dir="components/tmp/sourcecode"/>
107        <mkdir dir="components/tmp/sourcecode"/>
108
109        <copy todir="components/tmp/sourcecode" overwrite="true">
110                <fileset dir="distribution/greenstone3">
111                    <include name="src/**/*"/>
112                    <include name="gs2build/common-src/**/*"/>
113                    <include name="gs2build/build-src/**/*"/>
114                    <include name="gs2build/runtime-src/**/*"/>
115                </fileset>
116        </copy>
117               
118        <zip destfile="components/sourcecode.comp" basedir="components/tmp/sourcecode" compress="false" />
119        <zip destfile="components/sourcecode.zip"  basedir="components/tmp/sourcecode" compress="true" />
120    </target>
121       
122    <target name="compress-sourcecode-component">
123        <sevenzip task="encode" input="components/sourcecode.comp" output="components/sourcecode.lzma" dictionnary="26"/>
124    </target>
125   
126    <!-- ant -->
127    <target name="prepare-ant-component">
128
129        <delete dir="components/tmp/ant"/>
130        <mkdir dir="components/tmp/ant"/>
131
132        <copy todir="components/tmp/ant" overwrite="true">
133            <fileset dir="distribution/greenstone3/packages">
134                <include name="ant/**/*"/>
135            </fileset>
136        </copy>
137       
138        <zip destfile="components/ant.comp" basedir="components/tmp/ant" compress="false" />
139    </target>
140       
141    <target name="compress-ant-component">
142        <sevenzip task="encode" input="components/ant.comp" output="components/ant.lzma" dictionnary="26"/>
143    </target>
144   
145    <!-- tomcat -->
146    <target name="prepare-tomcat-component">
147
148        <delete dir="components/tmp/tomcat"/>
149        <mkdir dir="components/tmp/tomcat"/>
150
151        <copy todir="components/tmp/tomcat" overwrite="true">
152            <fileset dir="distribution/greenstone3/packages">
153                <include name="tomcat/**/*"/>
154            </fileset>
155        </copy>
156       
157        <zip destfile="components/tomcat.comp" basedir="components/tmp/tomcat" compress="false" />
158    </target>
159       
160    <target name="compress-tomcat-component">
161        <sevenzip task="encode" input="components/tomcat.comp" output="components/tomcat.lzma" dictionnary="26"/>
162    </target>
163
164    <!-- imagemagick -->
165    <target name="prepare-imagemagick-component">
166
167        <delete dir="components/tmp/imagemagick"/>
168        <mkdir dir="components/tmp/imagemagick"/>
169
170        <copy todir="components/tmp/imagemagick" overwrite="true">
171            <fileset dir="distribution/greenstone3/gs2build/bin/darwin">
172                <include name="imagemagick/**/*"/>
173            </fileset>
174        </copy>
175               
176        <zip destfile="components/imagemagick.comp" basedir="components/tmp/imagemagick" compress="false" includes="**/*"/>
177    </target>
178       
179    <target name="compress-imagemagick-component">
180        <sevenzip task="encode" input="components/imagemagick.comp" output="components/imagemagick.lzma" dictionnary="26"/>
181    </target>
182   
183    <!-- ghostscript -->
184    <target name="prepare-ghostscript-component">
185
186        <delete dir="components/tmp/ghostscript"/>
187        <mkdir dir="components/tmp/ghostscript"/>
188
189        <copy todir="components/tmp/ghostscript" overwrite="true">
190            <fileset dir="distribution/greenstone3/gs2build/bin/darwin">
191                <include name="ghostscript/**/*"/>
192            </fileset>
193        </copy>
194               
195        <zip destfile="components/ghostscript.comp" basedir="components/tmp/ghostscript" compress="false" includes="**/*"/>
196    </target>
197       
198    <target name="compress-ghostscript-component">
199        <sevenzip task="encode" input="components/ghostscript.comp" output="components/ghostscript.lzma" dictionnary="26"/>
200    </target>
201
202</project>
Note: See TracBrowser for help on using the browser.