Skip to content

Commit

Permalink
Delete resource fields from ObjcProvider and related code.
Browse files Browse the repository at this point in the history
RELNOTES[INC]: --incompatible_disable_objc_provider_resources no longer has effect. Use of deprecated resource fields on the Objc provider is now disallowed regardless of this flag.

PiperOrigin-RevId: 247225773
  • Loading branch information
sergiocampama authored and copybara-github committed May 8, 2019
1 parent 2aa73ab commit 9a005f7
Show file tree
Hide file tree
Showing 18 changed files with 5 additions and 2,048 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public class StarlarkSemanticsOptions extends OptionsBase implements Serializabl
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help = "If set to true, disallow use of deprecated resource fields on the Objc provider.")
help = "Unused. Will be removed in future versions of Bazel.")
public boolean incompatibleDisableObjcProviderResources;

// For Bazel, this flag is a no-op. Bazel doesn't support built-in third party license checking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,13 @@ public ObjcProvider newObjcProvider(
Boolean usesSwift,
SkylarkDict<?, ?> kwargs,
Environment environment) {
boolean disableObjcResourceKeys =
environment.getSemantics().incompatibleDisableObjcProviderResources();
ObjcProvider.Builder resultBuilder = new ObjcProvider.Builder(environment.getSemantics());
if (usesSwift) {
resultBuilder.add(ObjcProvider.FLAG, ObjcProvider.Flag.USES_SWIFT);
}
for (Map.Entry<?, ?> entry : kwargs.entrySet()) {
Key<?> key = ObjcProvider.getSkylarkKeyForString((String) entry.getKey());
if (key != null) {
if (disableObjcResourceKeys && ObjcProvider.isDeprecatedResourceKey(key)) {
throw new IllegalArgumentException(String.format(BAD_KEY_ERROR, entry.getKey()));
}
resultBuilder.addElementsFromSkylark(key, entry.getValue());
} else if (entry.getKey().equals("providers")) {
resultBuilder.addProvidersFromSkylark(entry.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,12 @@
public class AppleStaticLibrary implements RuleConfiguredTargetFactory {

/**
* Set of {@link ObjcProvider} values which are propagated from dependencies to dependers by
* this rule.
* Set of {@link ObjcProvider} values which are propagated from dependencies to dependers by this
* rule.
*/
private static final ImmutableSet<Key<?>> PROPAGATE_KEYS =
ImmutableSet.<Key<?>>of(
ObjcProvider.ASSET_CATALOG,
ObjcProvider.BUNDLE_FILE,
ObjcProvider.SDK_DYLIB,
ObjcProvider.SDK_FRAMEWORK,
ObjcProvider.STORYBOARD,
ObjcProvider.STRINGS,
ObjcProvider.WEAK_SDK_FRAMEWORK,
ObjcProvider.XCDATAMODEL,
ObjcProvider.XIB,
ObjcProvider.XCASSETS_DIR);
ObjcProvider.SDK_DYLIB, ObjcProvider.SDK_FRAMEWORK, ObjcProvider.WEAK_SDK_FRAMEWORK);

@VisibleForTesting
static final String UNSUPPORTED_PLATFORM_TYPE_ERROR_FORMAT =
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9a005f7

Please sign in to comment.