refactor(shorebird_cli): update shorebird_linker to aot-tools (#1470)

This commit is contained in:
Felix Angelov
2023-11-09 13:44:34 -06:00
committed by GitHub
parent c7b812c8ad
commit 2a478ff81d
2 changed files with 9 additions and 9 deletions
+7 -7
View File
@@ -54,7 +54,7 @@ class Cache {
}) : httpClient = httpClient ?? retryingHttpClient(http.Client()) {
registerArtifact(PatchArtifact(cache: this, platform: platform));
registerArtifact(BundleToolArtifact(cache: this, platform: platform));
registerArtifact(ShorebirdLinkerArtifact(cache: this, platform: platform));
registerArtifact(AotToolsArtifact(cache: this, platform: platform));
}
final http.Client httpClient;
@@ -187,22 +187,22 @@ allowed to access $storageUrl.''',
}
}
class ShorebirdLinkerArtifact extends CachedArtifact {
ShorebirdLinkerArtifact({required super.cache, required super.platform});
class AotToolsArtifact extends CachedArtifact {
AotToolsArtifact({required super.cache, required super.platform});
@override
String get name => 'shorebird_linker';
String get name => 'aot-tools';
@override
List<String> get executables => ['shorebird_linker'];
List<String> get executables => ['aot-tools'];
/// The linker is only available for revisions that support mixed-mode.
/// The aot-tools are only available for revisions that support mixed-mode.
@override
bool get required => false;
@override
String get storageUrl {
var artifactName = 'linker-';
var artifactName = 'aot-tools-';
if (platform.isMacOS) {
artifactName += 'darwin-x64';
} else if (platform.isLinux) {
@@ -215,7 +215,7 @@ void main() {
(invocation) async {
final request =
invocation.positionalArguments.first as http.BaseRequest;
if (request.url.path.endsWith('linker-darwin-x64')) {
if (request.url.path.endsWith('aot-tools-darwin-x64')) {
return http.StreamedResponse(
const Stream.empty(),
HttpStatus.notFound,
@@ -234,7 +234,7 @@ void main() {
);
verify(
() => logger.detail(
'''[cache] optional artifact: "shorebird_linker" was not found, skipping...''',
'''[cache] optional artifact: "aot-tools" was not found, skipping...''',
),
).called(1);
});