mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
build tests: don't add dummy classes root when running under JDK 9 (IDEA-CR-20468)
Previously 'file://null' URL was added to JDK classes roots, it looks strange and may lead to problems.
This commit is contained in:
@@ -173,7 +173,8 @@ public abstract class JpsBuildTestCase extends UsefulTestCase {
|
||||
|
||||
protected JpsSdk<JpsDummyElement> addJdk(final String name) {
|
||||
try {
|
||||
String path = ClasspathBootstrap.getResourcePath(Object.class) == null ? null : FileUtil.toSystemIndependentName(ClasspathBootstrap.getResourceFile(Object.class).getCanonicalPath());
|
||||
String pathToRtJar = ClasspathBootstrap.getResourcePath(Object.class);
|
||||
String path = pathToRtJar == null ? null : FileUtil.toSystemIndependentName(new File(pathToRtJar).getCanonicalPath());
|
||||
return addJdk(name, path);
|
||||
}
|
||||
catch (IOException e) {
|
||||
@@ -181,11 +182,13 @@ public abstract class JpsBuildTestCase extends UsefulTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
protected JpsSdk<JpsDummyElement> addJdk(final String name, final String path) {
|
||||
protected JpsSdk<JpsDummyElement> addJdk(final String name, @Nullable String jdkClassesRoot) {
|
||||
String homePath = System.getProperty("java.home");
|
||||
String versionString = System.getProperty("java.version");
|
||||
JpsTypedLibrary<JpsSdk<JpsDummyElement>> jdk = myModel.getGlobal().addSdk(name, homePath, versionString, JpsJavaSdkType.INSTANCE);
|
||||
jdk.addRoot(JpsPathUtil.pathToUrl(path), JpsOrderRootType.COMPILED);
|
||||
if (jdkClassesRoot != null) {
|
||||
jdk.addRoot(JpsPathUtil.pathToUrl(jdkClassesRoot), JpsOrderRootType.COMPILED);
|
||||
}
|
||||
return jdk.getProperties();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user