Lines 49-59
Link Here
|
49 |
|
49 |
|
50 |
// add JRE and set compliance options |
50 |
// add JRE and set compliance options |
51 |
String ee = getExecutionEnvironment(model.getBundleDescription()); |
51 |
String ee = getExecutionEnvironment(model.getBundleDescription()); |
52 |
result.add(createJREEntryUsingPreviousEntry(javaProject, ee)); |
52 |
result.add(createEntryUsingPreviousEntry(javaProject, ee, PDECore.JRE_CONTAINER_PATH)); |
53 |
setComplianceOptions(JavaCore.create(project), ExecutionEnvironmentAnalyzer.getCompliance(ee)); |
53 |
setComplianceOptions(JavaCore.create(project), ExecutionEnvironmentAnalyzer.getCompliance(ee)); |
54 |
|
54 |
|
55 |
// add pde container |
55 |
// add pde container |
56 |
result.add(createContainerEntry()); |
56 |
result.add(createEntryUsingPreviousEntry(javaProject, ee, PDECore.REQUIRED_PLUGINS_CONTAINER_PATH)); |
57 |
|
57 |
|
58 |
IClasspathEntry[] entries = (IClasspathEntry[]) result.toArray(new IClasspathEntry[result.size()]); |
58 |
IClasspathEntry[] entries = (IClasspathEntry[]) result.toArray(new IClasspathEntry[result.size()]); |
59 |
IJavaModelStatus validation = JavaConventions.validateClasspath(javaProject, entries, javaProject.getOutputLocation()); |
59 |
IJavaModelStatus validation = JavaConventions.validateClasspath(javaProject, entries, javaProject.getOutputLocation()); |
Lines 278-301
Link Here
|
278 |
* has an existing JRE/EE classpath entry, the access rules, extra attributes and isExported settings of |
278 |
* has an existing JRE/EE classpath entry, the access rules, extra attributes and isExported settings of |
279 |
* the existing entry will be added to the new execution entry. |
279 |
* the existing entry will be added to the new execution entry. |
280 |
* |
280 |
* |
281 |
* @param javaProject project to check for existing JRE/EE classpath entries |
281 |
* @param javaProject project to check for existing classpath entries |
282 |
* @param ee id of the execution environment to create an entry for |
282 |
* @param ee id of the execution environment to create an entry for |
|
|
283 |
* @param path id of the container to create an entry for |
284 |
* |
283 |
* @return new classpath container entry |
285 |
* @return new classpath container entry |
284 |
* @throws CoreException if there is a problem accessing the classpath entries of the project |
286 |
* @throws CoreException if there is a problem accessing the classpath entries of the project |
285 |
*/ |
287 |
*/ |
286 |
public static IClasspathEntry createJREEntryUsingPreviousEntry(IJavaProject javaProject, String ee) throws CoreException { |
288 |
public static IClasspathEntry createEntryUsingPreviousEntry(IJavaProject javaProject, String ee, IPath path) throws CoreException { |
287 |
IClasspathEntry existingEntry = null; |
|
|
288 |
IClasspathEntry[] entries = javaProject.getRawClasspath(); |
289 |
IClasspathEntry[] entries = javaProject.getRawClasspath(); |
289 |
for (int i = 0; i < entries.length; i++) { |
290 |
for (int i = 0; i < entries.length; i++) { |
290 |
if (entries[i].getPath().segment(0).equals(JavaRuntime.JRE_CONTAINER)) { |
291 |
if (entries[i].getPath().equals(path)) { |
291 |
existingEntry = entries[i]; |
292 |
if (path.equals(PDECore.JRE_CONTAINER_PATH)) |
292 |
break; |
293 |
return JavaCore.newContainerEntry(getEEPath(ee), entries[i].getAccessRules(), entries[i].getExtraAttributes(), entries[i].isExported()); |
|
|
294 |
|
295 |
return JavaCore.newContainerEntry(path, entries[i].getAccessRules(), entries[i].getExtraAttributes(), entries[i].isExported()); |
293 |
} |
296 |
} |
294 |
} |
297 |
} |
295 |
if (existingEntry == null) { |
298 |
|
|
|
299 |
if (path.equals(PDECore.JRE_CONTAINER_PATH)) |
296 |
return createJREEntry(ee); |
300 |
return createJREEntry(ee); |
297 |
} |
301 |
|
298 |
return JavaCore.newContainerEntry(getEEPath(ee), existingEntry.getAccessRules(), existingEntry.getExtraAttributes(), existingEntry.isExported()); |
302 |
return JavaCore.newContainerEntry(path); |
299 |
} |
303 |
} |
300 |
|
304 |
|
301 |
/** |
305 |
/** |