Unverified Commit 8415c0fd authored by Mikkel Nygaard Ravn's avatar Mikkel Nygaard Ravn Committed by GitHub

Modernize Podfile in examples/platform_view (#17643)

parent f3874359
......@@ -66,6 +66,7 @@ unlinked_spec.ds
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
......
# Example of switching between full-screen Flutter and Platform View
This project demonstrates how to bring up a full-screen iOS/Android view from a full-screen Flutter view along with passing data back and forth between the two.
\ No newline at end of file
This project demonstrates how to bring up a full-screen iOS/Android view from a
full-screen Flutter view along with passing data back and forth between the two.
On iOS we use a CocoaPods dependency to add a Material Design button, and so
`pod install` needs to be invoked in the `ios/` folder before `flutter run`:
```
pushd ios/ ; pod install ; popd
flutter run
```
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
if ENV['FLUTTER_FRAMEWORK_DIR'] == nil
abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework')
end
target 'Runner' do
use_frameworks!
# Pods for Runner
pod 'MaterialControls'
# Flutter Pods
pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR']
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
if File.exists? '../.flutter-plugins'
flutter_root = File.expand_path('..')
File.foreach('../.flutter-plugins') { |line|
plugin = line.split(pattern='=')
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
pods_ary = []
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
name = plugin[0].strip()
podname = plugin[0].strip()
path = plugin[1].strip()
resolved_path = File.expand_path("#{path}/ios", flutter_root)
pod name, :path => resolved_path
podpath = File.expand_path("#{path}", file_abs_path)
pods_ary.push({:name => podname, :path => podpath});
else
puts "Invalid plugin specification: #{line}"
end
}
}
return pods_ary
end
target 'Runner' do
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
# Flutter Pods
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
if generated_xcode_build_settings.empty?
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
end
generated_xcode_build_settings.map { |p|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
symlink = File.join('.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('.symlinks', 'plugins', p[:name])
File.symlink(p[:path], symlink)
pod p[:name], :path => File.join(symlink, 'ios')
}
pod 'MaterialControls'
end
post_install do |installer|
......
......@@ -3,13 +3,21 @@ PODS:
- MaterialControls (1.2.2)
DEPENDENCIES:
- Flutter (from `/Users/zarah/flutter/bin/cache/artifacts/engine/ios`)
- Flutter (from `.symlinks/flutter/ios`)
- MaterialControls
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- MaterialControls
EXTERNAL SOURCES:
Flutter:
:path: ".symlinks/flutter/ios"
SPEC CHECKSUMS:
Flutter: d674e78c937094a75ac71dd77e921e840bea3dbf
Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296
MaterialControls: 1c6b29e78d3a13d8dd6a67ed31b6d26eb5de8f72
PODFILE CHECKSUM: d6aabe8e71e2432dda8b99c2a5dbd2bdd65b3c0c
PODFILE CHECKSUM: 4a320bf98e7f7e414d7d7f5079edf1b2d6679c9b
COCOAPODS: 1.2.1
COCOAPODS: 1.5.2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment