[Windows] Improve version migration message (#127048)

This also migrates the platform channel example to stamp version information on Windows.
This commit is contained in:
Loïc Sharma 2023-05-17 16:07:16 -07:00 committed by GitHub
parent a3a0ef0393
commit 718f444bc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -50,14 +50,14 @@ END
// Version
//
#ifdef FLUTTER_BUILD_NUMBER
#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)
#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD
#else
#define VERSION_AS_NUMBER 1,0,0
#define VERSION_AS_NUMBER 1,0,0,0
#endif
#ifdef FLUTTER_BUILD_NAME
#define VERSION_AS_STRING #FLUTTER_BUILD_NAME
#if defined(FLUTTER_VERSION)
#define VERSION_AS_STRING FLUTTER_VERSION
#else
#define VERSION_AS_STRING "1.0.0"
#endif

View File

@ -115,7 +115,7 @@ This indicates non-trivial changes have been made to the Windows runner in the
);
if (originalResourceFileContents != newResourceFileContents) {
logger.printStatus(
'windows/runner/Runner.rc does not define use Flutter version information, updating.',
'windows/runner/Runner.rc does not use Flutter version information, updating.',
);
_resourceFile.writeAsStringSync(newResourceFileContents);
}

View File

@ -246,7 +246,7 @@ void main () {
);
expect(testLogger.statusText, contains('windows/runner/CMakeLists.txt does not define version information, updating.'));
expect(testLogger.statusText, contains('windows/runner/Runner.rc does not define use Flutter version information, updating.'));
expect(testLogger.statusText, contains('windows/runner/Runner.rc does not use Flutter version information, updating.'));
});
testWithoutContext('migrates project to set version information (CRLF)', () {
@ -308,7 +308,7 @@ void main () {
);
expect(testLogger.statusText, contains('windows/runner/CMakeLists.txt does not define version information, updating.'));
expect(testLogger.statusText, contains('windows/runner/Runner.rc does not define use Flutter version information, updating.'));
expect(testLogger.statusText, contains('windows/runner/Runner.rc does not use Flutter version information, updating.'));
});
});
}