Fix rive_native setup script path in macOS Podfile

Ensures the rive_native setup script runs from the project root by setting PROJECT_ROOT and changing directory, allowing pubspec.yaml to be found in CI environments.
This commit is contained in:
Feodor Fitsner 2026-01-16 19:55:05 -08:00
parent d110f4c030
commit 0b1778d764
1 changed files with 13 additions and 0 deletions

View File

@ -37,7 +37,20 @@ target 'Runner' do
end
post_install do |installer|
# Ensure rive_native's setup script runs from the project root so pubspec.yaml is found in CI.
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
next unless target.name == 'rive_native'
target.shell_script_build_phases.each do |phase|
script = phase.shell_script
next unless script&.include?('rive_native:setup')
next if script.include?('PROJECT_ROOT="${SRCROOT}/../.."')
phase.shell_script = script.sub(
"set -e\n",
"set -e\nPROJECT_ROOT=\"${SRCROOT}/../..\"\ncd \"$PROJECT_ROOT\"\n"
)
end
end
end