<commit_before>// Copyright 2018 The Bazel Authors. All rights reserved.
//
// 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 com.google.devtools.build.lib.skylarkbuildapi.apple;

import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.skylarkbuildapi.FileApi;
import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory;
import com.google.devtools.build.lib.skylarkinterface.SkylarkValue;
import com.google.devtools.build.lib.syntax.SkylarkNestedSet;
import com.google.devtools.build.lib.syntax.StarlarkSemantics.FlagIdentifier;

/**
 * An interface for an info type that provides all compiling and linking information in the
 * transitive closure of its deps that are needed for building Objective-C rules.
 */
@SkylarkModule(
    name = "ObjcProvider",
    category = SkylarkModuleCategory.PROVIDER,
    doc = "A provider for compilation and linking of objc."
)
public interface ObjcProviderApi<FileApiT extends FileApi> extends SkylarkValue {

  @SkylarkCallable(
      name = "asset_catalog",
      structField = true,
      doc =
          "Asset catalog resource files.",
      disableWithFlag = FlagIdentifier.INCOMPATIBLE_DISABLE_OBJC_PROVIDER_RESOURCES)
  public NestedSet<FileApiT> assetCatalog();

  @SkylarkCallable(
      name = "bundle_file",
      structField = true,
      doc =
          "Files that are plopped into the final bundle at some arbitrary bundle path.",
      disableWithFlag = FlagIdentifier.INCOMPATIBLE_DISABLE_OBJC_PROVIDER_RESOURCES)
  public SkylarkNestedSet bundleFile();

  @SkylarkCallable(name = "define",
      structField = true,
      doc = "A set of strings from 'defines' attributes. These are to be passed as '-D' flags to "
          + "all invocations of the compiler for this target and all depending targets."
  )
  public NestedSet<String> define();

  @SkylarkCallable(name = "dynamic_framework_dir",
      structField = true,
      doc = "Exec paths of .framework directories corresponding to dynamic frameworks to link."
  )
  public SkylarkNestedSet dynamicFrameworkDir();

  @SkylarkCallable(name = "dynamic_framework_file",
      structField = true,
      doc = "Files in .framework directories belonging to a dynamically linked framework."
  )
  public NestedSet<FileApiT> dynamicFrameworkFile();

  @SkylarkCallable(name = "exported_debug_artifacts",
      structField = true,
      doc = "Debug files that should be exported by the top-level target."
  )
  public NestedSet<FileApiT> exportedDebugArtifacts();

  @SkylarkCallable(name = "framework_search_path_only",
      structField = true,
      doc = "Exec paths of .framework directories corresponding to frameworks to include "
          + "in search paths, but not to link."
  )
  public SkylarkNestedSet frameworkSearchPathOnly();

  @SkylarkCallable(name = "force_load_library",
      structField = true,
      doc = "Libraries to load with -force_load."
  )
  public NestedSet<FileApiT> forceLoadLibrary();

  @SkylarkCallable(name = "header",
      structField = true,
      doc = "All header files. These may be either public or private headers."
  )
  public NestedSet<FileApiT> header();

  @SkylarkCallable(name = "imported_library",
      structField = true,
      doc = "Imported precompiled static libraries (.a files) to be linked into the binary."
  )
  public NestedSet<FileApiT> importedLibrary();

  @SkylarkCallable(name = "include",
      structField = true,
      doc = "Include search paths specified with '-I' on the command line. Also known as "
          + "header search paths (and distinct from <em>user</em> header search paths)."
  )
  public SkylarkNestedSet include();

  @SkylarkCallable(name = "include_system",
      structField = true,
      doc = "System include search paths (typically specified with -isystem)."
  )
  public SkylarkNestedSet includeSystem();

  @SkylarkCallable(name = "iquote",
      structField = true,
      doc = "User header search paths (typically specified with -iquote)."
  )
  public SkylarkNestedSet iquote();

  @SkylarkCallable(name = "j2objc_library",
      structField = true,
      doc = "Static libraries that are built from J2ObjC-translated Java code."
  )
  public NestedSet<FileApiT> j2objcLibrary();

  @SkylarkCallable(name = "jre_library",
      structField = true,
      doc = "J2ObjC JRE emulation libraries and their dependencies."
  )
  public NestedSet<FileApiT> jreLibrary();

