From 06b208f3535af13286efc34ddd83621f4f20c907 Mon Sep 17 00:00:00 2001 From: Mikkel Nygaard Ravn Date: Thu, 5 Apr 2018 22:47:03 +0200 Subject: [PATCH] Make Podfiles work with Cocoapods 1.5.0 (#16273) --- packages/flutter_tools/templates/cocoapods/Podfile-objc | 9 ++++----- packages/flutter_tools/templates/cocoapods/Podfile-swift | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/flutter_tools/templates/cocoapods/Podfile-objc b/packages/flutter_tools/templates/cocoapods/Podfile-objc index cdaa7b5efa..dc1da606a7 100644 --- a/packages/flutter_tools/templates/cocoapods/Podfile-objc +++ b/packages/flutter_tools/templates/cocoapods/Podfile-objc @@ -30,7 +30,6 @@ target 'Runner' do # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock # referring to absolute paths on developers' machines. system('rm -rf Pods/.symlinks') - system('mkdir -p Pods/.symlinks/flutter') system('mkdir -p Pods/.symlinks/plugins') # Flutter Pods @@ -40,16 +39,16 @@ target 'Runner' do end generated_xcode_build_settings.map { |p| if p[:name] == 'FLUTTER_FRAMEWORK_DIR' - symlink = File.join('Pods', '.symlinks', 'flutter', File.basename(p[:path])) - File.symlink(p[:path], symlink) - pod 'Flutter', :path => symlink + symlink = File.join('Pods', '.symlinks', 'flutter') + File.symlink(File.dirname(p[:path]), symlink) + pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) end } # Plugin Pods plugin_pods = parse_KV_file('../.flutter-plugins') plugin_pods.map { |p| - symlink = File.join('Pods', '.symlinks', 'plugins', File.basename(p[:path])) + symlink = File.join('Pods', '.symlinks', 'plugins', p[:name]) File.symlink(p[:path], symlink) pod p[:name], :path => File.join(symlink, 'ios') } diff --git a/packages/flutter_tools/templates/cocoapods/Podfile-swift b/packages/flutter_tools/templates/cocoapods/Podfile-swift index aeee6478c7..e666bfb60f 100644 --- a/packages/flutter_tools/templates/cocoapods/Podfile-swift +++ b/packages/flutter_tools/templates/cocoapods/Podfile-swift @@ -32,7 +32,6 @@ target 'Runner' do # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock # referring to absolute paths on developers' machines. system('rm -rf Pods/.symlinks') - system('mkdir -p Pods/.symlinks/flutter') system('mkdir -p Pods/.symlinks/plugins') # Flutter Pods @@ -42,16 +41,16 @@ target 'Runner' do end generated_xcode_build_settings.map { |p| if p[:name] == 'FLUTTER_FRAMEWORK_DIR' - symlink = File.join('Pods', '.symlinks', 'flutter', File.basename(p[:path])) - File.symlink(p[:path], symlink) - pod 'Flutter', :path => symlink + symlink = File.join('Pods', '.symlinks', 'flutter') + File.symlink(File.dirname(p[:path]), symlink) + pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) end } # Plugin Pods plugin_pods = parse_KV_file('../.flutter-plugins') plugin_pods.map { |p| - symlink = File.join('Pods', '.symlinks', 'plugins', File.basename(p[:path])) + symlink = File.join('Pods', '.symlinks', 'plugins', p[:name]) File.symlink(p[:path], symlink) pod p[:name], :path => File.join(symlink, 'ios') }