From 2da70fbc6eb58e4d1e4ecccdd660ae77a3c7ba33 Mon Sep 17 00:00:00 2001 From: Max Medvedev Date: Thu, 11 Apr 2013 09:19:27 +0400 Subject: [PATCH] IDEA-104408 groovy-all has different CommandLineParser --- .../jetbrains/plugins/groovy/config/GroovyConfigUtils.java | 3 +++ .../plugins/groovy/console/DefaultGroovyShellRunner.java | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/config/GroovyConfigUtils.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/config/GroovyConfigUtils.java index b25325585764..4ae4c901d0f2 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/config/GroovyConfigUtils.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/config/GroovyConfigUtils.java @@ -81,6 +81,9 @@ public abstract class GroovyConfigUtils extends AbstractConfigUtils { if (groovyJarVersion == null) { groovyJarVersion = getSDKJarVersion(path + "/embeddable", GROOVY_ALL_JAR_PATTERN, MANIFEST_PATH); } + if (groovyJarVersion == null) { + groovyJarVersion = getSDKJarVersion(path, GROOVY_ALL_JAR_PATTERN, MANIFEST_PATH); + } return groovyJarVersion == null ? UNDEFINED_VERSION : groovyJarVersion; } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/console/DefaultGroovyShellRunner.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/console/DefaultGroovyShellRunner.java index dd6cc8974372..c87093360dd6 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/console/DefaultGroovyShellRunner.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/console/DefaultGroovyShellRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,7 +82,8 @@ public class DefaultGroovyShellRunner extends GroovyShellRunner { private static boolean hasGroovyAll(Module module) { GlobalSearchScope scope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module); JavaPsiFacade facade = JavaPsiFacade.getInstance(module.getProject()); - return facade.findClass("org.apache.commons.cli.CommandLineParser", scope) != null && + return (facade.findClass("org.apache.commons.cli.CommandLineParser", scope) != null || + facade.findClass("groovyjarjarcommonscli.CommandLineParser", scope) != null) && facade.findClass("groovy.ui.GroovyMain", scope) != null; }