Skip to content

Move macOS Podfile logic into the tool #72020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 17, 2020
Merged

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Dec 9, 2020

Description

macOS variants of #59209 and #59044 and the CocoaPods linking part of #70224

  • Move macOS Podfile logic into the tool so changes can be easily made without the user needing to migrate or regenerate their Podfile.
  • Parse .flutter-plugins-dependencies instead of the old .flutter-plugins to only embed the macos-enabled plugins via CocoaPods.
  • Move the Flutter search path and linking behavior out of CocoaPods by generating a "fake" FlutterMacOS.podspec that doesn't point to a real framework (see Move Flutter.framework to build directory instead of ios/Flutter #70224 for how the same thing is done for iOS). This is necessary because plugin podspecs contain s.dependency 'FlutterMacOS' and CocoaPods will try to download it from the CoocaPods trunk if the Podfile doesn't pod 'FlutterMacOS', :path => relative/file. This has the advantage of making the Podfile.lock stable so :path: Flutter/ephemeral/.symlinks/flutter/darwin-x64-release becomes :path: Flutter/ephemeral/ and doesn't change if you run in different build modes, so can be checked into the user's repo if desired.
  • Search path and linking is now handled by adding build settings in the Podfile via the podhelper.rb. Plugins will now link on the frameworks in the artifact cache. This means the engine artifacts don't need to be symlinked and referred to by CocoaPods, which could have been hairy if any codesigning or (future) ARM thinning actually edited these files.
  • Remove now-unused FLUTTER_FRAMEWORK_DIR build setting.
  • Show warning to tell user to regenerate their Podfile

Related Issues

Fixes #46618
#59044
#71953
#70735
One fewer instance of #48918

Tests

Updated plugin_lint_mac

@jmagman jmagman added platform-mac Building on or for macOS specifically t: xcode "xcodebuild" on iOS and general Xcode project management labels Dec 9, 2020
@jmagman jmagman self-assigned this Dec 9, 2020
@flutter-dashboard flutter-dashboard bot added c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. labels Dec 9, 2020
@google-cla google-cla bot added the cla: yes label Dec 9, 2020
@jmagman
Copy link
Member Author

jmagman commented Dec 15, 2020

Rebased on #72372, removed install! 'cocoapods', :disable_input_output_paths => true from the podhelper script.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I love seeing fewer of our internal build details baked into checked-in project files.

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "make sure 'flutter pub get' is executed first" (to make parsing out the command part easier)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen Shot 2020-12-17 at 10 34 25 AM

return true if line =~ /^\s*macos:/
}
return false
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run flutter pub get"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: contributor-productivity Team-specific productivity, code health, technical debt. platform-mac Building on or for macOS specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow plugins not to support macOS
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy