Skip to content

Commit 1363489

Browse files
authored
Add a --just-print flag to roll_dev. (flutter#14766)
This will allow other tools to call into the roll_dev script to know what version is about to be published without actually publishing.
1 parent 1e242eb commit 1363489

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

dev/tools/lib/roll_dev.dart

+14
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const String kY = 'y';
1717
const String kZ = 'z';
1818
const String kCommit = 'commit';
1919
const String kOrigin = 'origin';
20+
const String kJustPrint = 'just-print';
2021
const String kYes = 'yes';
2122
const String kHelp = 'help';
2223

@@ -47,6 +48,13 @@ void main(List<String> args) {
4748
valueHelp: 'repository',
4849
defaultsTo: 'upstream',
4950
);
51+
argParser.addFlag(
52+
kJustPrint,
53+
negatable: false,
54+
help:
55+
'Don\'t actually roll the dev channel; '
56+
'just print the would-be version and quit.',
57+
);
5058
argParser.addFlag(kYes, negatable: false, abbr: 'y', help: 'Skip the confirmation prompt.');
5159
argParser.addFlag(kHelp, negatable: false, help: 'Show this help message.', hide: true);
5260
ArgResults argResults;
@@ -61,6 +69,7 @@ void main(List<String> args) {
6169
final String level = argResults[kIncrement];
6270
final String commit = argResults[kCommit];
6371
final String origin = argResults[kOrigin];
72+
final bool justPrint = argResults[kJustPrint];
6473
final bool autoApprove = argResults[kYes];
6574
final bool help = argResults[kHelp];
6675

@@ -122,6 +131,11 @@ void main(List<String> args) {
122131
}
123132
version = parts.join('.');
124133

134+
if (justPrint) {
135+
print(version);
136+
exit(0);
137+
}
138+
125139
final String hash = getGitOutput('rev-parse HEAD', 'Get git hash for $commit');
126140

127141
runGit('tag v$version', 'tag the commit with the version label');

0 commit comments

Comments
 (0)