mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
CocoaPods flow step 2 - don't pod install unless project has plugins (#9741)
* Revert "Revert "Don't try to resolve CocoaPods unless project has plugins" (#9719)" This reverts commit f739e9e0228ba970029d2e1fb5bcbe2303dc6b21. * Remove channels integration test’s partial cocoapods artifacts
This commit is contained in:
parent
c8ad201484
commit
2051669ac7
@ -35,5 +35,3 @@ Icon?
|
||||
/Flutter/Flutter.framework
|
||||
/Flutter/Generated.xcconfig
|
||||
/ServiceDefinitions.json
|
||||
|
||||
Pods/
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
#include "Generated.xcconfig"
|
||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||
|
||||
#include "TestConfig.xcconfig"
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
#include "Generated.xcconfig"
|
||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||
|
||||
#include "TestConfig.xcconfig"
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
# 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
|
||||
|
||||
# Flutter Pods
|
||||
pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR']
|
||||
|
||||
if File.exists? '../.flutter-plugins'
|
||||
flutter_root = File.expand_path('..')
|
||||
File.foreach('../.flutter-plugins') { |line|
|
||||
plugin = line.split(pattern='=')
|
||||
if plugin.length == 2
|
||||
name = plugin[0].strip()
|
||||
path = plugin[1].strip()
|
||||
resolved_path = File.expand_path("#{path}/ios", flutter_root)
|
||||
pod name, :path => resolved_path
|
||||
else
|
||||
puts "Invalid plugin specification: #{line}"
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
post_install do |installer|
|
||||
installer.pods_project.targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['ENABLE_BITCODE'] = 'NO'
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -11,7 +11,6 @@
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
|
||||
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
913134F849F6C8DEAC837F96 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C803412E9584DEAC0259A174 /* Pods_Runner.framework */; };
|
||||
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
|
||||
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
|
||||
@ -57,7 +56,6 @@
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
C803412E9584DEAC0259A174 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -67,20 +65,12 @@
|
||||
files = (
|
||||
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
|
||||
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
|
||||
913134F849F6C8DEAC837F96 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
840012C8B5EDBCF56B0E4AC1 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -101,7 +91,6 @@
|
||||
9740EEB11CF90186004384FC /* Flutter */,
|
||||
97C146F01CF9000F007C117D /* Runner */,
|
||||
97C146EF1CF9000F007C117D /* Products */,
|
||||
840012C8B5EDBCF56B0E4AC1 /* Pods */,
|
||||
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
@ -138,14 +127,6 @@
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C803412E9584DEAC0259A174 /* Pods_Runner.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
|
||||
@ -4,7 +4,4 @@
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
||||
@ -4,7 +4,4 @@
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
||||
@ -152,9 +152,10 @@ Future<XcodeBuildResult> buildXcodeProject({
|
||||
// copied over to a location that is suitable for Xcodebuild to find them.
|
||||
final Directory appDirectory = fs.directory(app.appDirectory);
|
||||
await _addServicesToBundle(appDirectory);
|
||||
injectPlugins();
|
||||
final bool hasFlutterPlugins = injectPlugins();
|
||||
|
||||
await _runPodInstall(appDirectory, flutterFrameworkDir(mode));
|
||||
if (hasFlutterPlugins)
|
||||
await _runPodInstall(appDirectory, flutterFrameworkDir(mode));
|
||||
|
||||
final List<String> commands = <String>[
|
||||
'/usr/bin/env',
|
||||
|
||||
@ -194,7 +194,11 @@ void _writeIOSPluginRegistry(String directory, List<Plugin> plugins) {
|
||||
|
||||
}
|
||||
|
||||
void injectPlugins({String directory}) {
|
||||
/// Finds Flutter plugins in the pubspec.yaml, creates platform injection
|
||||
/// registries classes and add them to the build depedencies.
|
||||
///
|
||||
/// Returns whether any Flutter plugins are added.
|
||||
bool injectPlugins({String directory}) {
|
||||
directory ??= fs.currentDirectory.path;
|
||||
final List<Plugin> plugins = _findPlugins(directory);
|
||||
_writeFlutterPluginsList(directory, plugins);
|
||||
@ -202,4 +206,5 @@ void injectPlugins({String directory}) {
|
||||
_writeAndroidPluginRegistry(directory, plugins);
|
||||
if (fs.isDirectorySync(fs.path.join(directory, 'ios')))
|
||||
_writeIOSPluginRegistry(directory, plugins);
|
||||
return plugins.isNotEmpty;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user