Statistics
| Revision:

root / trunk / extensions / extPublish / install / build.xml @ 30883

History | View | Annotate | Download (11.9 KB)

1
<project name="distibucion-gvSIG-plugin" default="all" basedir=".">
2

    
3
        <dirname file="${ant.file.distibucion-gvSIG-plugin}" property="base_dir"/>
4
        <dirname file="${base_dir}" property="proyect_dir"/>
5
        <dirname file="${proyect_dir}" property="workspace_dir"/>
6

    
7
        <taskdef resource="net/sf/antcontrib/antcontrib.properties">
8
                <classpath>
9
                        <pathelement location="${workspace_dir}/binaries/ant/ant-contrib-1.0b3.jar"/> <!--CAMBIAR SEGUN DONDE SE COLOQUEN FINALMENTE LOS JARS-->
10
                </classpath>
11
        </taskdef>
12

    
13
        <taskdef resource="net/sf/antcontrib/antlib.xml">
14
                <classpath>
15
                        <pathelement location="${workspace_dir}/binaries/ant/ant-contrib-1.0b3.jar"/> <!--CAMBIAR SEGUN DONDE SE COLOQUEN FINALMENTE LOS JARS-->
16
                </classpath>
17
        </taskdef>
18

    
19
        <target name="init">
20
                <izpack input="install.xml"
21
                                output="${JARNAME}"
22
                                installerType="standard"
23
                                basedir="${base_dir}"
24
                                izPackDir="${izpack_dir}/"/>
25
        </target>
26

    
27

    
28
        <property file="distribucion.properties"/>
29
        <property file="${workspace_dir}/_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/build.number" prefix="gvSIG."/>
30
        <property file="${proyect_dir}/build.number"/>
31

    
32
        <property name="dir_inst" location="/usr/local"/>
33
        <!--<property name="base_dir" location="./"/>                -->
34
        <property name="izpack_dir" location="${workspace_dir}/install/IzPack"/>
35
        <property name="dir_libs" location="${izpack_dir}/lib"/>
36

    
37

    
38
        <property name="GVSIG_INSTALLDIR" location="${workspace_dir}/install"/>
39
        <property name="ANDAMI_DIR" location="${workspace_dir}/_fwAndami"/>
40
        <property name="INSTALLER_DIR" value="${APPNAME}-${version}_installer"/>
41
        <property name="JARNAME" value="${APPNAME}-${version}.jar"/>
42
        <property name="DIR_LIN_GVSIG" location="${GVSIG_INSTALLDIR}/instalador-gvSIG-lin"/>
43
        <property name="DIR_WIN_GVSIG" location="${GVSIG_INSTALLDIR}/instalador-gvSIG-win"/>
44
        <property name="baseFileName" value="${APPNAME}-${gvSIG.version}_${gvSIG.build.number}_${build.number}"/>
45
        <property name="WINDOWSZIP" value="${baseFileName}-windows-i586.7z" />
46
        <property name="LINUXBIN" value="${baseFileName}-linux-i586.bin"/>
47
        <property name="WINDOWSEXE" value="${baseFileName}-windows-i586.exe"/>
48
        <property name="MAC_10_ZIP" value="${baseFileName}-mac-10_4.zip"/>
49
        <property name="autoinstalador" value="${baseFileName}_Instaler" />
50
        <property name="OUTPUT_DIR" location="./tmp/versiones/v${version}/${build.number}"/> <!--CAMBIAR ESTO SEGUN DIRECTORIO OUTPUT -->
51

    
52
        <condition property="LAUNCHER7Z" value="${GVSIG_INSTALLDIR}/launcher/7z/7za" else="${GVSIG_INSTALLDIR}/launcher/7z/7z.exe">
53
                <os family="unix" />
54
        </condition>
55

    
56
        <taskdef name="izpack" classpath="${dir_libs}/compiler.jar" classname="com.izforge.izpack.ant.IzPackTask"/>
57

    
58

    
59
        <condition property="Lang.Is.Spanish">
60
                <contains string="${env.LANG}" substring="es"/>
61
        </condition>
62
        <condition property="directorio.base">
63
                <available file="${base_dir}/install.xml" type="file" />
64
        </condition>
65

    
66
        <target name="E_Spanish" if="Lang.Is.Spanish">
67
                <property name="ERROR_BASEDIR" value="En el directorio ${base_dir} no se encuentra el fichero install.xml" />
68
        </target>
69

    
70
        <target name="E_notSpanish" unless="Lang.Is.Spanish">
71
                <property name="ERROR_BASEDIR" value="Cannot find install.xml in ${base_dir} folder " />
72
        </target>
