Revision 672
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.lib/org.gvsig.scripting.lib.impl/src/main/java/org/gvsig/scripting/impl/ScriptingInstallerProvider.java | ||
---|---|---|
25 | 25 |
import java.io.File; |
26 | 26 |
import java.io.IOException; |
27 | 27 |
import java.io.InputStream; |
28 |
import java.util.Iterator; |
|
28 | 29 |
import org.apache.commons.io.FileUtils; |
29 | 30 |
|
30 | 31 |
import org.gvsig.installer.lib.api.PackageInfo; |
... | ... | |
63 | 64 |
installerProviderManager.createInstallerProviderServices(); |
64 | 65 |
|
65 | 66 |
installerProviderServices.decompress(inputStream, target); |
67 |
|
|
68 |
// Ajustamos las fechas de modificacion de los ficheros de forma que |
|
69 |
// los fuentes sean mas nuevos que los binarios. |
|
70 |
// Esto forzara que se recompilen la primera vez que se ejecuten. |
|
71 |
// Si no hacemos esto y las fecha de los binarios son futuras, aunque |
|
72 |
// se editen y cambien los fuentes nunca se reccompilaran. |
|
73 |
Iterator<File> it = FileUtils.iterateFiles(target, new String[] {"class"}, true); |
|
74 |
while( it.hasNext() ) { |
|
75 |
File f = it.next(); |
|
76 |
try { |
|
77 |
FileUtils.touch(f); |
|
78 |
} catch (IOException e) { |
|
79 |
// Do nothing |
|
80 |
} |
|
81 |
} |
|
82 |
it = FileUtils.iterateFiles(target, new String[] {"py","r","scala","groovy"}, true); |
|
83 |
while( it.hasNext() ) { |
|
84 |
File f = it.next(); |
|
85 |
try { |
|
86 |
FileUtils.touch(f); |
|
87 |
} catch (IOException e) { |
|
88 |
// Do nothing |
|
89 |
} |
|
90 |
} |
|
66 | 91 |
|
67 | 92 |
} catch (Exception e) { |
68 | 93 |
throw new InstallPackageServiceException(e); |
Also available in: Unified diff