Skip to content

Commit

Permalink
Switch to more reliable flutter.dev link destinations in the tool (#1…
Browse files Browse the repository at this point in the history
…50587)

Contributes to flutter/website#10363.
  • Loading branch information
parlough authored Jun 26, 2024
1 parent 776efc2 commit c946a5a
Show file tree
Hide file tree
Showing 70 changed files with 137 additions and 140 deletions.
2 changes: 1 addition & 1 deletion packages/flutter_tools/gradle/app_plugin_loader.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
logger.error("You are applying Flutter's app_plugin_loader Gradle plugin \
imperatively using the apply script method, which is deprecated and will be \
removed in a future release. Migrate to applying Gradle plugins with the \
declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply\n\
declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply\n\
")

def pathToThisDirectory = buildscript.sourceFile.parentFile
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_tools/gradle/flutter.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
logger.error("You are applying Flutter's main Gradle plugin imperatively using \
the apply script method, which is deprecated and will be removed in a future \
release. Migrate to applying Gradle plugins with the declarative plugins \
block: https://flutter.dev/go/flutter-gradle-plugin-apply\n")
block: https://flutter.dev/to/flutter-gradle-plugin-apply\n")

def pathToThisDirectory = buildscript.sourceFile.parentFile
apply from: "$pathToThisDirectory/src/main/groovy/flutter.groovy"
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class FlutterPlugin implements Plugin<Project> {
/**
* Flutter Docs Website URLs for help messages.
*/
private final String kWebsiteDeploymentAndroidBuildConfig = "https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration"
private final String kWebsiteDeploymentAndroidBuildConfig = "https://flutter.dev/to/review-gradle-config"

@Override
void apply(Project project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '../base/common.dart';
import '../build_info.dart';

const String kGooglePlayVersioning = 'https://developer.android.com/studio/publish/versioning.html';
const String kSupportedAbis = 'https://flutter.dev/docs/deployment/android#what-are-the-supported-target-architectures';
const String kSupportedAbis = 'https://flutter.dev/to/android-supported-architectures';

/// Validates that the build mode and build number are valid for a given build.
void validateBuild(AndroidBuildInfo androidBuildInfo) {
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/android/gradle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ void printHowToConsumeAar({
''');
}

logger.printStatus('To learn more, visit https://flutter.dev/go/build-aar');
logger.printStatus('To learn more, visit https://flutter.dev/to/integrate-android-archive');
}

String _hex(List<int> bytes) {
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_tools/lib/src/android/gradle_errors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ final GradleHandledError minSdkVersionHandler = GradleHandledError(
'$textInBold\n'
'Following this change, your app will not be available to users running Android SDKs below ${minSdkVersionMatch?.group(2)}.\n'
'Consider searching for a version of this plugin that supports these lower versions of the Android SDK instead.\n'
'For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration',
'For more information, see: https://flutter.dev/to/review-gradle-config',
title: _boxTitle,
);
return GradleBuildStatus.exit;
Expand Down Expand Up @@ -592,7 +592,7 @@ final GradleHandledError incompatibleJavaAndGradleVersionsHandler = GradleHandle
"${globals.logger.terminal.warningMark} Your project's Gradle version "
'is incompatible with the Java version that Flutter is using for Gradle.\n\n'
'If you recently upgraded Android Studio, consult the migration guide '
'at docs.flutter.dev/go/android-java-gradle-error.\n\n'
'at https://flutter.dev/to/to/java-gradle-incompatibility.\n\n'
'Otherwise, to fix this issue, first, check the Java version used by Flutter by '
'running `flutter doctor --verbose`.\n\n'
'Then, update the Gradle version specified in ${gradlePropertiesFile.path} '
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/base/net.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Net {
_logger.printError(error.toString());
throwToolExit(
'The value of $kFlutterStorageBaseUrl ($overrideUrl) could not be '
'parsed as a valid url. Please see https://flutter.dev/community/china '
'parsed as a valid url. Please see https://flutter.dev/to/use-mirror-site '
'for an example of how to use it.\n'
'Full URL: $url',
exitCode: kNetworkProblemExitCode,
Expand Down
19 changes: 9 additions & 10 deletions packages/flutter_tools/lib/src/base/user_messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ class UserMessages {
'Flutter version $version on channel $channel at $flutterRoot';
String get flutterUnknownChannel =>
'Currently on an unknown channel. Run `flutter channel` to switch to an official channel.\n'
"If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.";
"If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.";
String get flutterUnknownVersion =>
'Cannot resolve current version, possibly due to local changes.\n'
'Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.';
'Reinstall Flutter by following instructions at https://flutter.dev/setup.';
String flutterRevision(String revision, String age, String date) =>
'Framework revision $revision ($age), $date';
String flutterUpstreamRepositoryUrl(String url) => 'Upstream repository $url';
String get flutterUpstreamRepositoryUnknown =>
'Unknown upstream repository.\n'
'Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.';
'Reinstall Flutter by following instructions at https://flutter.dev/setup.';
String flutterUpstreamRepositoryUrlEnvMismatch(String url) => 'Upstream repository $url is not the same as FLUTTER_GIT_URL';
String flutterUpstreamRepositoryUrlNonStandard(String url) =>
'Upstream repository $url is not a standard remote.\n'
Expand Down Expand Up @@ -65,7 +65,7 @@ class UserMessages {
String intellijStatusInfo(String version) => 'version $version';
String get intellijPluginInfo =>
'For information about installing plugins, see\n'
'https://flutter.dev/intellij-setup/#installing-the-plugins';
'https://flutter.dev/to/intellij-setup';
String intellijMinimumVersion(String minVersion) =>
'This install is older than the minimum recommended version of $minVersion.';
String intellijLocation(String installPath) => 'IntelliJ at $installPath';
Expand Down Expand Up @@ -343,16 +343,15 @@ class UserMessages {
'https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html\n';

String androidSdkInstallUrl(Platform platform) {
const String baseUrl = 'https://flutter.dev/docs/get-started/install';
const String fragment = '#android-setup';
const String baseUrl = 'https://flutter.dev/to/';
if (platform.isMacOS) {
return '$baseUrl/macos$fragment';
return '${baseUrl}macos-android-setup';
} else if (platform.isLinux) {
return '$baseUrl/linux$fragment';
return '${baseUrl}linux-android-setup';
} else if (platform.isWindows) {
return '$baseUrl/windows$fragment';
return '${baseUrl}windows-android-setup';
} else {
return baseUrl;
return '${baseUrl}android-setup';
}
}
}
6 changes: 3 additions & 3 deletions packages/flutter_tools/lib/src/cache.dart
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ class Cache {
_logger.printError(
'Failed to retrieve Flutter tool dependencies: ${e.message}.\n'
"If you're in China, please see this page: "
'https://flutter.dev/community/china',
'https://flutter.dev/to/china-setup',
emphasis: true,
);
}
Expand Down Expand Up @@ -1111,7 +1111,7 @@ class ArtifactUpdater {
_logger.printError(error.toString());
throwToolExit(
'The value of $kFlutterStorageBaseUrl ($overrideUrl) could not be '
'parsed as a valid url. Please see https://flutter.dev/community/china '
'parsed as a valid url. Please see https://flutter.dev/to/use-mirror-site '
'for an example of how to use it.\n'
'Full URL: $url',
exitCode: kNetworkProblemExitCode,
Expand Down Expand Up @@ -1156,7 +1156,7 @@ class ArtifactUpdater {
throwToolExit(
'Flutter could not download and/or extract $url. Ensure you have '
'network connectivity and all of the required dependencies listed at '
'flutter.dev/setup.\nThe original exception was: $err.'
'https://flutter.dev/setup.\nThe original exception was: $err.'
);
}
_deleteIgnoringErrors(tempFile);
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/commands/build_aar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class BuildAarCommand extends BuildSubCommand {
final String description = 'Build a repository containing an AAR and a POM file.\n\n'
'By default, AARs are built for `release`, `debug` and `profile`.\n'
'The POM file is used to include the dependencies that the AAR was compiled against.\n'
'To learn more about how to use these artifacts, see: https://flutter.dev/go/build-aar\n'
'To learn more about how to use these artifacts, see: https://flutter.dev/to/integrate-android-archive\n'
'This command assumes that the entrypoint is "lib/main.dart". '
'This cannot currently be configured.';

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/commands/build_ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ class BuildIOSArchiveCommand extends _BuildIOSSubCommand {
);
}
}
globals.printStatus('\nTo update the settings, please refer to https://docs.flutter.dev/deployment/ios\n');
globals.printStatus('\nTo update the settings, please refer to https://flutter.dev/to/ios-deploy\n');

// xcarchive failed or not at expected location.
if (xcarchiveResult.exitStatus != ExitStatus.success) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ class BuildIOSFrameworkCommand extends BuildFrameworkCommand {
.path);
globals.printStatus(
'\nCopy the ${globals.fs.path.basenameWithoutExtension(pluginRegistrantHeader.path)} class into your project.\n'
'See https://flutter.dev/docs/development/add-to-app/ios/add-flutter-screen#create-a-flutterengine for more information.');
'See https://flutter.dev/to/ios-create-flutter-engine for more information.');
}

return FlutterCommandResult.success();
Expand Down Expand Up @@ -375,7 +375,7 @@ LICENSE
}
s.author = { 'Flutter Dev Team' => '[email protected]' }
s.source = { :http => '${cache.storageBaseUrl}/flutter_infra_release/flutter/${cache.engineRevision}/$artifactsMode/artifacts.zip' }
s.documentation_url = 'https://flutter.dev/docs'
s.documentation_url = 'https://docs.flutter.dev'
s.platform = :ios, '12.0'
s.vendored_frameworks = 'Flutter.xcframework'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ LICENSE
}
s.author = { 'Flutter Dev Team' => '[email protected]' }
s.source = { :http => '${cache.storageBaseUrl}/flutter_infra_release/flutter/${cache.engineRevision}/$artifactsMode/FlutterMacOS.framework.zip' }
s.documentation_url = 'https://flutter.dev/docs'
s.documentation_url = 'https://docs.flutter.dev'
s.osx.deployment_target = '10.14'
s.vendored_frameworks = 'FlutterMacOS.framework'
s.prepare_command = 'unzip FlutterMacOS.framework -d FlutterMacOS.framework'
Expand Down
8 changes: 4 additions & 4 deletions packages/flutter_tools/lib/src/commands/create.dart
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ Your example app code is in $relativeExampleMain.
if (platformsString.isNotEmpty) {
globals.printStatus('''
Host platform code is in the $platformsString directories under $pluginPath.
To edit platform code in an IDE see https://flutter.dev/developing-packages/#edit-plugin-package.
To edit platform code in an IDE see https://flutter.dev/to/edit-plugins.
''');
}
Expand All @@ -841,7 +841,7 @@ You've created a plugin project that doesn't yet support any platforms.
void _printPluginAddPlatformMessage(String pluginPath, String template) {
globals.printStatus('''
To add platforms, run `flutter create -t $template --platforms <platforms> .` under $pluginPath.
For more information, see https://flutter.dev/go/plugin-platforms.
For more information, see https://flutter.dev/to/pubspec-plugin-platforms.
''');
}
Expand Down Expand Up @@ -881,13 +881,13 @@ void _printWarningDisabledPlatform(List<String> platforms) {

globals.printStatus('''
The desktop $platforms: ${desktop.join(', ')} $verb currently not supported on your local environment.
For more details, see: https://flutter.dev/desktop
For more details, see: https://flutter.dev/to/add-desktop-support
''');
}
if (web.isNotEmpty) {
globals.printStatus('''
The web is currently not supported on your local environment.
For more details, see: https://flutter.dev/docs/get-started/web
For more details, see: https://flutter.dev/to/add-web-support
''');
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_tools/lib/src/commands/create_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -708,11 +708,11 @@ abstract class CreateBase extends FlutterCommand {

// A valid Dart identifier that can be used for a package, i.e. no
// capital letters.
// https://dart.dev/guides/language/language-tour#important-concepts
// https://dart.dev/language#important-concepts
final RegExp _identifierRegExp = RegExp('[a-z_][a-z0-9_]*');

// non-contextual dart keywords.
//' https://dart.dev/guides/language/language-tour#keywords
// https://dart.dev/language/keywords
const Set<String> _keywords = <String>{
'abstract',
'as',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import '../runner/flutter_command.dart';
/// It generates Dart localization source files from arb files.
///
/// For a more comprehensive tutorial on the tool, please see the
/// [internationalization user guide](flutter.dev/go/i18n-user-guide).
/// [internationalization guide](https://flutter.dev/to/internationalization).
class GenerateLocalizationsCommand extends FlutterCommand {
GenerateLocalizationsCommand({
required FileSystem fileSystem,
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter_tools/lib/src/commands/test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ const String _kIntegrationTestDirectory = 'integration_test';
/// the `*_test.dart` suffix, and run them in a single invocation.
///
/// See:
/// - https://flutter.dev/docs/cookbook/testing/unit/introduction
/// - https://flutter.dev/docs/cookbook/testing/widget/introduction
/// - https://flutter.dev/to/unit-testing
/// - https://flutter.dev/to/widget-testing
///
/// ## Integration Tests
///
Expand All @@ -59,7 +59,7 @@ const String _kIntegrationTestDirectory = 'integration_test';
/// your package. To run these tests, use `flutter test integration_test`.
///
/// See:
/// - https://flutter.dev/docs/testing/integration-tests
/// - https://flutter.dev/to/integration-testing
class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
TestCommand({
bool verboseHelp = false,
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_tools/lib/src/commands/upgrade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import '../version.dart';
import 'channel.dart';

// The official docs to install Flutter.
const String _flutterInstallDocs = 'https://flutter.dev/docs/get-started/install';
const String _flutterInstallDocs = 'https://flutter.dev/setup';

class UpgradeCommand extends FlutterCommand {
UpgradeCommand({
Expand Down Expand Up @@ -135,7 +135,7 @@ class UpgradeCommandRunner {
globals.printStatus('To upgrade now, run "flutter upgrade".');
if (flutterVersion.channel == 'stable') {
globals.printStatus('\nSee the announcement and release notes:');
globals.printStatus('https://flutter.dev/docs/development/tools/sdk/release-notes');
globals.printStatus('https://docs.flutter.dev/release/release-notes');
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class WebDriverService extends DriverService {
'Unable to start a WebDriver session for web testing.\n'
'Make sure you have the correct WebDriver server (e.g. chromedriver) running at $driverPort.\n'
'For instructions on how to obtain and run a WebDriver server, see:\n'
'https://flutter.dev/docs/testing/integration-tests#running-in-a-browser\n'
'https://flutter.dev/to/integration-test-on-web\n'
);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_tools/lib/src/http_host_validator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class HttpHostValidator extends DoctorValidator {
if (url == null) {
availabilityResults.add(
'Environment variable $kPubDevOverride does not specify a valid URL: "${_platform.environment[kPubDevOverride]}"\n'
'Please see https://flutter.dev/community/china for an example of how to use it.'
'Please see https://flutter.dev/to/use-mirror-site for an example of how to use it.'
);
} else {
requiredHosts.add(url);
Expand All @@ -100,7 +100,7 @@ class HttpHostValidator extends DoctorValidator {
if (url == null) {
availabilityResults.add(
'Environment variable $kFlutterStorageBaseUrl does not specify a valid URL: "${_platform.environment[kFlutterStorageBaseUrl]}"\n'
'Please see https://flutter.dev/community/china for an example of how to use it.'
'Please see https://flutter.dev/to/use-mirror-site for an example of how to use it.'
);
} else {
requiredHosts.add(url);
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_tools/lib/src/ios/code_signing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ It's also possible that a previously installed app with the same Bundle\u0020
Identifier was signed with a different certificate.
For more information, please visit:
https://flutter.dev/docs/get-started/install/macos#deploy-to-ios-devices
https://flutter.dev/to/ios-app-signing
Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════''';
Expand All @@ -64,7 +64,7 @@ Provisioning Profile. Please ensure that a Development Team is selected by:
$fixWithDevelopmentTeamInstruction
For more information, please visit:
https://flutter.dev/docs/get-started/install/macos#deploy-to-ios-devices
https://flutter.dev/to/ios-development-team
Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════''';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class RemoveFrameworkLinkAndEmbeddingMigration extends ProjectMigrator {
parameter: 'remove-frameworks',
result: 'failure',
));
throwToolExit('Your Xcode project requires migration. See https://flutter.dev/docs/development/ios-project-migration for details.');
throwToolExit('Your Xcode project requires migration. See https://docs.flutter.dev/ios-project-migration for details.');
}

return line;
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/linux/build_linux.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Future<void> buildLinux(
target ??= 'lib/main.dart';
if (!linuxProject.cmakeFile.existsSync()) {
throwToolExit('No Linux desktop project configured. See '
'https://docs.flutter.dev/desktop#add-desktop-support-to-an-existing-flutter-app '
'https://flutter.dev/to/add-desktop-support '
'to learn about adding Linux support to a project.');
}

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/macos/build_macos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Future<void> buildMacOS({
final Directory? xcodeWorkspace = flutterProject.macos.xcodeWorkspace;
if (xcodeWorkspace == null) {
throwToolExit('No macOS desktop project configured. '
'See https://docs.flutter.dev/desktop#add-desktop-support-to-an-existing-flutter-app '
'See https://flutter.dev/to/add-desktop-support '
'to learn about adding macOS support to a project.');
}

Expand Down
Loading

0 comments on commit c946a5a

Please sign in to comment.