73

    
74
        <target name="check" depends="E_Spanish,E_notSpanish">
75
                <fail message="${ERROR_BASEDIR}" unless="directorio.base"/>
76
                <condition property="generate_jar">
77
                        <or>
78
                                <isset property="make_linux"/>
79
                                <isset property="make_win"/>
80
                        </or>
81
                </condition>
82
        </target>
83

    
84
        <target name="all" depends="make_linux_on,make_win_on,make_mac_on,run">
85
        </target>
86

    
87
        <target name="make_linux_on">
88
                <property name="make_linux" value="true"/>
89
        </target>
90

    
91
        <target name="make_win_on">
92
                <property name="make_win" value="true"/>
93
        </target>
94

    
95
        <target name="make_mac_on">
96
                <property name="make_mac" value="true"/>
97
        </target>
98

    
99

    
100
        <target name="run" depends="check,CopyFiles,clean_default_excludes,CreateJar,Install_Linux,Install_Win,Install_Mac,Generate_sources,CleanDir,result_info" >
101

    
102
        </target>
103

    
104
        <target name="clean_default_excludes">
105
                <for list="${base_dir}/tmpResources,extensiones,bin"
106
                        param="toClean"
107
                        keepgoing="true"
108
                        delimiter=","
109
                >
110
                        <sequential>
111
                        <delete failonerror="false" verbose="true">
112
                                <fileset dir="@{toClean}">
113
                                        <include name="**/.svn"/>
114
                                        <include name="**/CSV"/>
115
                                </fileset>
116
                        </delete>
117
                        </sequential>
118
                </for>
119

    
120

    
121
        </target>
122

    
123
        <target name="result_info">
124
                <echo>
125
                        *************************************************
126

    
127
                        **** Generados los paquetes en ${OUTPUT_DIR} ****
128

    
129
                        *************************************************
130
                </echo>
131
        </target>
132

    
133
        <target name="Generate_sources">
134
                <mkdir dir="${base_dir}/tmp_src"/>
135
                <ant antfile="${proyect_dir}/build.xml"
136
                        inheritall="false"
137
                        target="generate-source-package">
138
                        <property name="dist-src" value="${base_dir}/tmp_src"/>
139
                        <property name="build.number" value="${build.number}"/>
140
                </ant>
141
                <move todir="${OUTPUT_DIR}" failonerror="false">
142
                        <fileset dir="${base_dir}/tmp_src" includes="*src*.zip"/>
143
                </move>
144
        </target>
145

    
146

    
147
        <target name="CopyFiles"
148
                if="generate_jar"
149
                description="Copia de ficheros de librerias y de las extensiones necesarias"
150
        >
151
                <delete dir="${base_dir}/bin"/>
152
                <copy file="${base_dir}/resources/gpl.txt" todir="./bin"/>
153
                <mkdir dir="${base_dir}/bin/lib"/>
154
<!--                 copiamos los jar y zip que tenemos en _fwAndami/lib                 -->
155
                <copy todir="${base_dir}/bin/lib">
156
                        <fileset dir="${ANDAMI_DIR}/lib">
157
                                <include name="*.jar"/>
158
                                <include name="*.zip"/>
159
                        </fileset>
160
                </copy>
161

    
162
                <copy todir="${base_dir}/bin" file="${ANDAMI_DIR}/andami.jar"/>
163
                <copy todir="${base_dir}/bin" file="${ANDAMI_DIR}/castor.properties"/>
164

    
165
<!--                 PARA WINDOWS -->
166

    
167
                <if>
168
                        <isset property="make_win"/>
169
                        <then>
170
                                <delete dir="${base_dir}/tmpResources"/>
171
                                <mkdir dir="${base_dir}/tmpResources" />
