Skip to content

Commit 6b4d7b2

Browse files
committed
Include patched org.eclipse.core.resources for Eclipse Bug 519776
Bring in patched versions of org.eclipse.core.resources to check if https://git.eclipse.org/c/101379 fixes bug 519776 and fixes our test errors.
1 parent 4e3f72d commit 6b4d7b2

935 files changed

Lines changed: 219781 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.mvn/extensions.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<extensions>
3+
<extension>
4+
<groupId>org.eclipse.tycho.extras</groupId>
5+
<artifactId>tycho-pomless</artifactId>
6+
<version>1.0.0</version>
7+
<!-- <version>${tycho.version}</version> -->
8+
</extension>
9+
</extensions>
10+

pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@
398398
<!-- build against a known target platform -->
399399
<modules>
400400
<module>eclipse/mars</module>
401+
<module>third_party/patches/mars</module>
401402
</modules>
402403
<build>
403404
<plugins>
@@ -471,6 +472,7 @@
471472
<!-- build against a known target platform -->
472473
<modules>
473474
<module>eclipse/neon</module>
475+
<module>third_party/patches/neon</module>
474476
</modules>
475477
<build>
476478
<plugins>
@@ -505,6 +507,7 @@
505507
<!-- build against a known target platform -->
506508
<modules>
507509
<module>eclipse/oxygen</module>
510+
<module>third_party/patches/oxygen</module>
508511
</modules>
509512
<build>
510513
<plugins>

