Skip to content

Commit

Permalink
Remove code to support pre-framework-cleanup-migration
Browse files Browse the repository at this point in the history
RELNOTES: None
PiperOrigin-RevId: 273962322
  • Loading branch information
Googler authored and swiple-rules-gardener committed Oct 10, 2019
1 parent 4af4135 commit 19f031f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 42 deletions.
39 changes: 12 additions & 27 deletions apple/internal/apple_framework_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ load(
"@build_bazel_rules_apple//apple/internal:resources.bzl",
"resources",
)
load(
"@build_bazel_apple_support//lib:framework_migration.bzl",
"framework_migration",
)
load(
"@build_bazel_rules_apple//apple:utils.bzl",
"group_files_by_directory",
Expand Down Expand Up @@ -178,18 +174,12 @@ def _apple_dynamic_framework_import_impl(ctx):

framework_groups = _grouped_framework_files(framework_imports)
framework_dirs_set = depset(framework_groups.keys())
if framework_migration.is_post_framework_migration():
objc_provider_fields = _framework_objc_provider_fields(
"dynamic_framework_file",
header_imports,
module_map_imports,
_all_framework_binaries(framework_groups),
)
else:
objc_provider_fields = {
"dynamic_framework_dir": framework_dirs_set,
"dynamic_framework_file": depset(framework_imports),
}
objc_provider_fields = _framework_objc_provider_fields(
"dynamic_framework_file",
header_imports,
module_map_imports,
_all_framework_binaries(framework_groups),
)

objc_provider = _objc_provider_with_dependencies(ctx, objc_provider_fields)
providers.append(objc_provider)
Expand All @@ -214,17 +204,12 @@ def _apple_static_framework_import_impl(ctx):
framework_groups = _grouped_framework_files(framework_imports)
framework_binaries = _all_framework_binaries(framework_groups)

if framework_migration.is_post_framework_migration():
objc_provider_fields = _framework_objc_provider_fields(
"static_framework_file",
header_imports,
module_map_imports,
framework_binaries,
)
else:
objc_provider_fields = {
"static_framework_file": depset(framework_imports),
}
objc_provider_fields = _framework_objc_provider_fields(
"static_framework_file",
header_imports,
module_map_imports,
framework_binaries,
)

if ctx.attr.alwayslink:
if not framework_binaries:
Expand Down
19 changes: 4 additions & 15 deletions apple/internal/partials/framework_provider.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ load(
"@build_bazel_rules_apple//apple/internal:file_support.bzl",
"file_support",
)
load(
"@build_bazel_apple_support//lib:framework_migration.bzl",
"framework_migration",
)
load(
"@bazel_skylib//lib:partial.bzl",
"partial",
Expand Down Expand Up @@ -59,17 +55,10 @@ def _framework_provider_partial_impl(ctx, binary_provider):

# TODO(cparsons): These will no longer be necessary once apple_binary
# uses the values in the dynamic framework provider.
if framework_migration.is_post_framework_migration():
legacy_objc_provider = apple_common.new_objc_provider(
dynamic_framework_file = depset([framework_file]),
providers = [binary_provider.objc],
)
else:
legacy_objc_provider = apple_common.new_objc_provider(
dynamic_framework_dir = depset([absolute_framework_dir]),
dynamic_framework_file = depset([framework_file]),
providers = [binary_provider.objc],
)
legacy_objc_provider = apple_common.new_objc_provider(
dynamic_framework_file = depset([framework_file]),
providers = [binary_provider.objc],
)

framework_provider = apple_common.new_dynamic_framework_provider(
binary = binary_file,
Expand Down

0 comments on commit 19f031f

Please sign in to comment.