Commit Graph

8 Commits

Author SHA1 Message Date
Lau Ching Jun
d5a0fcd5af
Locate the template directory using a TemplatePathProvider. (#132156)
So that the paths can be overridden.
2023-08-08 21:43:00 +00:00
Ian Hickson
9c7a9e779f
Give channel descriptions in flutter channel, use branch instead of upstream for channel name (#126936)
## How we determine the channel name

Historically, we used the current branch's upstream to figure out the current channel name. I have no idea why. I traced it back to https://github.com/flutter/flutter/pull/446/files where @abarth implement this and I reviewed that PR and left no comment on it at the time.

I think this is confusing. You can be on a branch and it tells you that your channel is different. That seems weird.

This PR changes the logic to uses the current branch as the channel name.

## How we display channels

The main reason this PR exists is to add channel descriptions to the `flutter channel` list:

```
ianh@burmese:~/dev/flutter/packages/flutter_tools$ flutter channel
Flutter channels:
  master (tip of tree, for contributors)
  main (tip of tree, follows master channel)
  beta (updated monthly, recommended for experienced users)
  stable (updated quarterly, for new users and for production app releases)
* foo_bar

Currently not on an official channel.
ianh@burmese:~/dev/flutter/packages/flutter_tools$
```

## Other changes

I made a few other changes while I was at it:

* If you're not on an official channel, we used to imply `--show-all`, but now we don't, we just show the official channels plus yours. This avoids flooding the screen in the case the user is on a weird channel and just wants to know what channel they're on.
* I made the tool more consistent about how it handles unofficial branches. Now it's always `[user branch]`.
* I slightly adjusted how unknown versions are rendered so it's clearer the version is unknown rather than just having the word "Unknown" floating in the output without context.
* Simplified some of the code.
* Made some of the tests more strict (checking all output rather than just some aspects of it).
* Changed the MockFlutterVersion to implement the FlutterVersion API more strictly.
* I made sure we escape the output to `.metadata` to avoid potential injection bugs (previously we just inlined the version and channel name verbatim with no escaping, which is super sketchy).
* Tweaked the help text for the `downgrade` command to be clearer.
* Removed some misleading text in some error messages.
* Made the `.metadata` generator consistent with the template file.
* Removed some obsolete code to do with the `dev` branch.

## Reviewer notes

I'm worried that there are implications to some of these changes that I am not aware of, so please don't assume I know what I'm doing when reviewing this code. :-)
2023-05-23 19:59:20 +00:00
hellohuanlin
dcae424783
[tools]build ipa validate template icon files (#114841)
* [tools]build ipa validate template icon files

* use the same box for both validations, and added some unit test, and some nits

* add unit test for templateImageDirectory

* use fs.path.join intead of raw path

* use the correct filesystem

* lint

* use absolute path for flutter_template_images

* fix rebase

* update indentation
2022-11-16 19:29:17 +00:00
Jenn Magder
261ea1baef
Suppress created file list for new "flutter create" projects (#93041) 2021-11-04 10:03:02 -07:00
Jenn Magder
8865212254
Migrate doctor to null safety (#92131) 2021-11-01 12:13:02 -07:00
Filip Hracek
76d5e62f42
Add a more complete app template for Flutter (skeleton) (#83530) 2021-06-28 15:26:04 -07:00
Hattomo (TomohiroHattori)
08a70e7ac8
Enable avoid_escaping_inner_quotes lint (#81153) 2021-05-19 09:54:02 -07:00
Jenn Magder
beec6106fa
Migrate template to null safety (#80016) 2021-04-08 15:19:03 -07:00