forked from firka/flutter
Start using bin/cache/engine.{stamp|realm} instead of bin/internal/engine.{realm|version}. (#164352)
Towards https://github.com/flutter/flutter/issues/164315. See also: https://github.com/flutter/flutter/blob/master/docs/tool/Engine-artifacts.md. There are more usages in `flutter/flutter`, but some will require more specialized review (i.e. from release folks, or the Dart SDK team), so I'll split those off. ~~Requires https://github.com/flutter/flutter/pull/164317 to merge first.~~ ✅
This commit is contained in:
@@ -165,7 +165,7 @@ class SourceVisitor implements ResolvedFiles {
|
||||
///
|
||||
/// If the [Artifact] points to a directory then all child files are included.
|
||||
/// To increase the performance of builds that use a known revision of Flutter,
|
||||
/// these are updated to point towards the engine.version file instead of
|
||||
/// these are updated to point towards the `engine.stamp` file instead of
|
||||
/// the artifact itself.
|
||||
void visitArtifact(Artifact artifact, TargetPlatform? platform, BuildMode? mode) {
|
||||
// This is not a local engine.
|
||||
@@ -173,8 +173,8 @@ class SourceVisitor implements ResolvedFiles {
|
||||
sources.add(
|
||||
environment.flutterRootDir
|
||||
.childDirectory('bin')
|
||||
.childDirectory('internal')
|
||||
.childFile('engine.version'),
|
||||
.childDirectory('cache')
|
||||
.childFile('engine.stamp'),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -199,7 +199,7 @@ class SourceVisitor implements ResolvedFiles {
|
||||
///
|
||||
/// If the [Artifact] points to a directory then all child files are included.
|
||||
/// To increase the performance of builds that use a known revision of Flutter,
|
||||
/// these are updated to point towards the engine.version file instead of
|
||||
/// these are updated to point towards the `engine.stamp` file instead of
|
||||
/// the artifact itself.
|
||||
void visitHostArtifact(HostArtifact artifact) {
|
||||
// This is not a local engine.
|
||||
@@ -207,8 +207,8 @@ class SourceVisitor implements ResolvedFiles {
|
||||
sources.add(
|
||||
environment.flutterRootDir
|
||||
.childDirectory('bin')
|
||||
.childDirectory('internal')
|
||||
.childFile('engine.version'),
|
||||
.childDirectory('cache')
|
||||
.childFile('engine.stamp'),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@ class Cache {
|
||||
|
||||
/// The current version of the Flutter engine the flutter tool will download.
|
||||
String get engineRevision {
|
||||
_engineRevision ??= getVersionFor('engine');
|
||||
_engineRevision ??= getStampFor('engine');
|
||||
if (_engineRevision == null) {
|
||||
throwToolExit('Could not determine engine revision.');
|
||||
}
|
||||
@@ -684,12 +684,14 @@ class Cache {
|
||||
return versionFile.existsSync() ? versionFile.readAsStringSync().trim() : null;
|
||||
}
|
||||
|
||||
// TODO(matanlurey): Remove the ability to do "generic" realms, and special case for engine.
|
||||
// https://github.com/flutter/flutter/issues/164315
|
||||
String? getRealmFor(String artifactName) {
|
||||
final File realmFile = _fileSystem.file(
|
||||
_fileSystem.path.join(
|
||||
_rootOverride?.path ?? flutterRoot!,
|
||||
'bin',
|
||||
'internal',
|
||||
'cache',
|
||||
'$artifactName.realm',
|
||||
),
|
||||
);
|
||||
@@ -930,6 +932,9 @@ abstract class EngineCachedArtifact extends CachedArtifact {
|
||||
@override
|
||||
final String stampName;
|
||||
|
||||
@override
|
||||
String? get version => cache.engineRevision;
|
||||
|
||||
/// Return a list of (directory path, download URL path) tuples.
|
||||
List<List<String>> getBinaryDirs();
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ class FlutterWebSdk extends CachedArtifact {
|
||||
Directory get location => cache.getWebSdkDirectory();
|
||||
|
||||
@override
|
||||
String? get version => cache.getVersionFor('engine');
|
||||
String? get version => cache.engineRevision;
|
||||
|
||||
@override
|
||||
Future<void> updateInner(
|
||||
@@ -568,7 +568,7 @@ class FlutterRunnerSDKArtifacts extends CachedArtifact {
|
||||
Directory get location => cache.getArtifactDirectory('flutter_runner');
|
||||
|
||||
@override
|
||||
String? get version => cache.getVersionFor('engine');
|
||||
String? get version => cache.engineRevision;
|
||||
|
||||
@override
|
||||
Future<void> updateInner(
|
||||
@@ -627,7 +627,7 @@ class FlutterRunnerDebugSymbols extends CachedArtifact {
|
||||
Directory get location => cache.getArtifactDirectory(name);
|
||||
|
||||
@override
|
||||
String? get version => cache.getVersionFor('engine');
|
||||
String? get version => cache.engineRevision;
|
||||
|
||||
Future<void> _downloadDebugSymbols(String targetArch, ArtifactUpdater artifactUpdater) async {
|
||||
final String packageName = 'fuchsia-debug-symbols-$targetArch';
|
||||
|
||||
Reference in New Issue
Block a user