From 03662462941953dad23af88693804b8b1d4430b9 Mon Sep 17 00:00:00 2001 From: kaipi Date: Wed, 3 Apr 2019 12:23:46 -0700 Subject: [PATCH] Flip --incompatible_disable_objc_library_resources to true. RELNOTES[INC]: objc_library resource attributes are now disabled by default. Please migrate them to data instead. See https://github.com/bazelbuild/bazel/issues/7594 for more info. PiperOrigin-RevId: 241782281 --- .../build/lib/rules/objc/ObjcCommandLineOptions.java | 2 +- .../build/lib/rules/objc/AppleStaticLibraryTest.java | 1 + .../devtools/build/lib/rules/objc/ObjcLibraryTest.java | 9 +++++++-- .../devtools/build/lib/rules/objc/ObjcRuleTestCase.java | 3 ++- .../devtools/build/lib/rules/objc/ObjcSkylarkTest.java | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommandLineOptions.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommandLineOptions.java index 39209e3231a771..db7c4b5cb51631 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommandLineOptions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommandLineOptions.java @@ -312,7 +312,7 @@ public class ObjcCommandLineOptions extends FragmentOptions { @Option( name = "incompatible_disable_objc_library_resources", - defaultValue = "false", + defaultValue = "true", documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, effectTags = {OptionEffectTag.UNKNOWN}, metadataTags = { diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java index b74c1726b30ed9..ebaf09eb1d06f3 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java @@ -100,6 +100,7 @@ public void testSymlinkInsteadOfLipoSingleArch() throws Exception { @Test public void testAvoidDepsProviders() throws Exception { + useConfiguration("--incompatible_disable_objc_library_resources=false"); scratch.file( "package/BUILD", "apple_static_library(", diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java index 0f6f72d279fa5d..3675f2da7c44f0 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java @@ -981,7 +981,9 @@ public void testCppSourceCompilesWithCppFlags() throws Exception { @Test public void testAssetCatalogsAttributeErrorForNotInXcAssetsDir() throws Exception { - useConfiguration("--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL); + useConfiguration( + "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL, + "--incompatible_disable_objc_library_resources=false"); scratch.file("lib/ac/notinxcassets1"); scratch.file("lib/ac/notinxcassets2"); scratch.file("lib/ac/foo.xcassets/isinxcassets"); @@ -993,7 +995,9 @@ public void testAssetCatalogsAttributeErrorForNotInXcAssetsDir() throws Exceptio @Test public void testXcdatamodelsAttributeErrorForNotInXcdatamodelDir() throws Exception { - useConfiguration("--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL); + useConfiguration( + "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL, + "--incompatible_disable_objc_library_resources=false"); scratch.file("lib/xcd/notinxcdatamodel1"); scratch.file("lib/xcd/notinxcdatamodel2"); scratch.file("lib/xcd/foo.xcdatamodel/isinxcdatamodel"); @@ -1130,6 +1134,7 @@ public void testPopulatesCompilationArtifacts() throws Exception { @Test public void testProvidesXcassetCatalogsTransitively() throws Exception { + useConfiguration("--incompatible_disable_objc_library_resources=false"); scratch.file("lib1/ac.xcassets/foo"); scratch.file("lib1/ac.xcassets/bar"); createLibraryTargetWriter("//lib1:lib1") diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java index 23a0dbeeea3b17..8b0535608beaae 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java @@ -1042,6 +1042,7 @@ protected void checkPassesFamiliesToIbtool(RuleType ruleType) throws Exception { } protected ConfiguredTarget createTargetWithStoryboards(RuleType ruleType) throws Exception { + useConfiguration("--incompatible_disable_objc_library_resources=false"); scratch.file("x/1.storyboard"); scratch.file("x/2.storyboard"); scratch.file("x/subdir_for_no_reason/en.lproj/loc.storyboard"); @@ -1052,7 +1053,6 @@ protected ConfiguredTarget createTargetWithStoryboards(RuleType ruleType) throws protected void checkProvidesStoryboardObjects(RuleType ruleType) throws Exception { - useConfiguration(); createTargetWithStoryboards(ruleType); ObjcProvider provider = providerForTarget("//x:x"); ImmutableList storyboardInputs = ImmutableList.of( @@ -2005,6 +2005,7 @@ private void assertAvoidDepsObjects(RuleType ruleType) throws Exception { * * All libraries prefixed with "avoid" shouldn't be statically linked in the top level target. */ + useConfiguration("--incompatible_disable_objc_library_resources=false"); ruleType.scratchTarget(scratch, "deps", "['//package:objcLib']", "dylibs", "['//package:avoidLib']"); diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcSkylarkTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcSkylarkTest.java index 790973e37f1dd4..5b6cc48503b316 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcSkylarkTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcSkylarkTest.java @@ -1079,6 +1079,7 @@ public void testEmptyObjcProviderKeysArePresent() throws Exception { @Test public void testSkylarkCanAccessProvidedBundleFiles() throws Exception { + useConfiguration("--incompatible_disable_objc_library_resources=false"); // Since the collections of structs with Artifact values are extremely difficult to test with // Truth, we fudge them in the Skylark side to return easily comparable dictionaries instead. scratch.file("examples/rule/BUILD");