  @SkylarkCallable(name = "library",
      structField = true,
      doc = "Library (.a) files compiled by dependencies of the current target."
  )
  public NestedSet<FileApiT> library();

  @SkylarkCallable(name = "link_inputs",
      structField = true,
      doc = "Link time artifacts from dependencies that do not fall into any other category such "
          + "as libraries or archives. This catch-all provides a way to add arbitrary data (e.g. "
          + "Swift AST files) to the linker. The rule that adds these is also responsible to "
          + "add the necessary linker flags to 'linkopt'."
  )
  public NestedSet<FileApiT> linkInputs();

  @SkylarkCallable(name = "linked_binary",
      structField = true,
      doc = "Single-architecture linked binaries to be combined for the final multi-architecture "
          + "binary."
  )
  public NestedSet<FileApiT> linkedBinary();

  @SkylarkCallable(name = "linkmap_file",
      structField = true,
      doc = "Single-architecture link map for a binary."
  )
  public NestedSet<FileApiT> linkmapFile();

  @SkylarkCallable(name = "linkopt",
      structField = true,
      doc = "Linking options."
  )
  public NestedSet<String> linkopt();

  @SkylarkCallable(
      name = "merge_zip",
      structField = true,
      doc =
           "Merge zips to include in the bundle. The entries of these zip files are included "
              + "in the final bundle with the same path. The entries in the merge zips should not "
              + "include the bundle root path (e.g. 'Foo.app').",
      disableWithFlag = FlagIdentifier.INCOMPATIBLE_DISABLE_OBJC_PROVIDER_RESOURCES)
  public NestedSet<FileApiT> mergeZip();

  @SkylarkCallable(name = "module_map",
      structField = true,
      doc = "Clang module maps, used to enforce proper use of private header files."
  )
  public NestedSet<FileApiT> moduleMap();

