diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart index 796dd81e8a0..225b8cc9be6 100644 --- a/packages/flutter_tools/lib/src/version.dart +++ b/packages/flutter_tools/lib/src/version.dart @@ -783,7 +783,7 @@ class GitTagVersion { // recent tag and number of commits past. return parse( _runGit( - 'git describe --match *.*.*-*.*.pre --first-parent --long --tags', + 'git describe --match *.*.* --first-parent --long --tags', processUtils, workingDirectory, ) @@ -858,7 +858,7 @@ class GitTagVersion { if (devPatch != null && devVersion != null) { return '$x.$y.$z-${devVersion + 1}.0.pre.$commits'; } - return '$x.$y.${z + 1}.pre.$commits'; + return '$x.$y.${z + 1}-0.0.pre.$commits'; } } diff --git a/packages/flutter_tools/test/commands.shard/hermetic/version_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/version_test.dart index aa756d7af31..95a54b1fa7b 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/version_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/version_test.dart @@ -280,7 +280,7 @@ class MockProcessManager extends Mock implements ProcessManager { return ProcessResult(0, 0, '000000000000000000000', ''); } if (commandStr == - 'git describe --match *.*.*-*.*.pre --first-parent --long --tags') { + 'git describe --match *.*.* --first-parent --long --tags') { if (version.isNotEmpty) { return ProcessResult(0, 0, '$version-0-g00000000', ''); } diff --git a/packages/flutter_tools/test/commands.shard/permeable/upgrade_test.dart b/packages/flutter_tools/test/commands.shard/permeable/upgrade_test.dart index 3fce71866a5..8ce7b236193 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/upgrade_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/upgrade_test.dart @@ -329,7 +329,7 @@ void main() { ), const FakeCommand( command: [ - 'git', 'describe', '--match', '*.*.*-*.*.pre', '--first-parent', '--long', '--tags', + 'git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags', ], stdout: 'v1.12.16-19-gb45b676af', ), diff --git a/packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart b/packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart index 13655aa848c..ada250f6913 100644 --- a/packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart +++ b/packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart @@ -187,7 +187,7 @@ void main() { workingDirectory: Cache.flutterRoot)).thenReturn(result); when(processManager.runSync('git tag --contains HEAD'.split(' '), workingDirectory: Cache.flutterRoot)).thenReturn(result); - when(processManager.runSync('git describe --match *.*.*-*.*.pre --first-parent --long --tags'.split(' '), + when(processManager.runSync('git describe --match *.*.* --first-parent --long --tags'.split(' '), workingDirectory: Cache.flutterRoot)).thenReturn(result); when(processManager.runSync(FlutterVersion.gitLog('-n 1 --pretty=format:%ad --date=iso'.split(' ')), workingDirectory: Cache.flutterRoot)).thenReturn(result); diff --git a/packages/flutter_tools/test/general.shard/version_test.dart b/packages/flutter_tools/test/general.shard/version_test.dart index 2ee7c472291..38711f51a73 100644 --- a/packages/flutter_tools/test/general.shard/version_test.dart +++ b/packages/flutter_tools/test/general.shard/version_test.dart @@ -419,7 +419,7 @@ void main() { expect(gitTagVersion.devPatch, 5); gitTagVersion = GitTagVersion.parse('1.2.3-13-g$hash'); - expect(gitTagVersion.frameworkVersionFor(hash), '1.2.4.pre.13'); + expect(gitTagVersion.frameworkVersionFor(hash), '1.2.4-0.0.pre.13'); expect(gitTagVersion.gitTag, '1.2.3'); expect(gitTagVersion.devVersion, null); expect(gitTagVersion.devPatch, null); @@ -433,12 +433,12 @@ void main() { // new tag release format, stable channel gitTagVersion = GitTagVersion.parse('1.2.3-13-g$hash'); - expect(gitTagVersion.frameworkVersionFor(hash), '1.2.4.pre.13'); + expect(gitTagVersion.frameworkVersionFor(hash), '1.2.4-0.0.pre.13'); expect(gitTagVersion.gitTag, '1.2.3'); expect(gitTagVersion.devVersion, null); expect(gitTagVersion.devPatch, null); - expect(GitTagVersion.parse('98.76.54-32-g$hash').frameworkVersionFor(hash), '98.76.55.pre.32'); + expect(GitTagVersion.parse('98.76.54-32-g$hash').frameworkVersionFor(hash), '98.76.55-0.0.pre.32'); expect(GitTagVersion.parse('10.20.30-0-g$hash').frameworkVersionFor(hash), '10.20.30'); expect(testLogger.traceText, ''); expect(GitTagVersion.parse('v1.2.3+hotfix.1-4-g$hash').frameworkVersionFor(hash), '0.0.0-unknown'); @@ -475,7 +475,7 @@ void main() { // We shouldn't have to fallback to git describe, because we are exactly // on a release tag. verifyNever(mockProcessUtils.runSync( - ['git', 'describe', '--match', '*.*.*-*.*.pre', '--first-parent', '--long', '--tags'], + ['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )); @@ -489,7 +489,7 @@ void main() { environment: anyNamed('environment'), )).thenReturn(RunResult(ProcessResult(105, 0, '', ''), ['git', 'fetch'])); when(processUtils.runSync( - ['git', 'describe', '--match', '*.*.*-*.*.pre', '--first-parent', '--long', '--tags'], + ['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )).thenReturn(RunResult(ProcessResult(106, 0, 'v0.1.2-3-1234abcd', ''), ['git', 'describe'])); @@ -515,7 +515,7 @@ void main() { environment: anyNamed('environment'), )); verify(processUtils.runSync( - ['git', 'describe', '--match', '*.*.*-*.*.pre', '--first-parent', '--long', '--tags'], + ['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )).called(1); @@ -534,7 +534,7 @@ void main() { environment: anyNamed('environment'), )).thenReturn(RunResult(ProcessResult(106, 0, '', ''), ['git', 'fetch'])); when(processUtils.runSync( - ['git', 'describe', '--match', '*.*.*-*.*.pre', '--first-parent', '--long', '--tags'], + ['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )).thenReturn(RunResult(ProcessResult(107, 0, 'v0.1.2-3-1234abcd', ''), ['git', 'describe'])); @@ -560,7 +560,7 @@ void main() { environment: anyNamed('environment'), )); verify(processUtils.runSync( - ['git', 'describe', '--match', '*.*.*-*.*.pre', '--first-parent', '--long', '--tags'], + ['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )).called(1); @@ -587,7 +587,7 @@ void main() { ['git', 'tag', '--contains', 'HEAD'], )); when(processUtils.runSync( - ['git', 'describe', '--match', '*.*.*-*.*.pre', '--first-parent', '--long', '--tags'], + ['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )).thenReturn(RunResult(ProcessResult(111, 0, 'v0.1.2-3-1234abcd', ''), ['git', 'describe'])); @@ -605,7 +605,7 @@ void main() { environment: anyNamed('environment'), )).called(1); verify(processUtils.runSync( - ['git', 'describe', '--match', '*.*.*-*.*.pre', '--first-parent', '--long', '--tags'], + ['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )).called(1); @@ -632,7 +632,7 @@ void main() { ['git', 'tag', '--contains', 'HEAD'], )); when(processUtils.runSync( - ['git', 'describe', '--match', '*.*.*-*.*.pre', '--first-parent', '--long', '--tags'], + ['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )).thenReturn(RunResult(ProcessResult(111, 0, 'v0.1.2-3-1234abcd', ''), ['git', 'describe'])); @@ -770,7 +770,7 @@ void fakeData( environment: anyNamed('environment'), )).thenReturn(ProcessResult(106, 0, '', '')); when(pm.runSync( - ['git', 'describe', '--match', '*.*.*-*.*.pre', '--first-parent', '--long', '--tags'], + ['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )).thenReturn(ProcessResult(107, 0, 'v0.1.2-3-1234abcd', ''));