Skip to content

Commit

Permalink
[Windows] Improve version migration message (#127048)
Browse files Browse the repository at this point in the history
This also migrates the platform channel example to stamp version information on Windows.
  • Loading branch information
loic-sharma committed May 17, 2023
1 parent a3a0ef0 commit 718f444
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions examples/platform_channel/windows/runner/Runner.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)', () {
Expand Down Expand Up @@ -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.'));
});
});
}
Expand Down

0 comments on commit 718f444

Please sign in to comment.