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