172

    
173
                <!--         Copiamos el lanzador y sus traduciones al tmpResources,sin copiar el ini, manifest y los CVS (ANT excluye carpetas CVS por defecto -->
174
                                <copy todir="${base_dir}/tmpResources">
175
                                        <fileset dir="${GVSIG_INSTALLDIR}/launcher/izpack-launcher-1.3/dist/">
176
                                                <include name="**/"/>
177
                                                <exclude name="**/*.ini"/>
178
                                                <exclude name="**/*.manifest"/>
179
                                                <exclude name="**/.svn"/>
180
                                        </fileset>
181
                                </copy>
182
                                <move file="${base_dir}/tmpResources/launcher-Win32.exe" tofile="./tmpResources/gvSIG.exe"/>
183
                        </then>
184
                </if>
185

    
186

    
187

    
188

    
189
                <for list="${EXTENSIONS}" param="extensions">
190
                        <sequential>
191
                                <copy todir="${base_dir}/extensiones/@{extensions}">
192
                                        <fileset dir="${ANDAMI_DIR}/gvSIG/extensiones/@{extensions}"/>
193
                                </copy>
194
                                <echo>extension ----> @{extensions} </echo>
195
                        </sequential>
196
                </for>
197

    
198
        </target>
199

    
200
        <target name="CreateJar"
201
                description="Generacion del instalador Jar"
202
                if="generate_jar"
203
                >
204
                <izpack input="${base_dir}/install.xml"
205
                        output="${base_dir}/${JARNAME}"
206
                        installerType="standard"
207
                        basedir="${base_dir}"
208
                        izPackDir="${izpack_dir}/"/>
209
        </target>
210
<!--                 generar el tar.gz para linux -->
211
        <target name="Install_Linux"
212
                description="Generacion de la distribucion"
213
                if="make_linux"
214
                >
215

    
216
                <mkdir dir="${OUTPUT_DIR}" />
217
                <delete dir="${base_dir}/${INSTALLER_DIR}"/>
218
                <mkdir dir="${base_dir}/${INSTALLER_DIR}/tmp_gvSIGInstall"/>
219
                <copy file="${base_dir}/${JARNAME}" todir="./${INSTALLER_DIR}/tmp_gvSIGInstall"/>
220

    
221
<!--                 carpetas CVS no se copiaran, ANT las excluye por defecto -->
222
                <copy todir="${base_dir}/${INSTALLER_DIR}/tmp_gvSIGInstall">
223
                        <fileset dir="${GVSIG_INSTALLDIR}/launcher/izpack-launcher-1.3_linux/dist/"/>
224
                </copy>
225
                <delete file="${base_dir}/${INSTALLER_DIR}/tmp_gvSIGInstall/launcher.ini"/>
226
                <copy
227
                        tofile="${base_dir}/${INSTALLER_DIR}/tmp_gvSIGInstall/launcher.ini"
228
                        file="${DIR_LIN_GVSIG}/resources/launcher.ini.j15"
229
                        />
230

    
231

    
232

    
233
                <chmod file="${base_dir}/${INSTALLER_DIR}/tmp_gvSIGInstall/launcher-Linux" perm="ugo+rx"/>
234
                <replace file="${base_dir}/${INSTALLER_DIR}/tmp_gvSIGInstall/launcher.ini" token="%JARNAME%" value="${JARNAME}"/>
235

    
236
<!--                 comprimimos la carpeta tmp_gvSIGInstall en tmp.tgz  -->
237
                <tar destfile="${base_dir}/${INSTALLER_DIR}/tmp.tgz"  compression="gzip">
238
                        <tarfileset dir="${base_dir}/${INSTALLER_DIR}" mode="755" >
239
                                <include name="tmp_gvSIGInstall/launcher-Linux"/>
240
                        </tarfileset>
241
                        <tarfileset dir="${base_dir}/${INSTALLER_DIR}">
242
                                <include name="tmp_gvSIGInstall/*"/>
243
                                <exclude name="tmp_gvSIGInstall/launcher-Linux"/>
244
                        </tarfileset>
245
                </tar>
246
                <echo message="#!/bin/sh${line.separator}" file="./${INSTALLER_DIR}/xx.tmp" />
247
                <echo message="lcount=59${line.separator}" file="./${INSTALLER_DIR}/xx.tmp" append="true" /> <!-- OJO SI SE TOCA EL FICHERO h_gvSIG-install.sh - 59 -> num de lineas del fichero + 2 -->
248
                <concat destfile="${base_dir}/${INSTALLER_DIR}/${LINUXBIN}" binary="true" >
249
                        <fileset file="${base_dir}/${INSTALLER_DIR}/xx.tmp"/>
250
                        <fileset file="${GVSIG_INSTALLDIR}/launcher/izpack-launcher-1.3_linux/h_gvSIG-install.sh"/>
251
                        <fileset file="${base_dir}/${INSTALLER_DIR}/tmp.tgz"/>
252
                </concat>
253
                <chmod file="${base_dir}/${INSTALLER_DIR}/${LINUXBIN}" perm="ugo+rx"/>
254
                <delete file="${base_dir}/${INSTALLER_DIR}/xx.tmp"/>
255
                <move file="${base_dir}/${INSTALLER_DIR}/${LINUXBIN}" todir="${OUTPUT_DIR}" />
256
                <chmod file="${OUTPUT_DIR}/${LINUXBIN}" perm="ugo+rx"/>
257
                <delete dir="${base_dir}/${INSTALLER_DIR}"/>
258

    
259
                </target>
260

    
261
                <target name="Install_Win" description="Generacion de la distribucion">
262

    
263

    
264
                <delete dir="${base_dir}/${INSTALLER_DIR}"/>
265
                <mkdir dir="${base_dir}/${INSTALLER_DIR}"/>
266
                <copy todir="${base_dir}/${INSTALLER_DIR}">
267
                        <fileset dir="${GVSIG_INSTALLDIR}/launcher/izpack-launcher-1.3/dist"/>
268
                </copy>
269
                <delete file="${base_dir}/${INSTALLER_DIR}/launcher-Win32.ini"/>
270
                <copy file="${DIR_WIN_GVSIG}/resources/launcher-Win32.ini.j15"
271
                        tofile="${base_dir}/${INSTALLER_DIR}/launcher-Win32.ini"/>
272
                <replace file="${base_dir}/${INSTALLER_DIR}/launcher-Win32.ini" token="%JARNAME%" value="${JARNAME}"/>
273
                <move file="${base_dir}/${JARNAME}" todir="./${INSTALLER_DIR}"/>
274
                <delete file="${base_dir}/${WINDOWSZIP}"/>
275
                <exec executable="${LAUNCHER7Z}">
276
                        <arg line="a -r ${WINDOWSZIP} ./${INSTALLER_DIR}/*"/>
277
                </exec>
278
                <copy file="${GVSIG_INSTALLDIR}/launcher/7z/dist_config.txt" tofile="./dist_config.txt"/>
279
                <replace file="${base_dir}/dist_config.txt" token="%TITLE%" value="${APPNAME}-${bversion}_${build.number}" />
280
                <concat destfile="${base_dir}/${WINDOWSEXE}" binary="true">
281
                        <fileset file="${GVSIG_INSTALLDIR}/launcher/7z/7zS.sfx"/>
282
                        <fileset file="${base_dir}/dist_config.txt"/>
283
                        <fileset file="${base_dir}/${WINDOWSZIP}"/>
284
                </concat>
285
                <move file="${WINDOWSEXE}" todir="${OUTPUT_DIR}"/>
286
        </target>
287

    
288
        <target name="Install_Mac"
289
                        description="Actualizador para MAC"
290
                        if="make_mac"
291
                        >
292

    
293
                <copy todir="${GVSIG_INSTALLDIR}/instalador-gvSIG-mac/actualizador.app/Contents/Resources/updates/gvSIGbin/gvSIG/extensiones/${MAIN_INSTALL_PLUGIN}">
294
                        <fileset dir="${ANDAMI_DIR}/gvSIG/extensiones/${MAIN_INSTALL_PLUGIN}/"/>
295
                </copy>
296

    
297
                <copy todir="${GVSIG_INSTALLDIR}/instalador-gvSIG-mac/actualizador.app/Contents/Resources/updates/gvSIGbin/gvSIG/extensiones/com.iver.cit.gvsig/lib">
298
                        <fileset file="${ANDAMI_DIR}/gvSIG/extensiones/com.iver.cit.gvsig/lib/gvsig-annotation.jar"/>
299
                </copy>
300

    
301
                <ant antfile="build-updater.xml" dir="${GVSIG_INSTALLDIR}/instalador-gvSIG-mac">
302
                        <property name="NOMBRE_BUNDLE" value="${autoinstalador}"/>
303
                </ant>
304

    
305
                <zip destfile="${OUTPUT_DIR}/${MAC_10_ZIP}" basedir="${GVSIG_INSTALLDIR}/instalador-gvSIG-mac" includes="${autoinstalador}.app/**"/>
306

    
307
                <delete dir="${GVSIG_INSTALLDIR}/instalador-gvSIG-mac/${autoinstalador}.app"/>
308
                <delete dir="${GVSIG_INSTALLDIR}/instalador-gvSIG-mac/actualizador.app/Contents/Resources/updates/gvSIGbin" />
309

    
310
        </target>
311

    
312
        <target name="CleanDir" description="Limpiamos los directorios creados">
313

    
314
                <delete file="${base_dir}/${WINDOWSZIP}"  failonerror="false"/>
315
                <delete file="${base_dir}/dist_config.txt"  failonerror="false"/>
316
                <delete dir="${base_dir}/${INSTALLER_DIR}"  failonerror="false"/>
317
                <delete dir="${base_dir}/tmpResources"  failonerror="false"/>
318
                <delete dir="extensiones"  failonerror="false"/>
319
                <delete dir="bin"  failonerror="false"/>
320
                <delete dir="${base_dir}/tmp_src" failonerror="false"/>
321
        </target>
322

    
323
</project>