Updated obsolete URL#52158
Conversation
|
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. |
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
|
@googlebot I signed it! |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
There was a problem hiding this comment.
that link still loses the #android-setup by the time you select your platform.
There was a problem hiding this comment.
it won't be https://flutter.dev/docs/get-started/install anymore, I think it's still better then https://flutter.dev/setup/ that is redirect only
There was a problem hiding this comment.
Would https://flutter.dev/docs/get-started/install without the anchor be better (since it doesn't imply any android info), plus create an issue to switch on https://flutter.dev/docs/get-started/install/windows, https://flutter.dev/docs/get-started/install/macos etc based on the current platform?
There was a problem hiding this comment.
Or you can make that platform switch happen in this review if you want, @Dmitry-Borodin
There was a problem hiding this comment.
Will check tomorrow how can easy can I get the platform in dart.
There was a problem hiding this comment.
@jmagman updated PR, made urls platform dependent, please take a look
I tested some random messages on my computer, but don't see a nice possibility how to add autotests to the project.
The code is straightforward and can run on any platform, so test will just copy the code it should test
|
I see CI error "flutter build is currently broken", but I don't see if I should do something about it. Looks like it's not related to my changes. |
There was a problem hiding this comment.
Try:
import 'globals.dart' as globals; String get _androidSdkInstallUrl {
if (globals.platform.isMacOS) {
return 'https://flutter.dev/docs/get-started/install/macos#android-setup';
}
...There was a problem hiding this comment.
That I cannot compile on my machine
Unable to spawn isolate: lib/src/base/user_messages.dart:6:8: Error: Error when reading 'lib/src/base/globals.dart': No such file or directory
import 'globals.dart' as globals;
^
Why dart:io is forbidden? Isn't it a standard library of the language?
There was a problem hiding this comment.
That I cannot compile on my machine
I was just indicating how this is done everywhere else (so you can mock out the platform you're on in tests). grep around for isMacOS and you'll see how it's done.
You need to adjust the import to point to the relative path:
import '../globals.dart' as globals;
Why dart:io is forbidden? Isn't it a standard library of the language?
You would import lib/src/base/io.dart if you need something in there, see #7390 and #7385 re:testability.
But in your case the mockable platform logic is in globals.dart so just import that.
There was a problem hiding this comment.
Thank you very much for clarification. Done.
|
^^ rebased on upstream master |
|
Checked tests CI writing to logs - like devices_test.dart and ios_device_start_prebuilt_test.dart - those looks unrelated to my changes and are passing on my machine. |
|
It is related. I took the liberty of pushing a new commit to your fork that injects the platform into |
|
@zanderso Would you mind reviewing since I wrote part of it? None of these strings are overridden in g3. |
| _androidSdk.sdkManagerPath, | ||
| kAndroidSdkMinVersion, | ||
| kAndroidSdkBuildToolsMinVersion.toString(), | ||
| _platform |
|
|
||
| String _androidSdkInstallUrl(Platform platform) { | ||
| if (platform.isMacOS) { | ||
| return 'https://flutter.dev/docs/get-started/install/macos#android-setup'; |
There was a problem hiding this comment.
Maybe pull 'https://flutter.dev/docs/get-started/install' and 'android-setup' out into locals to avoid repeating them.
There was a problem hiding this comment.
Done, though I think it's harder to read.
(The more correct thing would be to construct a Uri but that seems over-engineered for this one.)
|
Thank you for your contribution, @Dmitry-Borodin! |
Description
Replaced obsolete URL to actual one
Related Issues
Fixes #51815
Tests
I added no tests:
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Actually, this^^ reports thousands of errors. But they are not related to my changes.
Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.