I used to use the following script build phase to set buildkonfig.flavor
property on kotlin version 1.19.20
and it worked fine:
cd "$SRCROOT/.." && ./gradlew :shared:embedAndSignAppleFrameworkForXcode -P buildkonfig.flavor=prod
But since updating to kotlin to version 2.0.0
, it does not compile and says:
'embedAndSign' task can not be used in a project with dependencies to pods.
I tried switching to any other task like build
, assemble
or generateBuildKonfig
, and moving the build phase up and down the list. It compiles & runs, but the property is not set.
Upon reverting back to original versions it turns out that the flavor is also not set when using other tasks instead of embedAndSignAppleFrameworkForXcode
.
So I guess the question is:
What other task can I use to set gradle property from XCode target’s build phases instead, since the embedAndSignAppleFrameworkForXcode
is now prohibited for CocoaPods?