spotify / XCRemoteCache

Other
825 stars 50 forks source link

Reset cflags and swiftflags on each cocoapods integration #197

Closed polac24 closed 1 year ago

polac24 commented 1 year ago

This is a follow-up to #196, reported here. I made a silly mistake and introduced reset_build_setting method never used is, while the intention was to call it instead that method instead of add_build_setting.

Rationale

add_build_setting is a method that 1) adds the "main" build setting to all configurations (e.g. MY_VALIE=12 and 2) overrides that with an empty value for all sdks that should be excluded (e.g. MY_VALUE[sdk=iphone*]=). Later, if you enable back previously excluded sdk (by deleting it from a list in a Podfile), the plugin doesn't remove the previously added override from step 2.

The updated flow:

  1. deletes all already defined build settings: both the "main" one (e.g. MY_VALUE=123) and "overrides" (e.g. MY_VALUE[sdk=iphonesimulator*]=44)
  2. Sets new value + optional overrides from scratch.