Revision 42745 trunk/org.gvsig.desktop/org.gvsig.desktop.installer/org.gvsig.desktop.installer.izpack/src/main/scripts/Helper.groovy
Helper.groovy | ||
---|---|---|
264 | 264 |
|
265 | 265 |
} |
266 | 266 |
|
267 |
def expand(s) { |
|
268 |
|
|
269 |
def t = "target/portable/gvSIG-desktop-"+this.getVersionWithoutBuildNumber() |
|
270 |
def install_path = new File(project.basedir, t).getAbsolutePath() |
|
271 |
s = s.replace("\${product.folder}",this.getInstallationFolder().getAbsolutePath()) |
|
272 |
s = s.replace("\${INSTALL_PATH}",install_path) |
|
273 |
s = s.replace("\$INSTALL_PATH",install_path) |
|
274 |
return s |
|
275 |
} |
|
276 |
|
|
277 |
def prepare_portable() { |
|
278 |
|
|
279 |
def t = "target/portable/gvSIG-desktop-"+this.getVersionWithoutBuildNumber() |
|
280 |
def install_path = new File(project.basedir, t).getAbsoluteFile() |
|
281 |
install_path.mkdirs() |
|
282 |
|
|
283 |
def target = new File(project.basedir, "target") |
|
284 |
def installfile = new File(target,"install.xml") |
|
285 |
def install = new XmlSlurper().parse(installfile) |
|
286 |
install.packs.each { |
|
287 |
it.pack.each { |
|
288 |
it.file.each { |
|
289 |
def src = new File(expand(it.@src.text())) |
|
290 |
if( !src.isAbsolute() ) { |
|
291 |
src = new File(target,src.getPath()) |
|
292 |
} |
|
293 |
def targetdir = expand(it.@targetdir.text()) |
|
294 |
this.copyFileToDir(src,targetdir) |
|
295 |
} |
|
296 |
it.fileset.each { |
|
297 |
def src = new File(expand(it.@dir.text())) |
|
298 |
if( !src.isAbsolute() ) { |
|
299 |
src = new File(target,src.getPath()) |
|
300 |
} |
|
301 |
def targetdir = expand(it.@targetdir.text()) |
|
302 |
this.copyDirToDir(src,targetdir) |
|
303 |
} |
|
304 |
it.executable.each { |
|
305 |
def targetfile = new File(expand(it.@targetfile.text())) |
|
306 |
targetfile.setExecutable(true) |
|
307 |
} |
|
308 |
} |
|
309 |
} |
|
310 |
|
|
311 |
this.copyDirToDir( |
|
312 |
this.getInstallationFolder("gvSIG/extensiones/org.gvsig.coreplugin.app.mainplugin"), |
|
313 |
new File(install_path,"gvSIG/extensiones/org.gvsig.coreplugin.app.mainplugin") |
|
314 |
) |
|
315 |
this.copyDirToDir( |
|
316 |
this.getInstallationFolder("gvSIG/extensiones/org.gvsig.installer.app.mainplugin"), |
|
317 |
new File(install_path,"gvSIG/extensiones/org.gvsig.installer.app.mainplugin") |
|
318 |
) |
|
319 |
} |
|
320 |
|
|
321 |
def pack_portable() { |
|
322 |
|
|
323 |
def t = "target/portable/gvSIG-desktop-"+this.getVersionWithoutBuildNumber() |
|
324 |
def install_path = new File(project.basedir, t).getAbsoluteFile() |
|
325 |
def target = new File(project.basedir, "target") |
|
326 |
|
|
327 |
def portablezip = new File(target,this.getInstallerName( |
|
328 |
"-" + |
|
329 |
project.properties["installer_os"] + |
|
330 |
"-" + |
|
331 |
project.properties["installer_architecture"] + |
|
332 |
"-online.zip" |
|
333 |
)) |
|
334 |
|
|
335 |
this.ant.zip( |
|
336 |
destfile: portablezip, |
|
337 |
basedir: install_path |
|
338 |
) |
|
339 |
} |
|
340 |
|
|
267 | 341 |
} |
Also available in: Unified diff