@Nullable
  @Override
  public Object buildAll(@NotNull final String modelName, @NotNull final Project project, @NotNull ModelBuilderContext context) {
    DefaultGradleBuildScriptClasspathModel buildScriptClasspath = new DefaultGradleBuildScriptClasspathModel();
    buildScriptClasspath.setGradleHomeDir(project.getGradle().getGradleHomeDir());
    buildScriptClasspath.setGradleVersion(GradleVersion.current().getVersion());

    Project parentProject = project.getParent();
    if (parentProject != null) {
      GradleBuildScriptClasspathModel parentBuildScriptClasspath = GradleBuildScriptClasspathCache.getInstance(context)
        .getBuildScriptClasspathModel(parentProject);
      for (ClasspathEntryModel classpathEntryModel : parentBuildScriptClasspath.getClasspath()) {
        buildScriptClasspath.add(classpathEntryModel);
      }
    }

    Configuration classpathConfiguration = project.getBuildscript().getConfigurations().findByName(CLASSPATH_CONFIGURATION_NAME);
    if (classpathConfiguration != null) {
      Collection<ExternalDependency> dependencies = new GradleDependencyResolver(context, project)
        .resolveDependencies(classpathConfiguration);

      for (ExternalDependency dependency : new GradleDependencyTraverser(dependencies)) {
        if (dependency instanceof ExternalProjectDependency) {
          ExternalProjectDependency projectDependency = (ExternalProjectDependency)dependency;
          Collection<File> projectDependencyArtifacts = projectDependency.getProjectDependencyArtifacts();
          Collection<File> projectDependencyArtifactsSources = projectDependency.getProjectDependencyArtifactsSources();
          buildScriptClasspath.add(new ClasspathEntryModelImpl(
            projectDependencyArtifacts,
            projectDependencyArtifactsSources,
            Collections.emptySet()
          ));
        }
        else if (dependency instanceof ExternalLibraryDependency) {
          final ExternalLibraryDependency libraryDep = (ExternalLibraryDependency)dependency;
          buildScriptClasspath.add(new ClasspathEntryModelImpl(
            GradleCollections.createMaybeSingletonList(libraryDep.getFile()),
            GradleCollections.createMaybeSingletonList(libraryDep.getSource()),
            GradleCollections.createMaybeSingletonList(libraryDep.getJavadoc())
          ));
        }
        else if (dependency instanceof ExternalMultiLibraryDependency) {
          ExternalMultiLibraryDependency multiLibraryDependency = (ExternalMultiLibraryDependency)dependency;
          buildScriptClasspath.add(new ClasspathEntryModelImpl(
            multiLibraryDependency.getFiles(),
            multiLibraryDependency.getSources(),
            multiLibraryDependency.getJavadoc()
          ));
        }
        else if (dependency instanceof FileCollectionDependency) {
          FileCollectionDependency fileCollectionDependency = (FileCollectionDependency)dependency;
          buildScriptClasspath.add(new ClasspathEntryModelImpl(
            fileCollectionDependency.getFiles(),
            Collections.emptySet(),
            Collections.emptySet()
          ));
        }
      }
    }

    GradleBuildScriptClasspathCache.getInstance(context)
      .setBuildScriptClasspathModel(project, buildScriptClasspath);

    return buildScriptClasspath;
  }
@Nullable
  @Override
  public Object buildAll(@NotNull final String modelName, @NotNull final Project project, @NotNull ModelBuilderContext context)