Skip to content

Commit

Permalink
Add a --just-print flag to roll_dev. (flutter#14766)
Browse files Browse the repository at this point in the history
This will allow other tools to call into the roll_dev script
to know what version is about to be published without actually
publishing.
  • Loading branch information
tvolkert authored Feb 19, 2018
1 parent 1e242eb commit 1363489
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions dev/tools/lib/roll_dev.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const String kY = 'y';
const String kZ = 'z';
const String kCommit = 'commit';
const String kOrigin = 'origin';
const String kJustPrint = 'just-print';
const String kYes = 'yes';
const String kHelp = 'help';

Expand Down Expand Up @@ -47,6 +48,13 @@ void main(List<String> args) {
valueHelp: 'repository',
defaultsTo: 'upstream',
);
argParser.addFlag(
kJustPrint,
negatable: false,
help:
'Don\'t actually roll the dev channel; '
'just print the would-be version and quit.',
);
argParser.addFlag(kYes, negatable: false, abbr: 'y', help: 'Skip the confirmation prompt.');
argParser.addFlag(kHelp, negatable: false, help: 'Show this help message.', hide: true);
ArgResults argResults;
Expand All @@ -61,6 +69,7 @@ void main(List<String> args) {
final String level = argResults[kIncrement];
final String commit = argResults[kCommit];
final String origin = argResults[kOrigin];
final bool justPrint = argResults[kJustPrint];
final bool autoApprove = argResults[kYes];
final bool help = argResults[kHelp];

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

if (justPrint) {
print(version);
exit(0);
}

final String hash = getGitOutput('rev-parse HEAD', 'Get git hash for $commit');

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

0 comments on commit 1363489

Please sign in to comment.