Skip to content

Commit

Permalink
feat(shorebird_cli): shorebird patch includes Flutter version when …
Browse files Browse the repository at this point in the history
…building (#1925)
  • Loading branch information
felangel authored Apr 17, 2024
1 parent c99ed4e commit 10f4461
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ Please re-run the release command for this version or create a new release.''');
return await runScoped(
() async {
final buildNumber = results['build-number'] as String;
final buildProgress = logger.progress('Building patch');
final flutterVersionString =
await shorebirdFlutter.getVersionAndRevision();
final buildProgress = logger.progress(
'Building patch with Flutter $flutterVersionString',
);
try {
await buildAar(buildNumber: buildNumber);
buildProgress.complete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ If this option is not provided, the version number will be determined from the p
releaseVersion = argReleaseVersion;
} else {
logger.detail('No release version provided. Determining from bundle.');
final buildProgress = logger.progress('Building patch');
final flutterVersionString =
await shorebirdFlutter.getVersionAndRevision();
final buildProgress = logger.progress(
'Building patch with Flutter $flutterVersionString',
);
try {
await buildAppBundle(flavor: flavor, target: target);
buildProgress.complete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,10 @@ ${summary.join('\n')}
required String? target,
}) async {
final shouldCodesign = results['codesign'] == true;
final buildProgress = logger.progress('Building patch');
final flutterVersionString = await shorebirdFlutter.getVersionAndRevision();
final buildProgress = logger.progress(
'Building patch with Flutter $flutterVersionString',
);
try {
// If buildIpa is called with a different codesign value than the release
// was, we will erroneously report native diffs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ Please re-run the release command for this version or create a new release.''');

return await runScoped(
() async {
final buildProgress = logger.progress('Building patch');
final flutterVersionString =
await shorebirdFlutter.getVersionAndRevision();
final buildProgress = logger.progress(
'Building patch with Flutter $flutterVersionString',
);
try {
await buildIosFramework();
buildProgress.complete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import '../../mocks.dart';
void main() {
group(PatchAarCommand, () {
const flutterRevision = '83305b5088e6fe327fb3334a73ff190828d85713';
const flutterVersionAndRevision = '3.10.6 (83305b5088)';
const appId = 'test-app-id';
const shorebirdYaml = ShorebirdYaml(appId: appId);
const buildNumber = '1.0';
Expand Down Expand Up @@ -321,6 +322,9 @@ void main() {
when(
() => cache.getArtifactDirectory(any()),
).thenReturn(Directory.systemTemp.createTempSync());
when(
() => shorebirdFlutter.getVersionAndRevision(),
).thenAnswer((_) async => flutterVersionAndRevision);
when(
() => shorebirdFlutter.installRevision(
revision: any(named: 'revision'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import '../../mocks.dart';
void main() {
group(PatchAndroidCommand, () {
const flutterRevision = '83305b5088e6fe327fb3334a73ff190828d85713';
const flutterVersionAndRevision = '3.10.6 (83305b5088)';
const appId = 'test-app-id';
const shorebirdYaml = ShorebirdYaml(appId: appId);
const versionName = '1.2.3';
Expand Down Expand Up @@ -236,6 +237,9 @@ flutter:
});
when(() => shorebirdEnv.flutterDirectory).thenReturn(flutterDirectory);
when(() => shorebirdEnv.flutterRevision).thenReturn(flutterRevision);
when(
() => shorebirdFlutter.getVersionAndRevision(),
).thenAnswer((_) async => flutterVersionAndRevision);
when(
() => shorebirdFlutter.installRevision(
revision: any(named: 'revision'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import '../../mocks.dart';
void main() {
const preLinkerFlutterRevision = '83305b5088e6fe327fb3334a73ff190828d85713';
const postLinkerFlutterRevision = 'deadbeefdeadbeefdeadbeefdeadbeefdeadbeef';
const flutterVersionAndRevision = '3.10.6 (83305b5088)';
const appId = 'test-app-id';
const shorebirdYaml = ShorebirdYaml(appId: appId);
const versionName = '1.2.3';
Expand Down Expand Up @@ -462,6 +463,9 @@ flutter:
when(() => shorebirdEnv.flutterRevision)
.thenReturn(preLinkerFlutterRevision);
when(() => shorebirdEnv.canAcceptUserInput).thenReturn(true);
when(
() => shorebirdFlutter.getVersionAndRevision(),
).thenAnswer((_) async => flutterVersionAndRevision);
when(
() => shorebirdFlutter.installRevision(
revision: any(named: 'revision'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ void main() {
'deadbeefdeadbeefdeadbeefdeadbeefdeadbeef';
const preLinkerFlutterRevision =
'83305b5088e6fe327fb3334a73ff190828d85713';
const flutterVersionAndRevision = '3.10.6 (83305b5088)';
const pubspecYamlContent = '''
name: example
version: $version
Expand Down Expand Up @@ -340,6 +341,9 @@ flutter:
artifact: ShorebirdArtifact.analyzeSnapshot,
),
).thenReturn(analyzeSnapshotFile.path);
when(
() => shorebirdFlutter.getVersionAndRevision(),
).thenAnswer((_) async => flutterVersionAndRevision);
when(
() => shorebirdFlutter.installRevision(
revision: any(named: 'revision'),
Expand Down

0 comments on commit 10f4461

Please sign in to comment.