Skip to content

Commit

Permalink
Add an entry point to xcodeproj rule for overriding project attributes (
Browse files Browse the repository at this point in the history
#165)

* Add entry point to xcodeproj rule for overriding attributes

* Assign directly since it has a default value of {}

* Update rules/xcodeproj.bzl

Co-authored-by: Samuel Giddins <[email protected]>
  • Loading branch information
gyfelton and segiddins authored Nov 26, 2020
1 parent 06f8069 commit 880f567
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rules/xcodeproj.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ def _xcodeproj_impl(ctx):

xcodeproj_info = struct(
name = paths.split_extension(project_name)[0],
attributes = ctx.attr.project_attributes_overrides,
options = proj_options,
settings = proj_settings,
targets = xcodeproj_targets_by_name,
Expand Down Expand Up @@ -777,6 +778,7 @@ Tags for configuration:
"project_name": attr.string(mandatory = False),
"bazel_path": attr.string(mandatory = False, default = "bazel"),
"scheme_existing_envvar_overrides": attr.string_dict(allow_empty = True, default = {}, mandatory = False),
"project_attributes_overrides": attr.string_dict(allow_empty = True, mandatory = False, default = {}, doc = "Overrides for attributes that can be set at the project base level."),
"generate_schemes_for_product_types": attr.string_list(mandatory = False, allow_empty = True, default = [], doc = """\
Generate schemes only for the specified product types if this list is not empty.
Product types must be valid apple product types, e.g. application, bundle.unit-test, framework.
Expand Down
1 change: 1 addition & 0 deletions tests/ios/xcodeproj/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ xcodeproj(
"bundle.unit-test",
],
include_transitive_targets = True,
project_attributes_overrides = {"ORGANIZATIONNAME": "rules_ios"},
deps = [
"//tests/ios/frameworks/objc:ObjcFramework",
"//tests/ios/frameworks/objc:ObjcFrameworkTests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = rules_ios;
TargetAttributes = {
};
};
Expand Down

0 comments on commit 880f567

Please sign in to comment.