@Override
  public void configureCommandLine(JavaParameters params, @Nullable Module module, boolean tests, VirtualFile script, GroovyScriptRunConfiguration configuration) throws CantRunException {
    String gantHome = GantUtils.getSDKInstallPath(module, configuration.getProject());

    addGroovyAndAntJars(params, module, gantHome);

    setToolsJar(params);

    setGroovyHome(params, gantHome);

    final String confPath = getGantConfPath(gantHome);
    if (confPath != null) {
      params.getVMParametersList().add("-Dgroovy.starter.conf=" + confPath);
      params.getProgramParametersList().add("--conf");
      params.getProgramParametersList().add(confPath);
    }

    params.getVMParametersList().addParametersString(configuration.getVMParameters());
    params.setMainClass("org.codehaus.groovy.tools.GroovyStarter");

    if (gantHome.contains("grails")) {
      params.getClassPath().addAllFiles(GroovyUtils.getFilesInDirectoryByPattern(gantHome + "/lib", ".*\\.jar"));
    }

    addClasspathFromRootModel(module, tests, params, false);

    String antHome = System.getenv("ANT_HOME");
    if (StringUtil.isEmpty(antHome)) {
      antHome = gantHome;
    }

    params.getVMParametersList().add("-Dant.home=" + antHome);
    params.getVMParametersList().add("-Dgant.home=" + gantHome);

    params.getProgramParametersList().add("--main");
    params.getProgramParametersList().add("gant.Gant");

    params.getProgramParametersList().add("--file");
    params.getProgramParametersList().add(FileUtil.toSystemDependentName(configuration.getScriptPath()));

    if (configuration.isDebugEnabled()) {
      params.getProgramParametersList().add("--debug");
      params.getProgramParametersList().add("-D" + UNIQUE_STRING);
    }

    params.getProgramParametersList().addParametersString(configuration.getProgramParameters());
  }
@Override
  public void configureCommandLine(JavaParameters params, @Nullable Module module, boolean tests, VirtualFile script, GroovyScriptRunConfiguration configuration)