Révision 3650
TXM/trunk/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java (revision 3650) | ||
---|---|---|
4 | 4 |
import java.io.IOException; |
5 | 5 |
import java.util.Date; |
6 | 6 |
|
7 |
import org.eclipse.core.runtime.Platform; |
|
7 | 8 |
import org.eclipse.osgi.util.NLS; |
8 | 9 |
import org.txm.PostTXMHOMEInstallationStep; |
9 | 10 |
import org.txm.Toolbox; |
... | ... | |
106 | 107 |
|
107 | 108 |
File backUserDirectory = new File(parentFiletoUse, directorytoBackUp.getName()+"-"+Toolbox.dateformat.format(new Date())); |
108 | 109 |
int nBackupedFiles = 0; |
110 |
|
|
109 | 111 |
long updateTime = BundleUtils.getDate(bundle_id); |
112 |
if (Platform.inDevelopmentMode()) updateTime = Long.MAX_VALUE; // don't recopy the groovy files in dev mode |
|
113 |
|
|
110 | 114 |
// System.out.println("update time: "+updateTime+" of "+bundle_id); |
111 | 115 |
for (File f : DeleteDir.scanDirectory(directorytoBackUp, true, true)) { |
112 | 116 |
long t = f.lastModified(); |
113 | 117 |
|
114 |
if (f.isFile() && f.getName().endsWith(".groovy") && t > updateTime) { |
|
118 |
if (f.isFile() && f.getName().endsWith(".groovy") && t > updateTime) { // backup the file if it was modified by the user
|
|
115 | 119 |
|
116 | 120 |
String path = f.getAbsolutePath(); |
117 | 121 |
path = path.substring(directorytoBackUp.getAbsolutePath().length()); |
TXM/trunk/org.txm.core/src/java/org/txm/PostTXMHOMEInstallationStep.java (revision 3650) | ||
---|---|---|
36 | 36 |
Log.fine(TXMCoreMessages.bind("{0} installed version: {1}.", getName(), extinstalledVersion)); |
37 | 37 |
//System.out.println("Toolbox.startWorkspace(): workspace location = " + location); |
38 | 38 |
boolean extDoUpdateworkspace = extcurrentVersion.compareTo(extinstalledVersion) > 0; |
39 |
if (needsReinstall(workspace) || extDoUpdateworkspace || "org.txm.groovy.core".equals(bundle_id)) {
|
|
39 |
if (needsReinstall(workspace) || extDoUpdateworkspace) { // || "org.txm.groovy.core".equals(bundle_id)
|
|
40 | 40 |
Log.finer("Installing extension "+getName()+" reasons: workspace or extDoUpdateworkspace="+extDoUpdateworkspace); |
41 | 41 |
if (do_install(workspace)) { |
42 | 42 |
Toolbox.setPreference(getName(), extcurrentVersion.toString()); // SAVE the installed version |
Formats disponibles : Unified diff