  @SkylarkCallable(name = "multi_arch_dynamic_libraries",<commit_msg>Remove disableWithFlag for merge_zip, since it was temporarily whitelisted in https://github.com/bazelbuild/bazel/commit/64c6f42391614cbcc2000a72d00671e3bb213cc0.<commit_after>// Copyright 2018 The Bazel Authors. All rights reserved.
//
// 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 com.google.devtools.build.lib.skylarkbuildapi.apple;

import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.skylarkbuildapi.FileApi;
import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory;
import com.google.devtools.build.lib.skylarkinterface.SkylarkValue;
import com.google.devtools.build.lib.syntax.SkylarkNestedSet;
import com.google.devtools.build.lib.syntax.StarlarkSemantics.FlagIdentifier;

/**
 * An interface for an info type that provides all compiling and linking information in the
 * transitive closure of its deps that are needed for building Objective-C rules.
 */
@SkylarkModule(
    name = "ObjcProvider",
    category = SkylarkModuleCategory.PROVIDER,
    doc = "A provider for compilation and linking of objc."
)
public interface ObjcProviderApi<FileApiT extends FileApi> extends SkylarkValue {

  @SkylarkCallable(
      name = "asset_catalog",
      structField = true,
      doc =
          "Asset catalog resource files.",
      disableWithFlag = FlagIdentifier.INCOMPATIBLE_DISABLE_OBJC_PROVIDER_RESOURCES)
  public NestedSet<FileApiT> assetCatalog();

  @SkylarkCallable(
      name = "bundle_file",
      structField = true,
      doc =
          "Files that are plopped into the final bundle at some arbitrary bundle path.",
      disableWithFlag = FlagIdentifier.INCOMPATIBLE_DISABLE_OBJC_PROVIDER_RESOURCES)
  public SkylarkNestedSet bundleFile();

  @SkylarkCallable(name = "define",
      structField = true,
      doc = "A set of strings from 'defines' attributes. These are to be passed as '-D' flags to "
          + "all invocations of the compiler for this target and all depending targets."
  )
  public NestedSet<String> define();

  @SkylarkCallable(name = "dynamic_framework_dir",
      structField = true,
      doc = "Exec paths of .framework directories corresponding to dynamic frameworks to link."
  )
  public SkylarkNestedSet dynamicFrameworkDir();

  @SkylarkCallable(name = "dynamic_framework_file",
      structField = true,
      doc = "Files in .framework directories belonging to a dynamically linked framework."
  )
  public NestedSet<FileApiT> dynamicFrameworkFile();

  @SkylarkCallable(name = "exported_debug_artifacts",
      structField = true,
      doc = "Debug files that should be exported by the top-level target."
  )
  public NestedSet<FileApiT> exportedDebugArtifacts();

  @SkylarkCallable(name = "framework_search_path_only",
      structField = true,
      doc = "Exec paths of .framework directories corresponding to frameworks to include "
          + "in search paths, but not to link."
  )
  public SkylarkNestedSet frameworkSearchPathOnly();

  @SkylarkCallable(name = "force_load_library",
      structField = true,
      doc = "Libraries to load with -force_load."
  )
  public NestedSet<FileApiT> forceLoadLibrary();

  @SkylarkCallable(name = "header",
      structField = true,
      doc = "All header files. These may be either public or private headers."
  )
  public NestedSet<FileApiT> header();

  @SkylarkCallable(name = "imported_library",
      structField = true,
      doc = "Imported precompiled static libraries (.a files) to be linked into the binary."
  )
  public NestedSet<FileApiT> importedLibrary();

  @SkylarkCallable(name = "include",
      structField = true,
      doc = "Include search paths specified with '-I' on the command line. Also known as "
          + "header search paths (and distinct from <em>user</em> header search paths)."
  )
  public SkylarkNestedSet include();

  @SkylarkCallable(name = "include_system",
      structField = true,
      doc = "System include search paths (typically specified with -isystem)."
  )
  public SkylarkNestedSet includeSystem();

  @SkylarkCallable(name = "iquote",
      structField = true,
      doc = "User header search paths (typically specified with -iquote)."
  )
  public SkylarkNestedSet iquote();

  @SkylarkCallable(name = "j2objc_library",
      structField = true,
      doc = "Static libraries that are built from J2ObjC-translated Java code."
  )
  public NestedSet<FileApiT> j2objcLibrary();

  @SkylarkCallable(name = "jre_library",
      structField = true,
      doc = "J2ObjC JRE emulation libraries and their dependencies."
  )
  public NestedSet<FileApiT> jreLibrary();

  @SkylarkCallable(name = "library",
      structField = true,
      doc = "Library (.a) files compiled by dependencies of the current target."
  )
  public NestedSet<FileApiT> library();

  @SkylarkCallable(name = "link_inputs",
      structField = true,
      doc = "Link time artifacts from dependencies that do not fall into any other category such "
          + "as libraries or archives. This catch-all provides a way to add arbitrary data (e.g. "
          + "Swift AST files) to the linker. The rule that adds these is also responsible to "
          + "add the necessary linker flags to 'linkopt'."
  )
  public NestedSet<FileApiT> linkInputs();

  @SkylarkCallable(name = "linked_binary",
      structField = true,
      doc = "Single-architecture linked binaries to be combined for the final multi-architecture "
          + "binary."
  )
  public NestedSet<FileApiT> linkedBinary();

  @SkylarkCallable(name = "linkmap_file",
      structField = true,
      doc = "Single-architecture link map for a binary."
  )
  public NestedSet<FileApiT> linkmapFile();

  @SkylarkCallable(name = "linkopt",
      structField = true,
      doc = "Linking options."
  )
  public NestedSet<String> linkopt();

  @SkylarkCallable(
      name = "merge_zip",
      structField = true,
      doc =
          "Merge zips to include in the bundle. The entries of these zip files are included "
              + "in the final bundle with the same path. The entries in the merge zips should not "
              + "include the bundle root path (e.g. 'Foo.app').")
  public NestedSet<FileApiT> mergeZip();

  @SkylarkCallable(name = "module_map",
      structField = true,
      doc = "Clang module maps, used to enforce proper use of private header files."
  )
  public NestedSet<FileApiT> moduleMap();

  @SkylarkCallable(name = "multi_arch_dynamic_libraries",
{'fraction_non_alphanumeric': 0.08973905664380172, 'fraction_numerical': 0.0036065341913584614, 'mean_word_length': 3.6125244618395302, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 1, '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': '6965218', 'n_tokens_mistral': 4245, 'n_tokens_neox': 4078, 'n_words': 1297}