diff --git a/{{cookiecutter.out_dir}}/ios/Podfile b/{{cookiecutter.out_dir}}/ios/Podfile index 8547703..4cd22bb 100644 --- a/{{cookiecutter.out_dir}}/ios/Podfile +++ b/{{cookiecutter.out_dir}}/ios/Podfile @@ -66,6 +66,19 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + # Ensure rive_native's setup script runs from the project root so pubspec.yaml is found in CI. + if 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 target.build_configurations.each do |config| config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ @@ -85,4 +98,4 @@ post_install do |installer| ] end end -end \ No newline at end of file +end