IDEA-328157 Allow gradle installations to be read-only #3028
+12
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the Gradle tool window permits any directory containing the correct content to be configured as the Gradle installation home:
intellij-community/plugins/gradle/src/org/jetbrains/plugins/gradle/service/settings/IdeaGradleProjectSettingsControlBuilder.java
Lines 419 to 421 in 0e71313
The new project wizard and settings component on the other hand use
CHECK_DIRECTORY
in addition, which also checks whether the directory is writable, even though this is never needed here:intellij-community/platform/platform-impl/src/com/intellij/openapi/ui/validation/validations.kt
Lines 39 to 46 in 0e71313
As a consequence, users that use a package manager first have to create their projects with gradlew, then manually delete the gradlew files and change the installation home in the tool window instead of just creating their project.
This PR fixes this by providing a variant of
CHECK_DIRECTORY
that does not check for writeability.