[flutter_tools] change the way version is calculated on master (#110791)
This commit is contained in:
parent
d05cadb52b
commit
8361465f77
@ -812,9 +812,9 @@ class GitTagVersion {
|
|||||||
return '$x.$y.$z+hotfix.${hotfix! + 1}.pre.$commits';
|
return '$x.$y.$z+hotfix.${hotfix! + 1}.pre.$commits';
|
||||||
}
|
}
|
||||||
if (devPatch != null && devVersion != null) {
|
if (devPatch != null && devVersion != null) {
|
||||||
// The next published release this commit will appear in will be a beta
|
// The next tag that will contain this commit will be the next candidate
|
||||||
// release, thus increment [y].
|
// branch, which will increment the devVersion.
|
||||||
return '$x.${y! + 1}.0-0.0.pre.$commits';
|
return '$x.$y.0-${devVersion! + 1}.0.pre.$commits';
|
||||||
}
|
}
|
||||||
return '$x.$y.${z! + 1}-0.0.pre.$commits';
|
return '$x.$y.${z! + 1}-0.0.pre.$commits';
|
||||||
}
|
}
|
||||||
|
@ -440,9 +440,9 @@ void main() {
|
|||||||
GitTagVersion gitTagVersion;
|
GitTagVersion gitTagVersion;
|
||||||
|
|
||||||
// Master channel
|
// Master channel
|
||||||
gitTagVersion = GitTagVersion.parse('1.2.3-4.5.pre-13-g$hash');
|
gitTagVersion = GitTagVersion.parse('1.2.0-4.5.pre-13-g$hash');
|
||||||
expect(gitTagVersion.frameworkVersionFor(hash), '1.3.0-0.0.pre.13');
|
expect(gitTagVersion.frameworkVersionFor(hash), '1.2.0-5.0.pre.13');
|
||||||
expect(gitTagVersion.gitTag, '1.2.3-4.5.pre');
|
expect(gitTagVersion.gitTag, '1.2.0-4.5.pre');
|
||||||
expect(gitTagVersion.devVersion, 4);
|
expect(gitTagVersion.devVersion, 4);
|
||||||
expect(gitTagVersion.devPatch, 5);
|
expect(gitTagVersion.devPatch, 5);
|
||||||
|
|
||||||
@ -543,7 +543,7 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
testUsingContext('determine reports correct git describe version if HEAD is not at a tag', () {
|
testUsingContext('determine reports correct git describe version if HEAD is not at a tag', () {
|
||||||
const String devTag = '1.2.3-2.0.pre';
|
const String devTag = '1.2.0-2.0.pre';
|
||||||
const String headRevision = 'abcd1234';
|
const String headRevision = 'abcd1234';
|
||||||
const String commitsAhead = '12';
|
const String commitsAhead = '12';
|
||||||
final FakeProcessManager fakeProcessManager = FakeProcessManager.list(
|
final FakeProcessManager fakeProcessManager = FakeProcessManager.list(
|
||||||
@ -565,8 +565,8 @@ void main() {
|
|||||||
final FakePlatform platform = FakePlatform();
|
final FakePlatform platform = FakePlatform();
|
||||||
|
|
||||||
final GitTagVersion gitTagVersion = GitTagVersion.determine(processUtils, platform, workingDirectory: '.');
|
final GitTagVersion gitTagVersion = GitTagVersion.determine(processUtils, platform, workingDirectory: '.');
|
||||||
// reported version should increment the y
|
// reported version should increment the m
|
||||||
expect(gitTagVersion.frameworkVersionFor(headRevision), '1.3.0-0.0.pre.12');
|
expect(gitTagVersion.frameworkVersionFor(headRevision), '1.2.0-3.0.pre.12');
|
||||||
});
|
});
|
||||||
|
|
||||||
testUsingContext('determine does not call fetch --tags', () {
|
testUsingContext('determine does not call fetch --tags', () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user