Skip to content

Conversation

@christopherfujino
Copy link
Contributor

Add two checks before running test to make this script more user-friendly to run locally from the command line.

  1. Check platform is macOS.
  2. Check the cache is up to date.

@fluttergithubbot fluttergithubbot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Feb 6, 2020
@fluttergithubbot
Copy link
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@christopherfujino
Copy link
Contributor Author

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

This change is a test.

'find',
<String>[
cacheDirectory,
rootDirectory,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we default this to something non-null? Or make it a non-optional parameter and assert it's not null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. i had a fallback default, forget why I deleted it...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


for (final String binaryPath in findBinaryPaths()) {
if (!Platform.isMacOS) {
print('Warning! This script only works on macOS, as it requires Xcode.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uber-nit: on CI, this might read strangely if you thought it was running on macOS, and it might be helpful to just print out Platform.operatingSystem in here.

Ideally we'd also want to make sure the binaries we need (e.g. codesign) are on the path, but it's probably fine to skip that for this script.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated error message.

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits.

final String flutterRepoRoot = path.normalize(path.join(path.dirname(Platform.script.path), '..', '..'));
return path.normalize(path.join(flutterRepoRoot, 'bin', 'cache'));
}
String get repoRoot => path.normalize(path.join(path.dirname(Platform.script.toFilePath()), '..', '..'));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the previous of this script actually failed on cirrus because the space in the script file path was escaped. changing Platform.script.path -> Platform.script.toFilePath() fixed that.

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@christopherfujino christopherfujino merged commit b65f421 into flutter:master Feb 7, 2020
@christopherfujino christopherfujino deleted the update-codesign-check branch February 7, 2020 22:34
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants