11 Commits

Author SHA1 Message Date
10486b0ceb [flutter_plugin_tools] Split common.dart (#4057)
common.dart is a large-and-growing file containing all shared code,
which makes it hard to navigate. To make maintenance easier, this splits
the file (and its test file) into separate files for each major
component or category.
2021-06-16 12:37:30 -07:00
038c1796b0 [flutter_plugin_tools] Migrate publish and version checks to NNBD (#4037)
Migrates publish-check and version-check commands to NNBD.

Reworks the version-check flow so that it's more consistent with the other commands: instead of immediately exiting on failure, it checks all plugins, gathers failures, and summarizes all failures at the end. This ensures that we don't have failures in one package temporarily masked by failures in another, so PRs don't need to go through as many check cycles.

Part of https://github.com/flutter/flutter/issues/81912
2021-06-11 19:10:41 -04:00
cb92e5d416 Enable macOS XCTest support (#4043)
- Adds macOS support to the `xctest` tool command
- Adds logic to the tool to check for packages that delegate their implementations
  to another package, so they can be skipped when running native unit tests
  - Updates the tool's unit test utility for writing pubspecs to be able to make
    delegated federated implementation references to test it
- Adds initial unit tests to the non-deprecated macOS plugins
- Enables macOS XCTesting in CI

macOS portion of https://github.com/flutter/flutter/issues/82445
2021-06-10 17:50:20 -04:00
74d03857f8 [flutter_plugin_tools] Remove global state from tests (#4018)
Eliminates the global test filesystem and global test packages directory, in favor of local versions. This guarantees that each test runs with a clean filesystem state, rather than relying on cleanup. It also simplifies understanding the tests, since everything is done via params and return values instead of needing to know about the magic global variables and which methods mutate them.
2021-06-07 10:04:43 -07:00
bb0a1ea161 [flutter_plugin_tools] Simplify filesystem usage (#4014)
- Replaces most explicit use of `fileSystem` with path construction using the `child*` utility methods
- Removes explicit passing of a filesystem to the commands; we're already passing a `Directory` for the
  root where the tool operates, and we should never be using a different filesystem than that directory's
  filesystem, so passing it was both redundant, and a potential source of test bugs.
2021-06-05 13:32:24 -04:00
04181cf38c Fix publish-check output (#3953) 2021-05-24 08:39:05 -07:00
bd0081258a Begin migrating tools to NNBD (#3891)
- Updates dependencies to null-safe versions
- Migrates common.dart (which doesn't depend on anything)
- Migrates common_tests.dart and its one dependency, utils.dart
- Adds build_runner for Mockito mock generation
- Adds a new utility methods for getting arguments that handle both the casting and the removal of nullability to address a common problematic pattern while migrating code.
  - Converts all files, not just the migrated ones, to those new helpers.

Migrating common.dart and utils.dart should unblock a command-by-command migration to null safety.

Reverts the separate of podspect lints into a step that doesn't do a Flutter upgrade
(https://github.com/flutter/plugins/pull/3700) because without that step we had a
version of Dart too old to run null-safe tooling.

First step of https://github.com/flutter/flutter/issues/81912
2021-05-14 20:04:26 -04:00
87cfd6ab03 [tool] version-check publish-check commands can check against pub (#3840)
Add a PubVersionFinder class to easily fetch the version from pub.

Add an against-pub flag to check-version command, which allows it to check the version against pub server

Make the 'publish-check' command to check against pub to determine if the specific versions of packages need to be published.
Add a log-status flag, which allows the publish-check command to log the final status of the result. This helps other ci tools to easily grab the results and use it to determine what to do next. See option 3 in flutter/flutter#81444

This PR also fixes some tests.

partially flutter/flutter#81444
2021-05-11 12:48:30 -07:00
3c57df37c0 Move all null safety packages' min dart sdk to 2.12.0 (#3822) 2021-04-23 10:19:03 -07:00
3d9e523218 Switch script/tools over to the new analysis options (#3777)
Removes the legacy analysis options override and fixes all resulting issues. This is a combination of dart fix and manual changes (mostly mechanical, but some small restructuring to address warnings more cleanly, such as creating typed structs from args when they are used repeatedly to avoid repeated casting, or making things that were unnecessarily public private).

One small opportunistic extra cleanup is that the handling of null-safety prerelease versions is removed, as any new plugin would be written null-safe from the start, so we no longer need to allow those versions.

Part of flutter/flutter#76229
2021-04-06 13:04:25 -07:00
b98ea9175b Add tests for publish check tool command (#3760) 2021-03-29 07:27:40 -10:00