@@ -782,8 +782,7 @@ Execution failed for task ':app:generateDebugFeatureTransitiveDeps'.
782782 '│ To regenerate the lockfiles run: `./gradlew :generateLockfiles` in /android/build.gradle │\n '
783783 '│ To remove dependency locking, remove the `dependencyLocking` from /android/build.gradle │\n '
784784 '└──────────────────────────────────────────────────────────────────────────────────────────┘\n '
785- )
786- );
785+ ));
787786 }, overrides: < Type , Generator > {
788787 GradleUtils : () => FakeGradleUtils (),
789788 Platform : () => fakePlatform ('android' ),
@@ -792,6 +791,54 @@ Execution failed for task ':app:generateDebugFeatureTransitiveDeps'.
792791 });
793792 });
794793
794+ testUsingContext ('generates correct gradle command for Unix-like environment' ,
795+ () async {
796+ await lockFileDepMissingHandler.handler (
797+ project: FlutterProject .fromDirectoryTest (fileSystem.currentDirectory),
798+ usesAndroidX: true ,
799+ line: '' ,
800+ );
801+
802+ expect (
803+ testLogger.statusText,
804+ contains ('\n '
805+ '┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────┐\n '
806+ '│ You need to update the lockfile, or disable Gradle dependency locking. │\n '
807+ '│ To regenerate the lockfiles run: `./gradlew :generateLockfiles` in /android/build.gradle │\n '
808+ '│ To remove dependency locking, remove the `dependencyLocking` from /android/build.gradle │\n '
809+ '└──────────────────────────────────────────────────────────────────────────────────────────┘\n '
810+ '' ));
811+ }, overrides: < Type , Generator > {
812+ GradleUtils : () => FakeGradleUtils (),
813+ Platform : () => fakePlatform ('linux' ),
814+ FileSystem : () => fileSystem,
815+ ProcessManager : () => processManager,
816+ });
817+
818+
819+ testUsingContext ('generates correct gradle command for windows environment' ,
820+ () async {
821+ await lockFileDepMissingHandler.handler (
822+ project: FlutterProject .fromDirectoryTest (fileSystem.currentDirectory),
823+ usesAndroidX: true ,
824+ line: '' ,
825+ );
826+ expect (
827+ testLogger.statusText,
828+ contains ('\n '
829+ '┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────┐\n '
830+ '│ You need to update the lockfile, or disable Gradle dependency locking. │\n '
831+ '│ To regenerate the lockfiles run: `.\\ gradlew.bat :generateLockfiles` in /android/build.gradle │\n '
832+ '│ To remove dependency locking, remove the `dependencyLocking` from /android/build.gradle │\n '
833+ '└──────────────────────────────────────────────────────────────────────────────────────────────┘\n '
834+ '' ));
835+ }, overrides: < Type , Generator > {
836+ GradleUtils : () => FakeGradleUtils (),
837+ Platform : () => fakePlatform ('windows' ),
838+ FileSystem : () => fileSystem,
839+ ProcessManager : () => processManager,
840+ });
841+
795842 group ('Incompatible Kotlin version' , () {
796843 testWithoutContext ('pattern' , () {
797844 expect (
0 commit comments