<commit_before>/*
 * Copyright 2000-2017 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.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jetbrains.plugins.gradle.frameworkSupport;

import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import org.gradle.util.GradleVersion;
import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.Set;

/**
 * @author Vladislav.Soroka
 * @since 4/24/2015
 */
public class BuildScriptDataBuilder {
  @NotNull private final VirtualFile myBuildScriptFile;
  protected final Set<String> imports = ContainerUtil.newTreeSet();
  protected final Set<String> plugins = ContainerUtil.newTreeSet();
  protected final Set<String> pluginsInGroup = ContainerUtil.newTreeSet();
  protected final Set<String> repositories = ContainerUtil.newTreeSet();
  protected final Set<String> dependencies = ContainerUtil.newTreeSet();
  protected final Set<String> properties = ContainerUtil.newTreeSet();
  protected final Set<String> buildScriptProperties = ContainerUtil.newTreeSet();
  protected final Set<String> buildScriptRepositories = ContainerUtil.newTreeSet();
  protected final Set<String> buildScriptDependencies = ContainerUtil.newTreeSet();
  protected final Set<String> other = ContainerUtil.newTreeSet();
  protected final GradleVersion myGradleVersion;

  public BuildScriptDataBuilder(@NotNull VirtualFile buildScriptFile) {
    this(buildScriptFile, GradleVersion.current());
  }

  public BuildScriptDataBuilder(@NotNull VirtualFile buildScriptFile, @NotNull GradleVersion gradleVersion) {
    myBuildScriptFile = buildScriptFile;
    myGradleVersion = gradleVersion;
  }

  @NotNull
  public VirtualFile getBuildScriptFile() {
    return myBuildScriptFile;
  }

  /**
   * @deprecated use {@link #buildMainPart()} and {@link #buildConfigurationPart()} instead
   */<commit_msg>Gradle: expose build script data builder gradle version (IDEA-188057)<commit_after>/*
 * Copyright 2000-2017 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.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jetbrains.plugins.gradle.frameworkSupport;

import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import org.gradle.util.GradleVersion;
import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.Set;

/**
 * @author Vladislav.Soroka
 * @since 4/24/2015
 */
public class BuildScriptDataBuilder {
  @NotNull private final VirtualFile myBuildScriptFile;
  protected final Set<String> imports = ContainerUtil.newTreeSet();
  protected final Set<String> plugins = ContainerUtil.newTreeSet();
  protected final Set<String> pluginsInGroup = ContainerUtil.newTreeSet();
  protected final Set<String> repositories = ContainerUtil.newTreeSet();
  protected final Set<String> dependencies = ContainerUtil.newTreeSet();
  protected final Set<String> properties = ContainerUtil.newTreeSet();
  protected final Set<String> buildScriptProperties = ContainerUtil.newTreeSet();
  protected final Set<String> buildScriptRepositories = ContainerUtil.newTreeSet();
  protected final Set<String> buildScriptDependencies = ContainerUtil.newTreeSet();
  protected final Set<String> other = ContainerUtil.newTreeSet();
  protected final GradleVersion myGradleVersion;

  public BuildScriptDataBuilder(@NotNull VirtualFile buildScriptFile) {
    this(buildScriptFile, GradleVersion.current());
  }

  public BuildScriptDataBuilder(@NotNull VirtualFile buildScriptFile, @NotNull GradleVersion gradleVersion) {
    myBuildScriptFile = buildScriptFile;
    myGradleVersion = gradleVersion;
  }

  @NotNull
  public VirtualFile getBuildScriptFile() {
    return myBuildScriptFile;
  }

  @NotNull
  public GradleVersion getGradleVersion() {
    return myGradleVersion;
  }

  /**
   * @deprecated use {@link #buildMainPart()} and {@link #buildConfigurationPart()} instead
   */
{'fraction_non_alphanumeric': 0.08957590170432025, 'fraction_numerical': 0.008719778042013475, 'mean_word_length': 5.2540272614622054, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '835290', 'n_tokens_mistral': 1396, 'n_tokens_neox': 1348, 'n_words': 410}