bazel-ios / cocoapods-bazel

A Cocoapods plugin for automatically generating Bazel BUILD files
Apache License 2.0
110 stars 21 forks source link

Add experimental features concept and implement experimental_deps_debug_and_release #45

Closed thiagohmcruz closed 3 years ago

thiagohmcruz commented 3 years ago
thiagohmcruz commented 3 years ago

Added 1 suggestion inline - I was also curious about if this was some internal thing or part of the cocoapods spec?

This is to support dogfood builds in internal apps but I'm trying to find a generic solution here, suggestions appreciated!

jerrymarino commented 3 years ago

So the predicate configuration is in cocoapods? I noticed it in the docs here: https://guides.cocoapods.org/syntax/podspec.html#dependency

I'm not super familiar with how that logic is working: e.g. doesn't that add the dependencies to both of them? I'd suggest to follow that behavior as the source of truth / requirements.

thiagohmcruz commented 3 years ago

So the predicate configuration is in cocoapods? I noticed it in the docs here:

https://guides.cocoapods.org/syntax/podspec.html#dependency

I'm not super familiar with how that logic is working: e.g. doesn't that add the dependencies to both of them? I'd suggest to follow that behavior as the source of truth / requirements.

I think I have a way to solve it without introducing a breaking change

Thx for the feedback here, will push the changes soon!

thiagohmcruz commented 3 years ago

@congt @jerrymarino this changed significantly and it's now a opt-in feature, PTAL.

congt commented 3 years ago

Could you document the usage of deps_config_setting_overrides somewhere?

thiagohmcruz commented 3 years ago

FYI working on some changes discussed offline with @congt. Essentially we'll go back to the original implementation here but as an opt-in feature instead of changing behaviour.

We agreed that giving the users the ability to override the configs with any arbitrary config can cause confusion and depending on the usage client side can become fragile (the bazel config can be anything, and that can cause conflicts in the select() statements depending on the consumer's setup).

So I'll make the API here more strict, the underlying behaviour will be the same. A consumer will be able to set a boolean saying feature_custom_deps_config_name = true/false (or something like that) and then cocoapods-bazel will generate

Only for the deps attr. This way we decouple other attrs and deps and the API is still limited to a strict set of values defined by cocoapods-bazel.

One other opt-in feature will be something like feature_deps_generate_debug_and_release = true/false so on top of the above a consumer can also ask cocoapods-bazel to generate debug_and_release deps (to address the use case mentioned in the PR description)

These feature can be combined or used independently