Statistics
| Revision:

svn-gvsig-desktop / tmp / trunk / cliente / WorkSpace_WPSClient / extWPSCallejero / install / buildExt.xml @ 26572

History | View | Annotate | Download (11.3 KB)

1
<project name="instalador-gvSIG" default="init" basedir=".">
2
        
3
        <dirname file="${ant.file.instalador-gvSIG}" property="base_dir"/>
4
        <dirname file="${base_dir}" property="project_dir"/>
5
        <dirname file="${project_dir}" property="workspace_dir"/>
6
        
7
        <import file="${workspace_dir}/binaries/ant/utilities.xml"/>
8
        
9
        <property file="build.properties"/>
10
        <!-- GVSIG_INSTALL_DIR se refiere a la variable ant en Windows-Preferences-Ant-Runtime-Properties -->
11
        <property file="${GVSIG_INSTALL_DIR}/bin/gvSIG/extensiones/com.iver.cit.gvsig/build.number" prefix="gvSIG."/>
12
        <property file="${project_dir}/build.number"/>
13
        
14
        <property name="dir_inst" location="/usr/local"/>
15
        <!--<property name="base_dir" location="./"/>                -->
16
        <property name="izpack_dir" location="${workspace_dir}/install/IzPack"/>
17
        <property name="dir_libs" location="${izpack_dir}/lib"/>
18
                
19
        <property name="THIS_INSTALLDIR" location="${workspace_dir}/install"/>
20
        <property name="ANDAMI_DIR" location="${GVSIG_SRC_DIR}/_fwAndami"/>
21
        <property name="INSTALLER_DIR" value="${APPNAME}-${version}_installer"/>
22
        <property name="JARNAME" value="${APPNAME}-${version}.jar"/>
23
        <property name="DIR_LIN_GVSIG" location="${THIS_INSTALLDIR}/instalador-gvSIG-lin"/>
24
        <property name="DIR_WIN_GVSIG" location="${THIS_INSTALLDIR}/instalador-gvSIG-win"/>
25
        <property name="baseFileName" value="${APPNAME}-${gvSIG.version}-${gvSIG.build.number}_${build.number}"/>
26
        <property name="WINDOWSZIP" value="${baseFileName}-windows-i586.7z" />
27
        <property name="LINUXBIN" value="${baseFileName}-linux-i586.bin"/>
28
        <property name="WINDOWSEXE" value="${baseFileName}-windows-i586.exe"/>
29
        <property name="MAC_10_ZIP" value="${baseFileName}-mac-10_4.zip"/>
30
        <property name="autoinstalador" value="${APPNAME}_Installer" />
31
        <property name="OUTPUT_DIR" location="/tmp/extWPSCallejero/v${version}/${build.number}"/> <!--CAMBIAR ESTO SEGUN DIRECTORIO OUTPUT -->
32
        
33
        <condition property="LAUNCHER7Z" value="${THIS_INSTALLDIR}/launcher/7z/7za" else="${THIS_INSTALLDIR}/launcher/7z/7z.exe">
34
                <os family="unix" />
35
        </condition>
36
        
37
        <taskdef name="izpack" classpath="${dir_libs}/compiler.jar" classname="com.izforge.izpack.ant.IzPackTask"/>
38
        
39
        
40
        <condition property="Lang.Is.Spanish">
41
                <contains string="${env.LANG}" substring="es"/>
42
        </condition>
43
        <condition property="directorio.base">
44
                <available file="${base_dir}/install.xml" type="file" />
45
        </condition>
46
        
47
        <target name="E_Spanish" if="Lang.Is.Spanish">
48
                <property name="ERROR_BASEDIR" value="En el directorio ${base_dir} no se encuentra el fichero install.xml" />
49
        </target>
50
        
51
        <target name="E_notSpanish" unless="Lang.Is.Spanish">
52
                <property name="ERROR_BASEDIR" value="Cannot find install.xml in ${base_dir} folder " />
53
        </target>
54
        
55
        <target name="check" depends="E_Spanish,E_notSpanish">
56
                <fail message="${ERROR_BASEDIR}" unless="directorio.base"/>
57
        </target>
58
        
59
        
60
        
61
        <target name="init" depends="check,CopyFiles,CreateJar,Installation,InstallMac,CleanDir" >
62
                
63
        </target>
