Skip to content

Commit 1315301

Browse files
benbfacebook-github-bot
authored andcommitted
--only-select-provisioning-profile option to codesign_bundle
Summary: We want to reuse this code to select a profile before signing, for use in Orchard. First step - an option to turn off codesign and just print out any matching profiles. Reviewed By: milend Differential Revision: D83574913 fbshipit-source-id: 9a34969d96af6c6511b1e99c4ad0304c2573c7f8
1 parent ab3dc51 commit 1315301

File tree

1 file changed

+17
-0
lines changed
  • prelude/apple/tools/code_signing

1 file changed

+17
-0
lines changed

prelude/apple/tools/code_signing/main.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class Arguments(Tap):
4444
fast_provisioning_profile_parsing: bool = False
4545
strict_provisioning_profile_search: bool = False
4646
provisioning_profile_filter: Optional[str] = None
47+
only_select_provisioning_profile: bool = False
4748

4849
def configure(self) -> None:
4950
"""
@@ -124,6 +125,12 @@ def configure(self) -> None:
124125
required=False,
125126
help="Regex to disambiguate multiple matching profiles, evaluated against provisioning profile filename.",
126127
)
128+
self.add_argument(
129+
"--only-select-provisioning-profile",
130+
action="store_true",
131+
required=False,
132+
help="Skip codesigning and just output the path to the selected provisioning profile to stdout.",
133+
)
127134

128135

129136
# Add emoji to beginning of actionable error message so it stands out more.
@@ -135,6 +142,12 @@ def _main() -> None:
135142
args = Arguments().parse_args()
136143
try:
137144
if args.ad_hoc:
145+
if args.only_select_provisioning_profile:
146+
print(
147+
"No provisioning profile is selected for ad-hoc signing.",
148+
file=sys.stderr,
149+
)
150+
exit(1)
138151
signing_context = AdhocSigningContext(
139152
codesign_identity=args.ad_hoc_codesign_identity
140153
)
@@ -153,6 +166,10 @@ def _main() -> None:
153166
provisioning_profile_filter=args.provisioning_profile_filter,
154167
)
155168

169+
if args.only_select_provisioning_profile:
170+
print(signing_context.selected_profile_info.profile.file_path)
171+
return
172+
156173
bundle_path = CodesignedPath(
157174
path=args.bundle_path,
158175
entitlements=args.entitlements,

0 commit comments

Comments
 (0)