GradleVersion (Project project, String filePath) { ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(GradleConstants.SYSTEM_ID); if (manager instanceof GradleManager gradleManager) { String externalProjectPath = gradleManager.getAffectedExternalProjectPath(filePath, project); if (externalProjectPath != null) { GradleSettings settings = GradleSettings.getInstance(project); GradleProjectSettings projectSettings = settings.getLinkedProjectSettings(externalProjectPath); if (projectSettings != null) { return projectSettings.resolveGradleVersion(); } } } return GradleVersion.current(); }