64
        <target name="CopyFiles" description="Copia de ficheros de librerias y de las extensiones necesarias">
65
                <delete dir="${base_dir}/bin"/>
66
                <copy file="${base_dir}/resources/gpl.txt" todir="./bin"/>
67
                <mkdir dir="${base_dir}/bin/lib"/>
68
                <!--                 copiamos los jar y zip que tenemos en _fwAndami/lib                 -->
69
                <copy todir="${base_dir}/bin/lib">
70
                        <fileset dir="${ANDAMI_DIR}/lib">
71
                                <include name="*.jar"/>
72
                                <include name="*.zip"/>
73
                        </fileset>
74
                </copy>
75
                
76
                <copy todir="${base_dir}/bin" file="${ANDAMI_DIR}/andami.jar"/>
77
                <copy todir="${base_dir}/bin" file="${ANDAMI_DIR}/castor.properties"/>
78
                
79
                <!--                 PARA WINDOWS -->
80
                
81
                
82
                <delete dir="${base_dir}/tmpResources"/>
83
                <mkdir dir="${base_dir}/tmpResources" />
84
                
85
                <!--         Copiamos el lanzador y sus traduciones al tmpResources,sin copiar el ini, manifest y los CVS (ANT excluye carpetas CVS por defecto -->
86
                <copy todir="${base_dir}/tmpResources">
87
                        <fileset dir="${THIS_INSTALLDIR}/launcher/izpack-launcher-1.3/dist/">
88
                                <include name="**/"/>
89
                                <exclude name="**/*.ini"/>
90
                                <exclude name="**/*.manifest"/>
91
                        </fileset>
92
                </copy>
93
                <move file="${base_dir}/tmpResources/launcher-Win32.exe" tofile="./tmpResources/gvSIG.exe"/>
94
                
95
                
96
                
97
                
98
                <for list="${EXTENSIONS}" param="extensions">
99
                        <sequential>
100
                                <copy todir="${base_dir}/extensiones/@{extensions}">
101
                                        <fileset dir="${GVSIG_INSTALL_DIR}/bin/gvSIG/extensiones/@{extensions}"/>
102
                                </copy>
103
                                <echo>extension ----> @{extensions} </echo>
104
                        </sequential>
105
                </for>
106
        </target>
107
        <target name="CreateJar" description="Generacion del instalador Jar">
108
                <izpack input="${base_dir}/install.xml"
109
                        output="${base_dir}/${JARNAME}"
110
                        installerType="standard"
111
                        basedir="${base_dir}"
112
                        izPackDir="${izpack_dir}/"/>
113
        </target>
114
        <!--                 generar el tar.gz para linux -->
115
        <target name="Installation" description="Generacion de la distribucion">
116
                
117
                <mkdir dir="${OUTPUT_DIR}" />
118
                <delete dir="${base_dir}/${INSTALLER_DIR}"/>
119
                <mkdir dir="${base_dir}/${INSTALLER_DIR}/tmp_gvSIGInstall"/>
120
                <copy file="${base_dir}/${JARNAME}" todir="./${INSTALLER_DIR}/tmp_gvSIGInstall"/>
121
                
122
                <!--                 carpetas CVS no se copiaran, ANT las excluye por defecto -->
123
                <copy todir="${base_dir}/${INSTALLER_DIR}/tmp_gvSIGInstall">
124
                        <fileset dir="${THIS_INSTALLDIR}/launcher/izpack-launcher-1.3_linux/dist/"/>
125
                </copy>
126
                
127
                <chmod file="${base_dir}/${INSTALLER_DIR}/tmp_gvSIGInstall/launcher-Linux" perm="ugo+rx"/>
128
                <delete file="${base_dir}/${INSTALLER_DIR}/tmp_gvSIGInstall/launcher.ini"/>
129
                <copy file="${DIR_LIN_GVSIG}/resources/launcher.ini.j15" tofile="${base_dir}/${INSTALLER_DIR}/tmp_gvSIGInstall/launcher.ini"/>
130
                <replace file="${base_dir}/${INSTALLER_DIR}/tmp_gvSIGInstall/launcher.ini" token="%JARNAME%" value="${JARNAME}"/>
131
                
132
                <!--                 comprimimos la carpeta tmp_gvSIGInstall en tmp.tgz  -->
133
                <tar destfile="${base_dir}/${INSTALLER_DIR}/tmp.tgz"  compression="gzip">
134
                        <tarfileset dir="${base_dir}/${INSTALLER_DIR}" mode="755" >
135
                                <include name="tmp_gvSIGInstall/launcher-Linux"/>
136
                        </tarfileset>
137
                        <tarfileset dir="${base_dir}/${INSTALLER_DIR}">
138
                                <include name="tmp_gvSIGInstall/*"/>
139
                                <exclude name="tmp_gvSIGInstall/launcher-Linux"/>
140
                        </tarfileset>
141
                </tar>
142
                <echo message="#!/bin/sh${line.separator}" file="./${INSTALLER_DIR}/xx.tmp" />
143
                <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 -->
144
    <copy todir="${base_dir}/${INSTALLER_DIR}" file="${THIS_INSTALLDIR}/launcher/izpack-launcher-1.3_linux/h_gvSIG-install.sh"/>
145
  <!-- tocado eof="remove". El original era eof="" pero ant se quejaba. OJO, habrĂ¡ que probarlo en linux -->
146
                
147
            <fixcrlf srcDir="${base_dir}/${INSTALLER_DIR}" includes="h_gvSIG-install.sh,xx.tmp"  eol="unix" eof="remove" />
148
                <concat destfile="${base_dir}/${INSTALLER_DIR}/${LINUXBIN}" binary="true" >
149
                        <fileset file="${base_dir}/${INSTALLER_DIR}/xx.tmp"/>
150
                        <fileset file="${base_dir}/${INSTALLER_DIR}/h_gvSIG-install.sh"/>
151
                        <fileset file="${base_dir}/${INSTALLER_DIR}/tmp.tgz"/>
152
                </concat>
153
                <chmod file="${base_dir}/${INSTALLER_DIR}/${LINUXBIN}" perm="ugo+rx"/>
154
                <delete file="${base_dir}/${INSTALLER_DIR}/xx.tmp"/>
155
                <move file="${base_dir}/${INSTALLER_DIR}/${LINUXBIN}" todir="${OUTPUT_DIR}" />
156
                <delete dir="${base_dir}/${INSTALLER_DIR}"/>
157
                
158
                
159
                
160
                <!--                 PARA WINDOWS  -->
161
                <delete dir="${base_dir}/${INSTALLER_DIR}"/>
162
                <mkdir dir="${base_dir}/${INSTALLER_DIR}"/>
163
                <copy todir="${base_dir}/${INSTALLER_DIR}">
164
                        <fileset dir="${THIS_INSTALLDIR}/launcher/izpack-launcher-1.3/dist"/>
165
                </copy>
166
                <delete file="${base_dir}/${INSTALLER_DIR}/launcher-Win32.ini"/>
167
                <copy todir="${base_dir}/${INSTALLER_DIR}/" file="${DIR_WIN_GVSIG}/resources/launcher-Win32.ini.j15"/>
168
                <move file="${base_dir}/${INSTALLER_DIR}/launcher-Win32.ini.j15" tofile="${base_dir}/${INSTALLER_DIR}/launcher-Win32.ini"/>
169
                <replace file="${base_dir}/${INSTALLER_DIR}/launcher-Win32.ini" token="%JARNAME%" value="${JARNAME}"/>
170
                <move file="${base_dir}/${JARNAME}" todir="./${INSTALLER_DIR}"/>
171
                <delete file="${base_dir}/${WINDOWSZIP}"/>
172
                <exec executable="${LAUNCHER7Z}">
173
                        <arg line="a -r ${WINDOWSZIP} ./${INSTALLER_DIR}/*"/>
174
                </exec>
175
                <copy file="${THIS_INSTALLDIR}/launcher/7z/dist_config.txt" tofile="./dist_config.txt"/>
176
                <replace file="${base_dir}/dist_config.txt" token="%TITLE%" value="${APPNAME}-${bversion}_${build.number}" />
177
                <concat destfile="${base_dir}/${WINDOWSEXE}" binary="true">
178
                        <fileset file="${THIS_INSTALLDIR}/launcher/7z/7zS.sfx"/>
179
                        <fileset file="${base_dir}/dist_config.txt"/>
180
                        <fileset file="${base_dir}/${WINDOWSZIP}"/>
181
                </concat>
182
                <move file="${WINDOWSEXE}" todir="${OUTPUT_DIR}"/>
183
        </target>
184
        
185
        <target name="InstallMac" description="Actualizador para MAC">
186
                <property name="tmp_mac" location="${base_dir}/tmpResources_mac"/>
187
                
188
                <delete dir="${tmp_mac}" failonerror="no"/>
189
                
190
                <mkdir dir="${tmp_mac}"/>
191
                        
192
                <ant antfile="build-updater.xml" dir="${THIS_INSTALLDIR}/instalador-gvSIG-mac">
193
                        <property name="NOMBRE_BUNDLE" value="${autoinstalador}"/>
194
                        <property name="DIR_DESTINO" value="${tmp_mac}"/>
195
                </ant>
196
                
197
                <copy todir="${tmp_mac}/${autoinstalador}.app/Contents/Resources" file="./resources/configfile" overwrite="yes"/>
198
                
199
                <replace file="${tmp_mac}/${autoinstalador}.app/Contents/Resources/configfile"
200
                         token="%BUILD.NUMBER%"
201
                         value="${build.number}"/>
202
                        
203
                <property name="mac_install_path_bin" value="${tmp_mac}/${autoinstalador}.app/Contents/Resources/updates/gvSIGbin"/>
204
                <property name="mac_install_path_gvsig" value="${mac_install_path_bin}/gvSIG"/>
205
                <property name="mac_install_path_ext" value="${mac_install_path_gvsig}/extensiones"/>
206
                        
207
                <!-- Copiar en los directorios los ficheros a instalar:   
208
                     ${mac_install_path_bin} ==> directorio 'bin' de la instalacion (donde esta andami.jar)
209
                     ${mac_install_path_gvsig} ==> directorio 'bin/gvSIG' de la instalacion
210
                     ${mac_install_path_ext} ==> directorio 'bin/gvSIG/extensiones'
211
                     
212
                
213
                
214
                Ejemplos:
215
                
216
                * Actualizar andami.jar:
217
                
218
                <copy todir="${mac_install_path_bin}" file="bin/andami.jar"/>
219
                
220
                
221
                * Copiar una libreria al directorio de lib del plugin de gvSIG:
222
                
223
                <copy todir="${mac_install_path_gvsig}">
224
                        <fileset dir=".">
225
                                <include name="extensiones/com.iver.cit.gvsig/lib/myLib.jar"/>
226
                        </fileset>
227
                </copy>
228
                
229
                * Copiar el directorio entero del plugin 'myPlugin':
230
                     
231
                <copy todir="${mac_install_path_ext}">
232
                        <fileset dir="extensiones">
233
                                <include name="myPlugin/**/**"/>
234
                        </fileset>
235
                </copy>
236

237
                * Copiar todos los ficheros 'about.htm'
238
                <copy todir="${mac_install_path_ext}">
239
                        <fileset dir="extensiones">
240
                                <include name="**/about.htm"/>
241
                        </fileset>
242
                </copy>
243
                
244
                     
245
                     -->
246
                <copy todir="${mac_install_path_ext}">
247
                                                <fileset dir="extensiones">
248
                                                        <include name="${MAIN_INSTALL_PLUGIN}/**/**"/>
249
                                                </fileset>
250
                </copy>
251
        
252
                <zip destfile="${OUTPUT_DIR}/${MAC_10_ZIP}">
253
                        <zipfileset dir="${tmp_mac}"
254
                                    includes="${autoinstalador}.app/**"
255
                                    excludes="${autoinstalador}.app/Contents/MacOS/*"
256
                                    />
257
                        <zipfileset dir="${tmp_mac}"
258
                                    includes="${autoinstalador}.app/Contents/MacOS/*"
259
                                    filemode="755"
260
                                    />
261
                        
262
                </zip>
263
                
264
                <delete dir="${tmp_mac}"/>
265
        </target>
266
        
267
        <target name="CleanDir" description="Limpiamos los directorios creados">
268
                
269
                <delete file="${base_dir}/${WINDOWSZIP}" />
270
                <delete file="${base_dir}/dist_config.txt" />
271
                <delete dir="${base_dir}/${INSTALLER_DIR}" />
272
                <delete dir="${base_dir}/tmpResources" />
273
                <delete dir="extensiones"/>
274
                <delete dir="bin"/>
275
        </target>
276
        
277
</project>