Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
f5fe1e3e
Unverified
Commit
f5fe1e3e
authored
Apr 05, 2020
by
Todd Volkert
Committed by
GitHub
Apr 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update roll_dev to work with new version numbers (#54015)
parent
afed5077
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
roll_dev.dart
dev/tools/lib/roll_dev.dart
+25
-10
No files found.
dev/tools/lib/roll_dev.dart
View file @
f5fe1e3e
...
...
@@ -105,10 +105,10 @@ void main(List<String> args) {
exit
(
1
);
}
final
List
<
int
>
parts
=
match
.
groups
(<
int
>[
1
,
2
,
3
]).
map
<
int
>(
int
.
parse
).
toList
();
final
List
<
int
>
parts
=
match
.
groups
(<
int
>[
1
,
2
,
3
,
4
,
5
]).
map
<
int
>(
int
.
parse
).
toList
();
if
(
match
.
group
(
4
)
==
'0'
)
{
print
(
'This commit has already been released, as version
${
parts.join("."
)}
.'
);
if
(
match
.
group
(
6
)
==
'0'
)
{
print
(
'This commit has already been released, as version
${
getVersionFromParts(parts
)}
.'
);
exit
(
0
);
}
...
...
@@ -117,19 +117,25 @@ void main(List<String> args) {
parts
[
0
]
+=
1
;
parts
[
1
]
=
0
;
parts
[
2
]
=
0
;
parts
[
3
]
=
0
;
parts
[
4
]
=
0
;
break
;
case
kY:
parts
[
1
]
+=
1
;
parts
[
2
]
=
0
;
parts
[
3
]
=
0
;
parts
[
4
]
=
0
;
break
;
case
kZ:
parts
[
2
]
+=
1
;
parts
[
2
]
=
0
;
parts
[
3
]
+=
1
;
parts
[
4
]
=
0
;
break
;
default
:
print
(
'Unknown increment level. The valid values are "
$kX
", "
$kY
", and "
$kZ
".'
);
exit
(
1
);
}
version
=
parts
.
join
(
'.'
);
version
=
getVersionFromParts
(
parts
);
if
(
justPrint
)
{
print
(
version
);
...
...
@@ -138,7 +144,7 @@ void main(List<String> args) {
final
String
hash
=
getGitOutput
(
'rev-parse HEAD'
,
'Get git hash for
$commit
'
);
runGit
(
'tag
v
$version
'
,
'tag the commit with the version label'
);
runGit
(
'tag
$version
'
,
'tag the commit with the version label'
);
// PROMPT
...
...
@@ -149,29 +155,38 @@ void main(List<String> args) {
'to the "dev" channel.'
);
stdout
.
write
(
'Are you? [yes/no] '
);
if
(
stdin
.
readLineSync
()
!=
'yes'
)
{
runGit
(
'tag -d
v
$version
'
,
'remove the tag you did not want to publish'
);
runGit
(
'tag -d
$version
'
,
'remove the tag you did not want to publish'
);
print
(
'The dev roll has been aborted.'
);
exit
(
0
);
}
}
runGit
(
'push
$origin
v
$version
'
,
'publish the version'
);
runGit
(
'push
$origin
$version
'
,
'publish the version'
);
runGit
(
'push
$origin
HEAD:dev'
,
'land the new version on the "dev" branch'
);
print
(
'Flutter version
$version
has been rolled to the "dev" channel!'
);
}
String
getFullTag
(
)
{
return
getGitOutput
(
'describe --match
v*
.*.* --first-parent --long --tags'
,
'describe --match
*.*.*-dev
.*.* --first-parent --long --tags'
,
'obtain last released version number'
,
);
}
Match
parseFullTag
(
String
version
)
{
final
RegExp
versionPattern
=
RegExp
(
r'^
v([0-9]+)
\.([0-9]+)\.([0-9]+)-([0-9]+)-g([a-f0-9]+)$'
);
final
RegExp
versionPattern
=
RegExp
(
r'^
([0-9]+)\.([0-9]+)\.([0-9]+)-dev
\.([0-9]+)\.([0-9]+)-([0-9]+)-g([a-f0-9]+)$'
);
return
versionPattern
.
matchAsPrefix
(
version
);
}
String
getVersionFromParts
(
List
<
int
>
parts
)
{
assert
(
parts
.
length
==
5
);
final
StringBuffer
buf
=
StringBuffer
()
..
write
(
parts
.
take
(
3
).
join
(
'.'
))
..
write
(
'-dev.'
)
..
write
(
parts
.
skip
(
3
).
join
(
'.'
));
return
buf
.
toString
();
}
String
getGitOutput
(
String
command
,
String
explanation
)
{
final
ProcessResult
result
=
_runGit
(
command
);
if
((
result
.
stderr
as
String
).
isEmpty
&&
result
.
exitCode
==
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment