diff --git a/script/tool/lib/src/podspec_check_command.dart b/script/tool/lib/src/podspec_check_command.dart index aa3448b0af0d..96df0db31d90 100644 --- a/script/tool/lib/src/podspec_check_command.dart +++ b/script/tool/lib/src/podspec_check_command.dart @@ -169,6 +169,11 @@ class PodspecCheckCommand extends PackageLoopingCommand { .childDirectory(package.directory.basename) .childFile('Package.swift') .path; + final String darwinSwiftPackageManifestPath = package.directory + .childDirectory('darwin') + .childDirectory(package.directory.basename) + .childFile('Package.swift') + .path; return getFilesForPackage(package).any((File entity) { final String relativePath = getRelativePosixPath(entity, from: package.directory); @@ -178,6 +183,7 @@ class PodspecCheckCommand extends PackageLoopingCommand { } final String filePath = entity.path; return filePath != iosSwiftPackageManifestPath && + filePath != darwinSwiftPackageManifestPath && path.extension(filePath) == '.swift'; }); } diff --git a/script/tool/test/podspec_check_command_test.dart b/script/tool/test/podspec_check_command_test.dart index cf5938a4ae42..5ffa4bf2cb13 100644 --- a/script/tool/test/podspec_check_command_test.dart +++ b/script/tool/test/podspec_check_command_test.dart @@ -405,6 +405,28 @@ void main() { )); }); + test( + 'does not require the search paths workaround for darwin Package.swift', + () async { + final RepositoryPackage plugin = createFakePlugin( + 'plugin1', + packagesDir, + extraFiles: <String>['darwin/plugin1/Package.swift'], + ); + _writeFakePodspec(plugin, 'darwin'); + + final List<String> output = + await runCapturingPrint(runner, <String>['podspec-check']); + + expect( + output, + containsAllInOrder( + <Matcher>[ + contains('Ran for 1 package(s)'), + ], + )); + }); + test('does not require the search paths workaround for macOS plugins', () async { final RepositoryPackage plugin = createFakePlugin('plugin1', packagesDir,