Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(shorebird_cli): shorebird patch includes Flutter version when building #1925

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading