Skip to content

Commit

Permalink
Add support for resources to bundling rules.
Browse files Browse the repository at this point in the history
Will need to release before we can remove resources from objcbinary rules.

--
MOS_MIGRATED_REVID=116571890
  • Loading branch information
Dave MacLachlan authored and damienmg committed Mar 8, 2016
1 parent e92bfe5 commit 4b19997
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
15 changes: 4 additions & 11 deletions examples/objc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
ios_application(
name = "PrenotCalculator",
binary = ":PrenotCalculator_binary",
bundles = [":PrenotCalculatorResources"],
datamodels = glob(["PrenotCalculator/DataModel.xcdatamodeld/**"]),
infoplist = "PrenotCalculator/PrenotCalculator-Info.plist",
visibility = ["//visibility:public"],
xibs = ["PrenotCalculator/CalculatorViewController.xib"],
)

objc_binary(
Expand All @@ -35,13 +38,8 @@ objc_binary(
["**/*.h"],
exclude = ["PrenotCalculator/Expression.h"],
),
bundles = [":PrenotCalculatorResources"],
sdk_frameworks = ["CoreData"],
xibs = ["PrenotCalculator/CalculatorViewController.xib"],
deps = [
":CoreDataResources",
":ExpressionPrebuilt",
],
deps = [":ExpressionPrebuilt"],
)

# A prebuilt library that contains multiple architectures.
Expand Down Expand Up @@ -77,11 +75,6 @@ objc_bundle_library(
resources = glob(["PrenotCalculator/Resources/**"]),
)

objc_library(
name = "CoreDataResources",
datamodels = glob(["PrenotCalculator/DataModel.xcdatamodeld/**"]),
)

filegroup(
name = "srcs",
srcs = glob([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public Metadata getMetadata() {
<p>This rule produces one or more Objective-C libraries for bundling in an
<code>ios_application</code>.</p>
<p>Any application-related attributes (infoplist, app_icon, ...) on this rule are deprecated and
you should define them on <code>ios_application</code> instead. They will be removed from
<code>objc_binary</code> soon.</p>
<p>Any application-related attributes (infoplist, app_icon, resources, xibs, datamodels...) on this
rule are deprecated and you should define them on <code>ios_application</code> instead. They will be
removed from <code>objc_binary</code> soon.</p>
<p>Until the migration to <code>ios_application</code> is complete, this rule requires at least one
source file to be defined in either <code>srcs</code> or <code>non_arc_srcs</code></p>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,12 @@ public Metadata getMetadata() {
return RuleDefinition.Metadata.builder()
.name("$objc_bundling_rule")
.type(RuleClassType.ABSTRACT)
.ancestors(OptionsRule.class, ResourceToolsRule.class, XcrunRule.class,
AppleToolchain.RequiresXcodeConfigRule.class)
.ancestors(
AppleToolchain.RequiresXcodeConfigRule.class,
OptionsRule.class,
ResourcesRule.class,
ResourceToolsRule.class,
XcrunRule.class)
.build();
}
}
Expand Down

0 comments on commit 4b19997

Please sign in to comment.