Idan
01/17/2023, 5:59 PM-Pbuildkonfig.flavor=flavor
so I added noPodspec()
to cocoapods {} in build.gradle.kts and manually edit shared.podspec -Pbuildkonfig.flavor=flavor to the build phase
hardcoding the flavor is working but I want to set ENV VAR from the target in xcode,
is it possible?
spec.script_phases = [
{
:name => 'Build shared',
:execution_position => :before_compile,
:shell_path => '/bin/sh',
:script => <<-SCRIPT
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
exit 0
fi
set -ev
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
-Pkotlin.native.cocoapods.archs="$ARCHS" \
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION" \
-Pbuildkonfig.flavor=$APP_ENV
SCRIPT
}
]
script_phases
from build.gradle so I can keep the podspec gen?a-dd
01/17/2023, 6:59 PMtasks.withType<org.jetbrains.kotlin.gradle.tasks.PodspecTask>().configureEach {
doLast {
editScriptPhases(outputFile)
}
}
Idan
01/18/2023, 12:55 PM