Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2015-12-02 05:57:53 -0500
committerCamille Letavernier2015-12-02 05:57:53 -0500
commit4d09976d36923a0605ad6562681db32a34e9019a (patch)
tree9f33c317032004a522fb3857f0a9473fa599f1c0 /plugins/developer/org.eclipse.papyrus.releng.tools
parent140c16f871f464377c514b328cd0ac8b81e670b0 (diff)
downloadorg.eclipse.papyrus-4d09976d36923a0605ad6562681db32a34e9019a.tar.gz
org.eclipse.papyrus-4d09976d36923a0605ad6562681db32a34e9019a.tar.xz
org.eclipse.papyrus-4d09976d36923a0605ad6562681db32a34e9019a.zip
[Releng] Use a variable for the Eclipse Download Server, to improve
performances when building on the Eclipse build server - The download server is now represented with a variable in the parent POM, so we can access it either via HTTP or filesystem. It could also be used to access a specific mirror - The Dependencies Updater script has been updated accordingly - The Dependenncies Updater script has been fixed to properly update POMs (Regression introduced by the previous change) Change-Id: I5f3df38a8fcbba1a3c706ee3a48e6eee6e367d73 Signed-off-by: Camille Letavernier <camille.letavernier@cea.fr>
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.releng.tools')
-rw-r--r--plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/handler/UpdateDependenciesHandler.java18
-rw-r--r--plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomPropertiesUpdater.java9
-rw-r--r--plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomUpdater.java3
3 files changed, 16 insertions, 14 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/handler/UpdateDependenciesHandler.java b/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/handler/UpdateDependenciesHandler.java
index 03b57af11ce..5acb4b02d11 100644
--- a/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/handler/UpdateDependenciesHandler.java
+++ b/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/handler/UpdateDependenciesHandler.java
@@ -10,7 +10,7 @@
* Camille Letavernier (CEA LIST) - camille.letavernier@cea.fr - Generalize to handle POMs
* Christian W. Damus (CEA) - Add support for updating Oomph setup models
* Christian W. Damus - Support updating of multiple selected files
- *
+ *
*******************************************************************************/
package org.eclipse.papyrus.releng.tools.internal.handler;
@@ -18,6 +18,7 @@ import java.lang.reflect.Modifier;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -201,8 +202,8 @@ public class UpdateDependenciesHandler extends AbstractHandler {
protected boolean updateFile(IFile selectedFile, Aggregation aggregationModel, Shell activeShell, Map<Object, Object> context) throws CoreException {
boolean result = false;
- DependencyUpdater updater = findDependencyUpdater(selectedFile);
- if (updater != null) {
+ List<DependencyUpdater> updaters = findDependencyUpdater(selectedFile);
+ for (DependencyUpdater updater : updaters) {
updater.updateDocument(activeShell, selectedFile, aggregationModel.getAllContributions(true), context);
result = true;
}
@@ -210,9 +211,9 @@ public class UpdateDependenciesHandler extends AbstractHandler {
return result;
}
- protected DependencyUpdater findDependencyUpdater(IFile mapFile) throws CoreException {
+ protected List<DependencyUpdater> findDependencyUpdater(IFile mapFile) throws CoreException {
final String path = "org/eclipse/papyrus/releng/tools/internal/popup/actions/"; //$NON-NLS-1$
- DependencyUpdater result = null;
+
Bundle bundle = Activator.getDefault().getBundle();
// Try dev mode, first
@@ -222,6 +223,8 @@ public class UpdateDependenciesHandler extends AbstractHandler {
urls = bundle.findEntries(path, "*.class", false);
}
+ List<DependencyUpdater> updaters = new LinkedList<>();
+
while (urls.hasMoreElements()) {
URL classURL = urls.nextElement();
URI classURI = URI.createURI(classURL.toExternalForm(), true);
@@ -233,8 +236,7 @@ public class UpdateDependenciesHandler extends AbstractHandler {
if (!Modifier.isAbstract(updaterClass.getModifiers())) {
DependencyUpdater updater = updaterClass.newInstance();
if (updater.canUpdate(mapFile)) {
- result = updater;
- break;
+ updaters.add(updater);
}
}
}
@@ -245,6 +247,6 @@ public class UpdateDependenciesHandler extends AbstractHandler {
}
}
- return result;
+ return updaters;
}
}
diff --git a/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomPropertiesUpdater.java b/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomPropertiesUpdater.java
index 94fdc097862..ba3efab8074 100644
--- a/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomPropertiesUpdater.java
+++ b/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomPropertiesUpdater.java
@@ -12,13 +12,7 @@
*****************************************************************************/
package org.eclipse.papyrus.releng.tools.internal.popup.actions;
-import java.util.Map;
-
-import org.eclipse.b3.aggregator.Contribution;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.swt.widgets.Shell;
import org.w3c.dom.Node;
@@ -45,6 +39,9 @@ public class PomPropertiesUpdater extends DependencyUpdater {
@Override
protected void updateUri(Node uri, String location) {
+ if (location.startsWith("http://download.eclipse.org")) {
+ location = location.replace("http://download.eclipse.org", "${eclipse.download}");
+ }
uri.setTextContent(location);
}
diff --git a/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomUpdater.java b/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomUpdater.java
index 1880d3406c8..9dc7940558f 100644
--- a/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomUpdater.java
+++ b/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomUpdater.java
@@ -39,6 +39,9 @@ public class PomUpdater extends DependencyUpdater {
@Override
protected void updateUri(Node uri, String location) {
+ if (location.startsWith("http://download.eclipse.org")) {
+ location = location.replace("http://download.eclipse.org", "${eclipse.download}");
+ }
uri.setTextContent(location);
}

Back to the top