Skip to content

Commit 718f444

Browse files
authored
[Windows] Improve version migration message (#127048)
This also migrates the platform channel example to stamp version information on Windows.
1 parent a3a0ef0 commit 718f444

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/platform_channel/windows/runner/Runner.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ END
5050
// Version
5151
//
5252

53-
#ifdef FLUTTER_BUILD_NUMBER
54-
#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
53+
#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)
54+
#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD
5555
#else
56-
#define VERSION_AS_NUMBER 1,0,0
56+
#define VERSION_AS_NUMBER 1,0,0,0
5757
#endif
5858

59-
#ifdef FLUTTER_BUILD_NAME
60-
#define VERSION_AS_STRING #FLUTTER_BUILD_NAME
59+
#if defined(FLUTTER_VERSION)
60+
#define VERSION_AS_STRING FLUTTER_VERSION
6161
#else
6262
#define VERSION_AS_STRING "1.0.0"
6363
#endif

packages/flutter_tools/lib/src/windows/migrations/version_migration.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ This indicates non-trivial changes have been made to the Windows runner in the
115115
);
116116
if (originalResourceFileContents != newResourceFileContents) {
117117
logger.printStatus(
118-
'windows/runner/Runner.rc does not define use Flutter version information, updating.',
118+
'windows/runner/Runner.rc does not use Flutter version information, updating.',
119119
);
120120
_resourceFile.writeAsStringSync(newResourceFileContents);
121121
}

packages/flutter_tools/test/general.shard/windows/migrations/version_migration_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ void main () {
246246
);
247247

248248
expect(testLogger.statusText, contains('windows/runner/CMakeLists.txt does not define version information, updating.'));
249-
expect(testLogger.statusText, contains('windows/runner/Runner.rc does not define use Flutter version information, updating.'));
249+
expect(testLogger.statusText, contains('windows/runner/Runner.rc does not use Flutter version information, updating.'));
250250
});
251251

252252
testWithoutContext('migrates project to set version information (CRLF)', () {
@@ -308,7 +308,7 @@ void main () {
308308
);
309309

310310
expect(testLogger.statusText, contains('windows/runner/CMakeLists.txt does not define version information, updating.'));
311-
expect(testLogger.statusText, contains('windows/runner/Runner.rc does not define use Flutter version information, updating.'));
311+
expect(testLogger.statusText, contains('windows/runner/Runner.rc does not use Flutter version information, updating.'));
312312
});
313313
});
314314
}

0 commit comments

Comments
 (0)