mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
project configuration: added registry option to automatically add tools.jar when a new JDK is created
When IDEA-99632 is implemented we can include option 'include tools.jar' to JDK requirements, so this workaround will become obsolete.
This commit is contained in:
@@ -19,6 +19,7 @@ import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.io.FileFilters;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -70,6 +71,12 @@ public class JavaSdkUtil {
|
||||
FileFilter jarFileFilter = FileFilters.filesWithExtension("jar");
|
||||
Set<String> pathFilter = ContainerUtil.newTroveSet(FileUtil.PATH_HASHING_STRATEGY);
|
||||
List<File> rootFiles = ContainerUtil.newArrayList();
|
||||
if (Registry.is("project.structure.add.tools.jar.to.new.jdk")) {
|
||||
File toolsJar = new File(home, "lib/tools.jar");
|
||||
if (toolsJar.isFile()) {
|
||||
rootFiles.add(toolsJar);
|
||||
}
|
||||
}
|
||||
for (File jarDir : jarDirs) {
|
||||
if (jarDir != null && jarDir.isDirectory()) {
|
||||
File[] jarFiles = notNull(jarDir.listFiles(jarFileFilter), ArrayUtil.EMPTY_FILE_ARRAY);
|
||||
|
||||
@@ -810,6 +810,8 @@ welcome.screen.project.grouping.enabled.description=Allows to group recent proje
|
||||
custom.folding.max.lookup.depth=50
|
||||
custom.folding.max.lookup.depth.description=Max lookup depth for custom folding comments in a PSI tree.
|
||||
|
||||
project.structure.add.tools.jar.to.new.jdk=false
|
||||
project.structure.add.tools.jar.to.new.jdk.description=Automatically add tools.jar to 'Classpath' when new JDK is created
|
||||
|
||||
tfs.set.connection.timeout=false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user