Skip to content

Commit

Permalink
Flip --incompatible_disable_objc_library_resources to true.
Browse files Browse the repository at this point in the history
RELNOTES[INC]: objc_library resource attributes are now disabled by default. Please migrate them to data instead. See bazelbuild#7594 for more info.

PiperOrigin-RevId: 241782281
  • Loading branch information
sergiocampama authored and copybara-github committed Apr 3, 2019
1 parent 85da59f commit 0366246
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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<Artifact> storyboardInputs = ImmutableList.of(
Expand Down Expand Up @@ -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']");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 0366246

Please sign in to comment.