Skip to content

Commit a08e52d

Browse files
committed
refactor to use provider
Use `XcodeProjAutomaticTargetProcessingInfo` to fetch codesign flags
1 parent 22c2877 commit a08e52d

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

test/fixtures/command_line/bwb_spec.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,10 @@
592592
"build_settings": {
593593
"GCC_OPTIMIZATION_LEVEL": "0",
594594
"MACOSX_DEPLOYMENT_TARGET": "11.0",
595+
"OTHER_CODE_SIGN_FLAGS": [
596+
"--digest-algorithm=sha1",
597+
"--digest-algorithm=sha384"
598+
],
595599
"OTHER_LDFLAGS": [
596600
"-ObjC"
597601
],

test/fixtures/command_line/bwx_spec.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,10 @@
553553
"build_settings": {
554554
"GCC_OPTIMIZATION_LEVEL": "0",
555555
"MACOSX_DEPLOYMENT_TARGET": "11.0",
556+
"OTHER_CODE_SIGN_FLAGS": [
557+
"--digest-algorithm=sha1",
558+
"--digest-algorithm=sha384"
559+
],
556560
"OTHER_LDFLAGS": [
557561
"-ObjC"
558562
],

xcodeproj/internal/default_input_file_attributes_aspect.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def _default_input_file_attributes_aspect_impl(target, ctx):
109109

110110
return [
111111
XcodeProjAutomaticTargetProcessingInfo(
112+
codesignopts = "codesignopts",
112113
should_generate_target = should_generate_target,
113114
target_type = this_target_type,
114115
xcode_targets = xcode_targets,

xcodeproj/internal/providers.bzl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ return a `XcodeProjInfo` provider instance instead.
1919
fields = {
2020
"bundle_id": """\
2121
An attribute name (or `None`) to collect the bundle id string from.
22+
""",
23+
"codesignopts": """\
24+
A `list` of code sign options.
2225
""",
2326
"entitlements": """\
2427
An attribute name (or `None`) to collect `File`s from for the

xcodeproj/internal/target_properties.bzl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ def process_modulemaps(*, swift_info):
102102
files = uniq(modulemap_files),
103103
)
104104

105+
def process_codesignopts(*, codesignopts, build_settings):
106+
"""Logic for processing code signing flags.
107+
108+
Args:
109+
codesignopts: A `list` of code sign options
110+
build_settings: A mutable `dict` that will be updated with code signing
111+
flag build settings that are processed.
112+
Return:
113+
The modified build settings object
114+
"""
115+
if codesignopts and build_settings != None:
116+
set_if_true(build_settings, "OTHER_CODE_SIGN_FLAGS", codesignopts)
117+
105118
def process_defines(*, cc_info, swift_info, build_settings):
106119
""" Logic for processing defines of a module
107120

0 commit comments

Comments
 (0)