Skip to content

Commit

Permalink
Avoid punishing non-darwin plugins, and update goldens
Browse files Browse the repository at this point in the history
  • Loading branch information
sigurdm committed Oct 24, 2024
1 parent c2d37f8 commit 51a356c
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 7 deletions.
9 changes: 5 additions & 4 deletions lib/src/tag/tagger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -365,21 +365,22 @@ class Tagger {
return true;
}

var support = true;
var isDarwinPlugin = false;
var swiftPmSupport = true;

for (final darwinOs in ['macos', 'ios']) {
if (pathExists(
pubspec.originalYaml, ['flutter', 'plugin', 'platforms', darwinOs])) {
isDarwinPlugin = true;
final specificPackageSwiftFile =
path.join(darwinOs, packageName, 'Package.swift');
final genericPackageSwiftFile =
path.join('darwin', packageName, 'Package.swift');

if (!(File(path.join(packageDir, specificPackageSwiftFile))
.existsSync() ||
File(path.join(packageDir, genericPackageSwiftFile))
.existsSync())) {
support = false;
swiftPmSupport = false;
explanations.add(Explanation(
'Package does not support the Swift Package Manager on $darwinOs',
'''
Expand All @@ -391,7 +392,7 @@ It contains none of
}
}
}
if (support) {
if (isDarwinPlugin && swiftPmSupport) {
tags.add(PanaTags.isSwiftPackageManagerReady);
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/goldens/end2end/audio_service-0.18.10.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"grantedPoints": 20,
"maxPoints": 20,
"status": "failed",
"summary": "### [*] 20/20 points: Supports 4 of 6 possible platforms (**iOS**, **Android**, **Web**, Windows, **macOS**, Linux)\n\n* ✓ Android\n\n* ✓ iOS\n\n* ✓ macOS\n\n* ✓ Web\n\n\nThese platforms are not supported:\n\n<details>\n<summary>\nPackage does not support platform `Windows`.\n</summary>\n\nBecause:\n* `package:audio_service/audio_service.dart` that declares support for platforms: `Android`, `iOS`, `macOS`, `Web`.\n</details>\n\n<details>\n<summary>\nPackage does not support platform `Linux`.\n</summary>\n\nBecause:\n* `package:audio_service/audio_service.dart` that declares support for platforms: `Android`, `iOS`, `macOS`, `Web`.\n</details>\n\n\nThese issues are present but do not affect the score, because they may not originate in your package:\n\n<details>\n<summary>\nPackage does not support platform `Web`.\n</summary>\n\nBecause:\n* `package:audio_service/audio_service.dart` that imports:\n* `package:flutter_cache_manager/flutter_cache_manager.dart` that imports:\n* `package:flutter_cache_manager/src/storage/cache_info_repositories/cache_info_repositories.dart` that imports:\n* `package:flutter_cache_manager/src/storage/cache_info_repositories/json_cache_info_repository.dart` that imports:\n* `package:path_provider/path_provider.dart` that declares support for platforms: `Android`, `iOS`, `Windows`, `Linux`, `macOS`.\n</details>\n\n### [x] 0/0 points: WASM compatibility\n\n<details>\n<summary>\nPackage not compatible with runtime wasm\n</summary>\n\nBecause:\n* `package:audio_service/audio_service.dart` that imports:\n* `package:flutter_cache_manager/flutter_cache_manager.dart` that imports:\n* `package:flutter_cache_manager/src/web/web_helper.dart` that imports:\n* `package:flutter_cache_manager/src/cache_store.dart` that imports:\n* `package:flutter_cache_manager/src/storage/file_system/file_system.dart` that imports:\n* `package:file/file.dart` that imports:\n* `package:file/src/interface.dart` that imports:\n* `package:file/src/io.dart` that imports:\n* `dart:io`\n</details>\n\nThis package is not compatible with runtime `wasm`, and will not be rewarded full points in a future version of the scoring model.\n\nSee https://dart.dev/web/wasm for details.\n"
"summary": "### [*] 20/20 points: Supports 4 of 6 possible platforms (**iOS**, **Android**, **Web**, Windows, **macOS**, Linux)\n\n* ✓ Android\n\n* ✓ iOS\n\n* ✓ macOS\n\n* ✓ Web\n\n\nThese platforms are not supported:\n\n<details>\n<summary>\nPackage does not support platform `Windows`.\n</summary>\n\nBecause:\n* `package:audio_service/audio_service.dart` that declares support for platforms: `Android`, `iOS`, `macOS`, `Web`.\n</details>\n\n<details>\n<summary>\nPackage does not support platform `Linux`.\n</summary>\n\nBecause:\n* `package:audio_service/audio_service.dart` that declares support for platforms: `Android`, `iOS`, `macOS`, `Web`.\n</details>\n\n\nThese issues are present but do not affect the score, because they may not originate in your package:\n\n<details>\n<summary>\nPackage does not support platform `Web`.\n</summary>\n\nBecause:\n* `package:audio_service/audio_service.dart` that imports:\n* `package:flutter_cache_manager/flutter_cache_manager.dart` that imports:\n* `package:flutter_cache_manager/src/storage/cache_info_repositories/cache_info_repositories.dart` that imports:\n* `package:flutter_cache_manager/src/storage/cache_info_repositories/json_cache_info_repository.dart` that imports:\n* `package:path_provider/path_provider.dart` that declares support for platforms: `Android`, `iOS`, `Windows`, `Linux`, `macOS`.\n</details>\n\n### [x] 0/0 points: WASM compatibility\n\n<details>\n<summary>\nPackage not compatible with runtime wasm\n</summary>\n\nBecause:\n* `package:audio_service/audio_service.dart` that imports:\n* `package:flutter_cache_manager/flutter_cache_manager.dart` that imports:\n* `package:flutter_cache_manager/src/web/web_helper.dart` that imports:\n* `package:flutter_cache_manager/src/cache_store.dart` that imports:\n* `package:flutter_cache_manager/src/storage/file_system/file_system.dart` that imports:\n* `package:file/file.dart` that imports:\n* `package:file/src/interface.dart` that imports:\n* `package:file/src/io.dart` that imports:\n* `dart:io`\n</details>\n\nThis package is not compatible with runtime `wasm`, and will not be rewarded full points in a future version of the scoring model.\n\nSee https://dart.dev/web/wasm for details.\n\n### [x] 0/0 points: Swift Package Manager support\n\n<details>\n<summary>\nPackage does not support the Swift Package Manager on macos\n</summary>\n\nIt contains none of\n* macos/audio_service/Package.swift\n* darwin/audio_service/Package.swift\n\n</details>\n\nThis package for iOS or MacOs does not support the Swift Package Manager. It will not receive full points in a future version of the scoring model.\n\nSee https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors for details.\n"
},
{
"id": "analysis",
Expand Down
17 changes: 17 additions & 0 deletions test/goldens/end2end/audio_service-0.18.10.json_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,23 @@ This package is not compatible with runtime `wasm`, and will not be rewarded ful

See https://dart.dev/web/wasm for details.

### [x] 0/0 points: Swift Package Manager support

<details>
<summary>
Package does not support the Swift Package Manager on macos
</summary>

It contains none of
* macos/audio_service/Package.swift
* darwin/audio_service/Package.swift

</details>

This package for iOS or MacOs does not support the Swift Package Manager. It will not receive full points in a future version of the scoring model.

See https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors for details.


## 50/50 Pass static analysis

Expand Down
4 changes: 2 additions & 2 deletions test/goldens/end2end/url_launcher-6.1.12.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
"title": "Platform support",
"grantedPoints": 20,
"maxPoints": 20,
"status": "passed",
"summary": "### [*] 20/20 points: Supports 6 of 6 possible platforms (**iOS**, **Android**, **Web**, **Windows**, **macOS**, **Linux**)\n\n* ✓ Android\n\n* ✓ iOS\n\n* ✓ Windows\n\n* ✓ Linux\n\n* ✓ macOS\n\n* ✓ Web\n\n### [*] 0/0 points: WASM compatibility\n\nThis package is compatible with runtime `wasm`, and will be rewarded additional points in a future version of the scoring model.\n\nSee https://dart.dev/web/wasm for details.\n"
"status": "failed",
"summary": "### [*] 20/20 points: Supports 6 of 6 possible platforms (**iOS**, **Android**, **Web**, **Windows**, **macOS**, **Linux**)\n\n* ✓ Android\n\n* ✓ iOS\n\n* ✓ Windows\n\n* ✓ Linux\n\n* ✓ macOS\n\n* ✓ Web\n\n### [*] 0/0 points: WASM compatibility\n\nThis package is compatible with runtime `wasm`, and will be rewarded additional points in a future version of the scoring model.\n\nSee https://dart.dev/web/wasm for details.\n\n### [x] 0/0 points: Swift Package Manager support\n\n<details>\n<summary>\nPackage does not support the Swift Package Manager on macos\n</summary>\n\nIt contains none of\n* macos/url_launcher/Package.swift\n* darwin/url_launcher/Package.swift\n\n</details>\n\nThis package for iOS or MacOs does not support the Swift Package Manager. It will not receive full points in a future version of the scoring model.\n\nSee https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors for details.\n"
},
{
"id": "analysis",
Expand Down
17 changes: 17 additions & 0 deletions test/goldens/end2end/url_launcher-6.1.12.json_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@ This package is compatible with runtime `wasm`, and will be rewarded additional

See https://dart.dev/web/wasm for details.

### [x] 0/0 points: Swift Package Manager support

<details>
<summary>
Package does not support the Swift Package Manager on macos
</summary>

It contains none of
* macos/url_launcher/Package.swift
* darwin/url_launcher/Package.swift

</details>

This package for iOS or MacOs does not support the Swift Package Manager. It will not receive full points in a future version of the scoring model.

See https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors for details.


## 50/50 Pass static analysis

Expand Down

0 comments on commit 51a356c

Please sign in to comment.