chore(shorebird_cli): v1.4.14 (#2656)

This commit is contained in:
Felix Angelov
2024-12-05 16:09:53 -06:00
committed by GitHub
parent 62dcef0978
commit caf4603cf8
10 changed files with 152 additions and 33 deletions
+6
View File
@@ -6,6 +6,12 @@ cspell:words pubspec erickzanardo xcframeworks Cupertino codesign codecov rkisha
This section contains past updates we've sent to customers.
## 1.4.14 (December 5, 2024)
- 🍎 iOS linker improvements (improved class table sort)
- 🖥️ Prepare for MacOS support
- 🍄 Various dependency upgrades
## 1.4.13 (November 20, 2024)
- 🍎 Provide more build status updates for iOS release and patch
+1 -1
View File
@@ -1 +1 @@
4353ddb8f4354b28dc7ff4bc05c4c920c2eba999
d8a5e38fdaf0564ea7ad65c762b33d00b3f3af63
@@ -42,6 +42,9 @@ class IosFrameworkPatcher extends Patcher {
String get _patchClassTableLinkInfoFile =>
p.join(buildDirectory.path, 'ios', 'shorebird', 'App.ct.link');
String get _patchClassTableLinkDebugInfoPath =>
p.join(buildDirectory.path, 'ios', 'shorebird', 'App.class_table.json');
String get _vmcodeOutputPath => p.join(buildDirectory.path, 'out.vmcode');
String get _appDillCopyPath => p.join(buildDirectory.path, 'app.dill');
@@ -165,6 +168,7 @@ class IosFrameworkPatcher extends Patcher {
}
File? releaseClassTableLinkInfoFile;
File? releaseClassTableLinkDebugInfoFile;
if (supplementArtifact != null) {
final tempDir = Directory.systemTemp.createTempSync();
await artifactManager.extractZip(
@@ -172,11 +176,18 @@ class IosFrameworkPatcher extends Patcher {
outputDirectory: tempDir,
);
releaseClassTableLinkInfoFile = File(p.join(tempDir.path, 'App.ct.link'));
if (!releaseClassTableLinkInfoFile.existsSync()) {
logger.err('Unable to find class table link info file');
throw ProcessExit(ExitCode.software.code);
}
releaseClassTableLinkDebugInfoFile = File(
p.join(tempDir.path, 'App.class_table.json'),
);
if (!releaseClassTableLinkDebugInfoFile.existsSync()) {
logger.err('Unable to find class table link debug info file');
throw ProcessExit(ExitCode.software.code);
}
}
unzipProgress.complete(
@@ -202,18 +213,25 @@ class IosFrameworkPatcher extends Patcher {
if (useLinker) {
// If we're using a newer version of the linker, we need to also copy the
// necessary class table link information alongside the snapshots.
if (releaseClassTableLinkInfoFile != null) {
if (releaseClassTableLinkInfoFile != null &&
releaseClassTableLinkDebugInfoFile != null) {
// Copy the release's class table link info file next to the release
// snapshot so that it can be used to generate a patch.
releaseClassTableLinkInfoFile.copySync(
p.join(releaseArtifactFile.parent.path, 'App.ct.link'),
);
releaseClassTableLinkDebugInfoFile.copySync(
p.join(releaseArtifactFile.parent.path, 'App.class_table.json'),
);
// Copy the patch's class table link info file to the build directory
// so that it can be used to generate a patch.
File(_patchClassTableLinkInfoFile).copySync(
p.join(buildDirectory.path, 'out.ct.link'),
);
File(_patchClassTableLinkDebugInfoPath).copySync(
p.join(buildDirectory.path, 'out.class_table.json'),
);
}
await _runLinker(
@@ -50,6 +50,9 @@ class IosPatcher extends Patcher {
String get _patchClassTableLinkInfoPath =>
p.join(buildDirectory.path, 'ios', 'shorebird', 'App.ct.link');
String get _patchClassTableLinkDebugInfoPath =>
p.join(buildDirectory.path, 'ios', 'shorebird', 'App.class_table.json');
String get _aotOutputPath => p.join(buildDirectory.path, 'out.aot');
String get _vmcodeOutputPath => p.join(buildDirectory.path, 'out.vmcode');
@@ -256,6 +259,7 @@ For more information see: ${supportedFlutterVersionsUrl.toLink()}''',
}
File? releaseClassTableLinkInfoFile;
File? releaseClassTableLinkDebugInfoFile;
if (supplementArtifact != null) {
final tempDir = Directory.systemTemp.createTempSync();
await artifactManager.extractZip(
@@ -263,11 +267,18 @@ For more information see: ${supportedFlutterVersionsUrl.toLink()}''',
outputDirectory: tempDir,
);
releaseClassTableLinkInfoFile = File(p.join(tempDir.path, 'App.ct.link'));
if (!releaseClassTableLinkInfoFile.existsSync()) {
logger.err('Unable to find class table link info file');
throw ProcessExit(ExitCode.software.code);
}
releaseClassTableLinkDebugInfoFile = File(
p.join(tempDir.path, 'App.class_table.json'),
);
if (!releaseClassTableLinkDebugInfoFile.existsSync()) {
logger.err('Unable to find class table link debug info file');
throw ProcessExit(ExitCode.software.code);
}
}
unzipProgress.complete();
@@ -291,18 +302,25 @@ For more information see: ${supportedFlutterVersionsUrl.toLink()}''',
if (useLinker) {
// If we're using a newer version of the linker, we need to also copy the
// necessary class table link information alongside the snapshots.
if (releaseClassTableLinkInfoFile != null) {
if (releaseClassTableLinkInfoFile != null &&
releaseClassTableLinkDebugInfoFile != null) {
// Copy the release's class table link info file next to the release
// snapshot so that it can be used to generate a patch.
releaseClassTableLinkInfoFile.copySync(
p.join(releaseArtifactFile.parent.path, 'App.ct.link'),
);
releaseClassTableLinkDebugInfoFile.copySync(
p.join(releaseArtifactFile.parent.path, 'App.class_table.json'),
);
// Copy the patch's class table link info file to the build directory
// so that it can be used to generate a patch.
File(_patchClassTableLinkInfoPath).copySync(
p.join(buildDirectory.path, 'out.ct.link'),
);
File(_patchClassTableLinkDebugInfoPath).copySync(
p.join(buildDirectory.path, 'out.class_table.json'),
);
}
final (:exitCode, :linkPercentage) = await _runLinker(
@@ -285,7 +285,7 @@ NOTE: this is ${styleBold.wrap('not')} recommended. Asset changes cannot be incl
final supplementalArtifact =
patcher.supplementaryReleaseArtifactArch != null
? await codePushClientWrapper.getOptionalReleaseArtifact(
? await codePushClientWrapper.maybeGetReleaseArtifact(
appId: appId,
releaseId: release.id,
arch: patcher.supplementaryReleaseArtifactArch!,
@@ -508,24 +508,3 @@ ${summary.join('\n')}
return artifactFile;
}
}
extension on CodePushClientWrapper {
Future<ReleaseArtifact?> getOptionalReleaseArtifact({
required String appId,
required int releaseId,
required String arch,
required ReleasePlatform platform,
}) async {
try {
final artifact = await getReleaseArtifact(
appId: appId,
releaseId: releaseId,
arch: arch,
platform: platform,
);
return artifact;
} on CodePushNotFoundException catch (_) {
return null;
}
}
}
+1 -1
View File
@@ -1,2 +1,2 @@
// Generated code. Do not modify.
const packageVersion = '1.4.13';
const packageVersion = '1.4.14';
+1 -1
View File
@@ -1,6 +1,6 @@
name: shorebird_cli
description: Command-line tool to interact with Shorebird's services.
version: 1.4.13
version: 1.4.14
repository: https://github.com/shorebirdtech/shorebird
publish_to: none
@@ -540,6 +540,15 @@ void main() {
'App.ct.link',
),
).createSync(recursive: true);
File(
p.join(
projectRoot.path,
'build',
'ios',
'shorebird',
'App.class_table.json',
),
).createSync(recursive: true);
}
setUp(() {
@@ -886,7 +895,44 @@ void main() {
});
});
group('when class table link info is present', () {
group('when debug info is missing', () {
setUp(() {
when(
() => artifactManager.extractZip(
zipFile: supplementArtifactFile,
outputDirectory: any(named: 'outputDirectory'),
),
).thenAnswer((invocation) async {
final outDir = invocation.namedArguments[#outputDirectory]
as Directory;
File(
p.join(outDir.path, 'App.ct.link'),
).createSync(recursive: true);
});
});
test('exits with code 70', () async {
await expectLater(
() => runWithOverrides(
() => patcher.createPatchArtifacts(
appId: appId,
releaseId: releaseId,
releaseArtifact: releaseArtifactFile,
supplementArtifact: supplementArtifactFile,
),
),
exitsWithCode(ExitCode.software),
);
verify(
() => logger.err(
'Unable to find class table link debug info file',
),
).called(1);
});
});
group('when class table link info & debug info are present', () {
setUp(() {
when(
() => artifactManager.extractZip(
@@ -916,6 +962,9 @@ void main() {
File(
p.join(outDir.path, 'App.ct.link'),
).createSync(recursive: true);
File(
p.join(outDir.path, 'App.class_table.json'),
).createSync(recursive: true);
});
});
@@ -865,6 +865,15 @@ For more information see: ${supportedFlutterVersionsUrl.toLink()}''',
'App.ct.link',
),
).createSync(recursive: true);
File(
p.join(
projectRoot.path,
'build',
'ios',
'shorebird',
'App.class_table.json',
),
).createSync(recursive: true);
File(
p.join(projectRoot.path, 'build', linkFileName),
).createSync(recursive: true);
@@ -1320,7 +1329,7 @@ For more information see: ${supportedFlutterVersionsUrl.toLink()}''',
});
});
group('when class table link info is present', () {
group('when debug info is missing', () {
setUp(() {
when(
() => artifactManager.extractZip(
@@ -1336,6 +1345,46 @@ For more information see: ${supportedFlutterVersionsUrl.toLink()}''',
});
});
test('exits with code 70', () async {
await expectLater(
() => runWithOverrides(
() => patcher.createPatchArtifacts(
appId: appId,
releaseId: releaseId,
releaseArtifact: releaseArtifactFile,
supplementArtifact: supplementArtifactFile,
),
),
exitsWithCode(ExitCode.software),
);
verify(
() => logger.err(
'Unable to find class table link debug info file',
),
).called(1);
});
});
group('when class table link info & debug info are present', () {
setUp(() {
when(
() => artifactManager.extractZip(
zipFile: supplementArtifactFile,
outputDirectory: any(named: 'outputDirectory'),
),
).thenAnswer((invocation) async {
final outDir = invocation.namedArguments[#outputDirectory]
as Directory;
File(
p.join(outDir.path, 'App.ct.link'),
).createSync(recursive: true);
File(
p.join(outDir.path, 'App.class_table.json'),
).createSync(recursive: true);
});
});
test('returns linked patch artifact in patch bundle', () async {
final patchBundle = await runWithOverrides(
() => patcher.createPatchArtifacts(
@@ -236,7 +236,7 @@ void main() {
),
).thenAnswer((_) async => aabArtifact);
when(
() => codePushClientWrapper.getReleaseArtifact(
() => codePushClientWrapper.maybeGetReleaseArtifact(
appId: any(named: 'appId'),
releaseId: any(named: 'releaseId'),
arch: 'supplement',
@@ -482,7 +482,7 @@ void main() {
await runWithOverrides(() => command.createPatch(patcher));
verify(
() => codePushClientWrapper.getReleaseArtifact(
() => codePushClientWrapper.maybeGetReleaseArtifact(
appId: appId,
releaseId: release.id,
arch: 'supplement',