bazelbuild / rules_apple

Bazel rules to build apps for Apple platforms.
Apache License 2.0
505 stars 260 forks source link

Allow passing provisioning profile from command line #1992

Open louwers opened 1 year ago

louwers commented 1 year ago

We don't want to hardcode a team ID or other provisioning profile details in our build files. We use rules_apple for an open source project (MapLibre Native) and we want everyone to be able to build the project without having to edit the build files first.

It would be helpful if a provisioning profile could be supplied from the command line for this.

keith commented 1 year ago

related convo for others: https://github.com/bazelbuild/rules_apple/discussions/1957

ali-fareed commented 1 year ago

As a workaround, it's possible to pass provisioning profiles (or any kind of data) via repository overrides. This can be done using the following command:

bazel build --override_repository=provisioning_profiles=$path_to_directory

Here, $path_to_directory should point to a valid Bazel workspace, which includes:

Once set up, it can be used with ios_application:

ios_application(
    ...
    provisioning_profile = "@provisioning_profiles//Profile.mobileprovision"
    ...
)
louwers commented 1 year ago

We are now generating a .bzl file with a Team ID and a Profile UUID as a workaround.