Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-09-12 10:21:32 -0400
committerChristian W. Damus2014-09-12 15:22:01 -0400
commita6f96e778ed5653f1a5b82d7414db2a256a74b6e (patch)
tree3dff2f2ae0f60ca080f210afa2c821418997bc40 /plugins/developer/org.eclipse.papyrus.releng.tools
parenta8349dc7e6b96810f676ab2201680ca535965db1 (diff)
downloadorg.eclipse.papyrus-a6f96e778ed5653f1a5b82d7414db2a256a74b6e.tar.gz
org.eclipse.papyrus-a6f96e778ed5653f1a5b82d7414db2a256a74b6e.tar.xz
org.eclipse.papyrus-a6f96e778ed5653f1a5b82d7414db2a256a74b6e.zip
[Releng] Oomph setup model clean-up
Remove EcoreTools from p2 director task, which interferes with installations based on the Eclipse Modeling Package. Rework the annotation format for B3 aggregation based updates of targlet dependency repositories, using a conventional EMF-style source URI that the Setup editor won't flag with invalid URI format error markers.
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/OomphSetupUpdater.java43
1 files changed, 39 insertions, 4 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/OomphSetupUpdater.java b/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/OomphSetupUpdater.java
index 4fb438e9db1..62cfb88a4b0 100644
--- a/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/OomphSetupUpdater.java
+++ b/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/OomphSetupUpdater.java
@@ -20,12 +20,17 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.emf.common.util.EList;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
public class OomphSetupUpdater extends DependencyUpdater {
+ private static final String ANNOTATION_SOURCE = "http://www.eclipse.org/Papyrus/2014/releng/dependencytools";//$NON-NLS-1$
+
private final Pattern annotationPattern = Pattern.compile("updateFrom:([^:]+):(\\d+)"); //$NON-NLS-1$
+ private final Pattern indexPattern = Pattern.compile(":\\d+$"); //$NON-NLS-1$
+
public OomphSetupUpdater(final IFile mapFile, final EList<Contribution> contributions) {
super(mapFile, contributions);
}
@@ -37,12 +42,39 @@ public class OomphSetupUpdater extends DependencyUpdater {
@Override
protected String getCommentContent(Node comment) {
- return ((Element) comment).getAttribute("source"); //$NON-NLS-1$
+ StringBuilder result = new StringBuilder("updateFrom:"); //$NON-NLS-1$
+
+ Element annotation = (Element) comment;
+ NodeList details = annotation.getElementsByTagName("detail"); //$NON-NLS-1$
+ for (int i = 0; i < details.getLength(); i++) {
+ Element next = (Element) details.item(i);
+ if ("updateFrom".equals(next.getAttribute("key"))) { //$NON-NLS-1$ //$NON-NLS-2$
+ String repoSpec = null;
+ if (next.hasAttribute("value")) { //$NON-NLS-1$
+ repoSpec = next.getAttribute("value"); //$NON-NLS-1$
+ } else {
+ NodeList values = next.getElementsByTagName("value"); //$NON-NLS-1$
+ if (values.getLength() > 0) {
+ repoSpec = values.item(0).getTextContent().trim();
+ }
+ }
+ if (repoSpec != null) {
+ result.append(repoSpec);
+ if (!indexPattern.matcher(repoSpec).find()) {
+ // default index
+ result.append(":0"); //$NON-NLS-1$
+ break;
+ }
+ }
+ }
+ }
+
+ return result.toString();
}
@Override
protected String getCommentSyntax() {
- return "updateFrom:<contributionName>:<index>"; //$NON-NLS-1$
+ return String.format("Annotation with source %s and detail 'updateFrom=<contributionName>[:<index>]?'", ANNOTATION_SOURCE); //$NON-NLS-1$
}
@Override
@@ -52,8 +84,11 @@ public class OomphSetupUpdater extends DependencyUpdater {
for (Node next = node.getFirstChild(); next != null; next = next.getNextSibling()) {
if (next.getNodeType() == Node.ELEMENT_NODE) {
if ("annotation".equals(next.getNodeName())) { //$NON-NLS-1$
- result = (Element) next;
- break;
+ Element annotation = (Element) next;
+ if (ANNOTATION_SOURCE.equals(annotation.getAttribute("source"))) { //$NON-NLS-1$
+ result = annotation;
+ break;
+ }
}
}
}

Back to the top