closes #issue136763, changed a command to generate gradle error message according to platform (#149877)

Currently, the error message displayed to regenerate the lockfiles gives a Unix-like command ./gradlew, which will be incorrect for Windows environments. This PR uses globals.platform.isWindows to give the appropriate command.

closes #136763
This commit is contained in:
Satyam Srivastav
2024-06-12 10:42:57 +05:30
committed by GitHub
parent cc24f877db
commit c5e5e0cc36
2 changed files with 51 additions and 3 deletions

View File

@@ -414,8 +414,9 @@ final GradleHandledError lockFileDepMissingHandler = GradleHandledError(
final File gradleFile = project.directory
.childDirectory('android')
.childFile('build.gradle');
final String generatedGradleCommand = globals.platform.isWindows ? r'.\gradlew.bat' : './gradlew';
final String textInBold = globals.logger.terminal.bolden(
'To regenerate the lockfiles run: `./gradlew :generateLockfiles` in ${gradleFile.path}\n'
'To regenerate the lockfiles run: `$generatedGradleCommand :generateLockfiles` in ${gradleFile.path}\n'
'To remove dependency locking, remove the `dependencyLocking` from ${gradleFile.path}'
);
globals.printBox(