third_party/patches/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This directory contains patched bundles from Eclipse Mars, Neon, and Oxygen.
2+
These fixes are only for testing.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
4+
<classpathentry kind="src" path="src"/>
5+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
6+
<classpathentry kind="output" path="target/classes"/>
7+
</classpath>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>org.eclipse.core.resources</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Manifest-Version: 1.0
2+
Comment: Bundle-Version: 3.10.1.v20150725-2910
3+
Bundle-Version: 3.10.1.v20150725-1910
4+
Bundle-Localization: plugin
5+
Bundle-SymbolicName: org.eclipse.core.resources; singleton:=true
6+
Require-Bundle: org.eclipse.ant.core;bundle-version="[3.1.0,4.0.0)";resolution:=optional,org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)",
7+
org.eclipse.core.filesystem;bundle-version="[1.3.0,2.0.0)",
8+
org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)"
9+
Bundle-ManifestVersion: 2
10+
Bundle-ActivationPolicy: lazy
11+
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
12+
Bundle-Vendor: %providerName
13+
Export-Package: org.eclipse.core.internal.dtree;x-internal:=true,
14+
org.eclipse.core.internal.events;x-internal:=true,
15+
org.eclipse.core.internal.localstore;x-internal:=true,
16+
org.eclipse.core.internal.properties;x-internal:=true,
17+
org.eclipse.core.internal.propertytester;x-internal:=true,
18+
org.eclipse.core.internal.refresh;x-internal:=true,
19+
org.eclipse.core.internal.resources;x-internal:=true,
20+
org.eclipse.core.internal.resources.mapping;x-internal:=true,
21+
org.eclipse.core.internal.resources.projectvariables;x-internal:=true,
22+
org.eclipse.core.internal.resources.refresh.win32;x-internal:=true,
23+
org.eclipse.core.internal.utils;x-internal:=true,
24+
org.eclipse.core.internal.watson;x-internal:=true,
25+
org.eclipse.core.resources,
26+
org.eclipse.core.resources.filtermatchers,
27+
org.eclipse.core.resources.mapping,
28+
org.eclipse.core.resources.refresh,
29+
org.eclipse.core.resources.team,
30+
org.eclipse.core.resources.variableresolvers
31+
Bundle-Name: %pluginName
32+
Bundle-Activator: org.eclipse.core.resources.ResourcesPlugin
33+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#Source Bundle Localization
2+
#Wed Aug 05 10:46:08 EDT 2015
3+
bundleVendor=Eclipse.org
4+
bundleName=Core Resource Management Source
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3+
<html xmlns="http://www.w3.org/1999/xhtml">
4+
<head>
5+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
6+
<title>About</title>
7+
</head>
8+
<body lang="EN-US">
9+
<h2>About This Content</h2>
10+
11+
<p>June 2, 2006</p>
12+
<h3>License</h3>
13+
14+
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
15+
indicated below, the Content is provided to you under the terms and conditions of the
16+
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
17+
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
18+
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
19+
20+
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
21+
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
22+
apply to your use of any object code in the Content. Check the Redistributor's license that was
23+
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
24+
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
25+
and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
26+
27+
</body>
28+
</html>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
jarprocessor.exclude.sign=true
2+
jarprocessor.exclude.pack=true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2000, 2014 IBM Corporation and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* IBM Corporation - initial API and implementation
10+
*******************************************************************************/
11+
package org.eclipse.core.resources.ant;
12+
13+
import java.io.File;
14+
import org.apache.tools.ant.BuildException;
15+
import org.apache.tools.ant.Task;
16+
import org.apache.tools.ant.types.Path;
17+
import org.eclipse.core.resources.IResource;
18+
import org.eclipse.core.resources.ResourcesPlugin;
19+
import org.eclipse.core.runtime.IPath;
20+
import org.eclipse.core.runtime.Platform;
21+
22+
/**
23+
* An Ant task which allows to switch from a file system path to a resource path,
24+
* and vice versa, and store the result in a user property whose name is set by the user. If the
25+
* resource does not exist, the property is set to <code>false</code>.
26+
* <p>
27+
* The attribute "property" must be specified, as well as only one of "fileSystemPath" or "resourcePath".
28+
* <p><p>
29+
* Example:<p>
30+
* &lt;eclipse.convertPath fileSystemPath="D:\MyWork\MyProject" property="myProject.resourcePath"/&gt;
31+
*/
32+
public class ConvertPath extends Task {
33+
34+
/**
35+
* The file system path.
36+
*/
37+
private IPath fileSystemPath = null;
38+
39+
/**
40+
* The resource path.
41+
*/
42+
private IPath resourcePath = null;
43+
44+
/**
45+
* The name of the property where the result may be stored.
46+
*/
47+
private String property = null;
48+
49+
/**
50+
* The id of the new Path object that may be created.
51+
*/
52+
private String pathID = null;
53+
54+
/**
55+
* Constructs a new <code>ConvertPath</code> instance.
56+
*/
57+
public ConvertPath() {
58+
super();
59+
}
60+
61+
/**
62+
* Performs the path conversion operation.
63+
*
64+
* @exception BuildException thrown if a problem occurs during execution.
65+
*/
66+
@Override
67+
public void execute() throws BuildException {
68+
validateAttributes();
69+
if (fileSystemPath == null)
70+
// here, resourcePath is not null
71+
convertResourcePathToFileSystemPath(resourcePath);
72+
else
73+
convertFileSystemPathToResourcePath(fileSystemPath);
74+
}
75+
76+
protected void convertFileSystemPathToResourcePath(IPath path) {
77+
IResource resource;
78+
if (Platform.getLocation().equals(path)) {
79+
resource = ResourcesPlugin.getWorkspace().getRoot();
80+
} else {
81+
resource = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(path);
82+
if (resource == null)
83+
throw new BuildException(Policy.bind("exception.noProjectMatchThePath", fileSystemPath.toOSString())); //$NON-NLS-1$
84+
}
85+
if (property != null)
86+
getProject().setUserProperty(property, resource.getFullPath().toString());
87+
if (pathID != null) {
88+
Path newPath = new Path(getProject(), resource.getFullPath().toString());
89+
getProject().addReference(pathID, newPath);
90+
}
91+
}
92+
93+
protected void convertResourcePathToFileSystemPath(IPath path) {
94+
IResource resource = null;
95+
switch (path.segmentCount()) {
96+
case 0 :
97+
resource = ResourcesPlugin.getWorkspace().getRoot();
98+
break;
99+
case 1 :
100+
resource = ResourcesPlugin.getWorkspace().getRoot().getProject(path.lastSegment());
101+
break;
102+
default :
103+
resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
104+
}
105+
106+
if (resource.getLocation() == null)
107+
// can occur if the first segment is not a project
108+
throw new BuildException(Policy.bind("exception.pathNotValid", path.toString())); //$NON-NLS-1$
109+
110+
if (property != null)
111+
getProject().setUserProperty(property, resource.getLocation().toOSString());
112+
if (pathID != null) {
113+
Path newPath = new Path(getProject(), resource.getLocation().toOSString());
114+
getProject().addReference(pathID, newPath);
115+
}
116+
}
117+
118+
/**
119+
* Sets the file system path.
120+
*
121+
* @param value the file corresponding to the path supplied by the user
122+
*/
123+
public void setFileSystemPath(File value) {
124+
if (resourcePath != null)
125+
throw new BuildException(Policy.bind("exception.cantUseBoth")); //$NON-NLS-1$
126+
fileSystemPath = new org.eclipse.core.runtime.Path(value.toString());
127+
}
128+
129+
/**
130+
* Sets the resource path.
131+
*
132+
* @param value the path
133+
*/
134+
public void setResourcePath(String value) {
135+
if (fileSystemPath != null)
136+
throw new BuildException(Policy.bind("exception.cantUseBoth")); //$NON-NLS-1$
137+
resourcePath = new org.eclipse.core.runtime.Path(value);
138+
}
139+
140+
/**
141+
* Sets the name of the property where the result may stored.
142+
*
143+
* @param value the name of the property
144+
*/
145+
public void setProperty(String value) {
146+
property = value;
147+
148+
}
149+
150+
/**
151+
* Sets the id for the path where the result may be stored
152+
*
153+
* @param value the id of the path
154+
*/
155+
public void setPathId(String value) {
156+
pathID = value;
157+
}
158+
159+
/**
160+
* Performs a validation of the receiver.
161+
*
162+
* @exception BuildException thrown if a problem occurs during validation.
163+
*/
164+
protected void validateAttributes() throws BuildException {
165+
if (property == null && pathID == null)
166+
throw new BuildException(Policy.bind("exception.propertyAndPathIdNotSpecified")); //$NON-NLS-1$
167+
168+
if (resourcePath != null && (!resourcePath.isValidPath(resourcePath.toString()) || resourcePath.isEmpty()))
169+
throw new BuildException(Policy.bind("exception.invalidPath", resourcePath.toOSString())); //$NON-NLS-1$
170+
else if (fileSystemPath != null && !fileSystemPath.isValidPath(fileSystemPath.toOSString()))
171+
throw new BuildException(Policy.bind("exception.invalidPath", fileSystemPath.toOSString())); //$NON-NLS-1$
172+
173+
if (resourcePath == null && fileSystemPath == null)
174+
throw new BuildException(Policy.bind("exception.mustHaveOneAttribute")); //$NON-NLS-1$
175+
}
176+
}

0 commit comments

Comments
 (0)