diff --git a/dev/devicelab/bin/tasks/build_ios_framework_module_test.dart b/dev/devicelab/bin/tasks/build_ios_framework_module_test.dart index ca5fbe6c412b..bae64dffdcd5 100644 --- a/dev/devicelab/bin/tasks/build_ios_framework_module_test.dart +++ b/dev/devicelab/bin/tasks/build_ios_framework_module_test.dart @@ -810,6 +810,41 @@ Future _testBuildMacOSFramework(Directory projectDir) async { 'GeneratedPluginRegistrant.swift', )); + section('Validate embed FlutterMacOS.framework with CocoaPods'); + + final File podspec = File(path.join( + cocoapodsOutputPath, + 'Debug', + 'FlutterMacOS.podspec', + )); + + podspec.writeAsStringSync( + podspec.readAsStringSync().replaceFirst('null.null.0', '0.0.0'), + ); + + final Directory macosDirectory = Directory(path.join(projectDir.path, 'macos')); + final File podfile = File(path.join(macosDirectory.path, 'Podfile')); + final String currentPodfile = podfile.readAsStringSync(); + + // Temporarily test Add-to-App Cocoapods podspec for framework + podfile.writeAsStringSync(''' +target 'Runner' do + # Comment the next line if you don't want to use dynamic frameworks + use_frameworks! + + pod 'FlutterMacOS', :podspec => '${podspec.path}' +end +'''); + await inDirectory(macosDirectory, () async { + await eval('pod', ['install']); + }); + + // Change podfile back to original + podfile.writeAsStringSync(currentPodfile); + await inDirectory(macosDirectory, () async { + await eval('pod', ['install']); + }); + section('Build frameworks without plugins'); await _testBuildFrameworksWithoutPlugins(projectDir, platform: 'macos'); } diff --git a/packages/flutter_tools/lib/src/commands/build_macos_framework.dart b/packages/flutter_tools/lib/src/commands/build_macos_framework.dart index 384d1df53cf7..30d1a705afe1 100644 --- a/packages/flutter_tools/lib/src/commands/build_macos_framework.dart +++ b/packages/flutter_tools/lib/src/commands/build_macos_framework.dart @@ -186,7 +186,7 @@ $licenseSource LICENSE } s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } - s.source = { :http => '${cache.storageBaseUrl}/flutter_infra_release/flutter/${cache.engineRevision}/$artifactsMode/artifacts.zip' } + s.source = { :http => '${cache.storageBaseUrl}/flutter_infra_release/flutter/${cache.engineRevision}/$artifactsMode/FlutterMacOS.framework.zip' } s.documentation_url = 'https://flutter.dev/docs' s.osx.deployment_target = '10.14' s.vendored_frameworks = 'FlutterMacOS.framework' diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_darwin_framework_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_darwin_framework_test.dart index 5b84d3f65920..605e1dff7e2b 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_darwin_framework_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_darwin_framework_test.dart @@ -470,7 +470,7 @@ void main() { final File expectedPodspec = outputDirectory.childFile('FlutterMacOS.podspec'); final String podspecContents = expectedPodspec.readAsStringSync(); - expect(podspecContents, contains("'$storageBaseUrl/flutter_infra_release/flutter/$engineRevision/darwin-x64/artifacts.zip'")); + expect(podspecContents, contains("'$storageBaseUrl/flutter_infra_release/flutter/$engineRevision/darwin-x64/FlutterMacOS.framework.zip'")); }, overrides: { FileSystem: () => memoryFileSystem, ProcessManager: () => FakeProcessManager.any(), @@ -489,7 +489,7 @@ void main() { final File expectedPodspec = outputDirectory.childFile('FlutterMacOS.podspec'); final String podspecContents = expectedPodspec.readAsStringSync(); - expect(podspecContents, contains("'$storageBaseUrl/flutter_infra_release/flutter/$engineRevision/darwin-x64-profile/artifacts.zip'")); + expect(podspecContents, contains("'$storageBaseUrl/flutter_infra_release/flutter/$engineRevision/darwin-x64-profile/FlutterMacOS.framework.zip'")); }, overrides: { FileSystem: () => memoryFileSystem, ProcessManager: () => FakeProcessManager.any(), @@ -508,7 +508,7 @@ void main() { final File expectedPodspec = outputDirectory.childFile('FlutterMacOS.podspec'); final String podspecContents = expectedPodspec.readAsStringSync(); - expect(podspecContents, contains("'$storageBaseUrl/flutter_infra_release/flutter/$engineRevision/darwin-x64-release/artifacts.zip'")); + expect(podspecContents, contains("'$storageBaseUrl/flutter_infra_release/flutter/$engineRevision/darwin-x64-release/FlutterMacOS.framework.zip'")); }, overrides: { FileSystem: () => memoryFileSystem, ProcessManager: () => FakeProcessManager.any(),