Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Noyrit2015-11-10 13:11:50 -0500
committerGerrit Code Review @ Eclipse.org2015-11-12 06:44:59 -0500
commit9f730d61b2ecda12352364361cb687cf8269bae1 (patch)
tree1bf7b06fee512ed8e3ec76de952a6d9ed6bdcec2 /plugins/developer/org.eclipse.papyrus.releng.tools
parent582bffce7012cf3aca73cdb7be434ef1f3e17f73 (diff)
downloadorg.eclipse.papyrus-9f730d61b2ecda12352364361cb687cf8269bae1.tar.gz
org.eclipse.papyrus-9f730d61b2ecda12352364361cb687cf8269bae1.tar.xz
org.eclipse.papyrus-9f730d61b2ecda12352364361cb687cf8269bae1.zip
[releng] Factorize repositories definitions to root pom. Add a
dependency Updater to update properties-based repository definitions Change-Id: Ia520feeeb83e4617f02a795851e772b50f00b0b2 Signed-off-by: Florian Noyrit <florian.noyrit@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/popup/actions/PomPropertiesUpdater.java51
1 files changed, 51 insertions, 0 deletions
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
new file mode 100644
index 00000000000..94fdc097862
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomPropertiesUpdater.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus - Support updating of multiple selected files
+ *****************************************************************************/
+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;
+
+
+public class PomPropertiesUpdater extends DependencyUpdater {
+
+ public PomPropertiesUpdater() {
+ super();
+ }
+
+ @Override
+ public boolean canUpdate(IFile file) {
+ return "xml".equals(file.getFileExtension()) && file.getName().contains("pom"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Override
+ protected String getXpath() {
+ return "/project/properties/*[substring(name(), string-length(name()) - 8) = '.repo.url']"; //$NON-NLS-1$
+ }
+
+ @Override
+ protected String getCurrentLocation(Node uri) {
+ return uri.getTextContent();
+ }
+
+ @Override
+ protected void updateUri(Node uri, String location) {
+ uri.setTextContent(location);
+ }
+
+}

Back to the top