Skip to content

Commit 71d50a1

Browse files
authored
Start using bin/cache/engine.{stamp|realm} instead of bin/internal/engine.{realm|version}. (#164352)
Towards flutter/flutter#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 flutter/flutter#164317 to merge first.~~ ✅
1 parent 0c055f2 commit 71d50a1

16 files changed

Lines changed: 60 additions & 39 deletions

File tree

dev/bots/suite_runners/run_test_harness_tests.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ Future<void> testHarnessTestsRunner() async {
133133
}
134134
}
135135

136-
/// Verify the Flutter Engine is the revision in
137-
/// bin/cache/internal/engine.version.
136+
/// Verify the Flutter Engine is the revision in `bin/cache/engine.stamp`.
138137
Future<void> _validateEngineHash() async {
139138
final String flutterTester = path.join(
140139
flutterRoot,
@@ -146,6 +145,7 @@ Future<void> _validateEngineHash() async {
146145
'flutter_tester$exe',
147146
);
148147

148+
// TODO(matanlurey): Revisit with the Dart team if this is true now that they use FLUTTER_PREBUILT_ENGINE_VERSION=...
149149
if (runningInDartHHHBot) {
150150
// The Dart HHH bots intentionally modify the local artifact cache
151151
// and then use this script to run Flutter's test suites.

dev/bots/suite_runners/run_web_tests.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ class WebTestsSuite {
9191

9292
/// Coarse-grained integration tests running on the Web.
9393
Future<void> webLongRunningTestsRunner() async {
94-
final String engineVersionFile = path.join(flutterRoot, 'bin', 'internal', 'engine.version');
95-
final String engineRealmFile = path.join(flutterRoot, 'bin', 'internal', 'engine.realm');
94+
final String engineVersionFile = path.join(flutterRoot, 'bin', 'cache', 'engine.stamp');
95+
final String engineRealmFile = path.join(flutterRoot, 'bin', 'cache', 'engine.realm');
9696
final String engineVersion = File(engineVersionFile).readAsStringSync().trim();
9797
final String engineRealm = File(engineRealmFile).readAsStringSync().trim();
9898
if (engineRealm.isNotEmpty) {

dev/bots/utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ final String flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(P
6161
final String flutter = path.join(flutterRoot, 'bin', 'flutter$bat');
6262
final String dart = path.join(flutterRoot, 'bin', 'cache', 'dart-sdk', 'bin', 'dart$exe');
6363
final String pubCache = path.join(flutterRoot, '.pub-cache');
64-
final String engineVersionFile = path.join(flutterRoot, 'bin', 'internal', 'engine.version');
64+
final String engineVersionFile = path.join(flutterRoot, 'bin', 'cache', 'engine.stamp');
6565
final String luciBotId = Platform.environment['SWARMING_BOT_ID'] ?? '';
6666
final bool runningInDartHHHBot =
6767
luciBotId.startsWith('luci-dart-') || luciBotId.startsWith('dart-tests-');

dev/devicelab/bin/tasks/engine_dependency_proxy_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ tasks.register("printEngineMavenUrl") {
5959

6060
String realm =
6161
File(
62-
path.join(flutterDirectory.path, 'bin', 'internal', 'engine.realm'),
62+
path.join(flutterDirectory.path, 'bin', 'cache', 'engine.realm'),
6363
).readAsStringSync().trim();
6464
if (realm.isNotEmpty) {
6565
realm = '$realm/';

dev/tools/create_api_docs.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ class FlutterInformation {
12651265
info['engineRevision'] = flutterVersion['engineRevision'] as String;
12661266
final File engineRealm = flutterRoot
12671267
.childDirectory('bin')
1268-
.childDirectory('internal')
1268+
.childDirectory('cache')
12691269
.childFile('engine.realm');
12701270
info['engineRealm'] = engineRealm.existsSync() ? engineRealm.readAsStringSync().trim() : '';
12711271

dev/tools/find_engine_commit.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'dart:io';
66

77
void _validate(List<String> args) {
88
bool errors = false;
9-
if (!File('bin/internal/engine.version').existsSync()) {
9+
if (!File('bin/cache/engine.stamp').existsSync()) {
1010
errors = true;
1111
print('This program must be run from the root of your flutter repository.');
1212
}

dev/tools/test/create_api_docs_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void main() {
197197
.childDirectory('user')
198198
.childDirectory('flutter')
199199
.childDirectory('bin')
200-
.childDirectory('internal');
200+
.childDirectory('cache');
201201
flutterHome.childFile('engine.realm')
202202
..createSync(recursive: true)
203203
..writeAsStringSync('realm');

packages/flutter_tools/gradle/aar_init_script.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void configureProject(Project project, String outputDir) {
4444

4545
String storageUrl = System.getenv('FLUTTER_STORAGE_BASE_URL') ?: "https://storage.googleapis.com"
4646

47-
String engineRealm = Paths.get(getFlutterRoot(project), "bin", "internal", "engine.realm")
47+
String engineRealm = Paths.get(getFlutterRoot(project), "bin", "cache", "engine.realm")
4848
.toFile().text.trim()
4949
if (engineRealm) {
5050
engineRealm += "/"
@@ -57,7 +57,7 @@ void configureProject(Project project, String outputDir) {
5757
url "$storageUrl/${engineRealm}download.flutter.io"
5858
}
5959
}
60-
String engineVersion = Paths.get(getFlutterRoot(project), "bin", "internal", "engine.version")
60+
String engineVersion = Paths.get(getFlutterRoot(project), "bin", "cache", "engine.stamp")
6161
.toFile().text.trim()
6262
project.dependencies {
6363
// Add the embedding dependency.
@@ -179,7 +179,7 @@ projectsEvaluated {
179179
// Configure the `assembleAar<variantName>` task for each plugin's projects and make
180180
// the module's equivalent task depend on the plugin's task.
181181
String variantName = variant.name.capitalize()
182-
182+
183183
Task moduleProjectTask = moduleProject.tasks.named("assembleAar$variantName").get()
184184
assert(moduleProjectTask != null)
185185
Task pluginProjectTask = pluginProject.tasks.named("assembleAar$variantName").get()

packages/flutter_tools/gradle/resolve_dependencies.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ val engineVersion =
2525
Paths.get(
2626
flutterRoot.absolutePath,
2727
"bin",
28-
"internal",
29-
"engine.version"
28+
"cache",
29+
"engine.stamp"
3030
)
3131
.toFile()
3232
.readText()
@@ -36,7 +36,7 @@ var engineRealm =
3636
Paths.get(
3737
flutterRoot.absolutePath,
3838
"bin",
39-
"internal",
39+
"cache",
4040
"engine.realm"
4141
)
4242
.toFile()

packages/flutter_tools/gradle/src/main/groovy/flutter.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ class FlutterPlugin implements Plugin<Project> {
213213

214214
engineVersion = useLocalEngine()
215215
? "+" // Match any version since there's only one.
216-
: "1.0.0-" + Paths.get(flutterRoot.absolutePath, "bin", "internal", "engine.version").toFile().text.trim()
216+
: "1.0.0-" + Paths.get(flutterRoot.absolutePath, "bin", "cache", "engine.stamp").toFile().text.trim()
217217

218-
engineRealm = Paths.get(flutterRoot.absolutePath, "bin", "internal", "engine.realm").toFile().text.trim()
218+
engineRealm = Paths.get(flutterRoot.absolutePath, "bin", "cache", "engine.realm").toFile().text.trim()
219219
if (engineRealm) {
220220
engineRealm += "/"
221221
}

0 commit comments

Comments
 (0)