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:
Matan Lurey
2025-03-01 16:54:33 -08:00
committed by GitHub
parent 0c055f2c50
commit 71d50a1616
16 changed files with 60 additions and 39 deletions

View File

@@ -44,7 +44,7 @@ void configureProject(Project project, String outputDir) {
String storageUrl = System.getenv('FLUTTER_STORAGE_BASE_URL') ?: "https://storage.googleapis.com"
String engineRealm = Paths.get(getFlutterRoot(project), "bin", "internal", "engine.realm")
String engineRealm = Paths.get(getFlutterRoot(project), "bin", "cache", "engine.realm")
.toFile().text.trim()
if (engineRealm) {
engineRealm += "/"
@@ -57,7 +57,7 @@ void configureProject(Project project, String outputDir) {
url "$storageUrl/${engineRealm}download.flutter.io"
}
}
String engineVersion = Paths.get(getFlutterRoot(project), "bin", "internal", "engine.version")
String engineVersion = Paths.get(getFlutterRoot(project), "bin", "cache", "engine.stamp")
.toFile().text.trim()
project.dependencies {
// Add the embedding dependency.
@@ -179,7 +179,7 @@ projectsEvaluated {
// Configure the `assembleAar<variantName>` task for each plugin's projects and make
// the module's equivalent task depend on the plugin's task.
String variantName = variant.name.capitalize()
Task moduleProjectTask = moduleProject.tasks.named("assembleAar$variantName").get()
assert(moduleProjectTask != null)
Task pluginProjectTask = pluginProject.tasks.named("assembleAar$variantName").get()

View File

@@ -25,8 +25,8 @@ val engineVersion =
Paths.get(
flutterRoot.absolutePath,
"bin",
"internal",
"engine.version"
"cache",
"engine.stamp"
)
.toFile()
.readText()
@@ -36,7 +36,7 @@ var engineRealm =
Paths.get(
flutterRoot.absolutePath,
"bin",
"internal",
"cache",
"engine.realm"
)
.toFile()

View File

@@ -213,9 +213,9 @@ class FlutterPlugin implements Plugin<Project> {
engineVersion = useLocalEngine()
? "+" // Match any version since there's only one.
: "1.0.0-" + Paths.get(flutterRoot.absolutePath, "bin", "internal", "engine.version").toFile().text.trim()
: "1.0.0-" + Paths.get(flutterRoot.absolutePath, "bin", "cache", "engine.stamp").toFile().text.trim()
engineRealm = Paths.get(flutterRoot.absolutePath, "bin", "internal", "engine.realm").toFile().text.trim()
engineRealm = Paths.get(flutterRoot.absolutePath, "bin", "cache", "engine.realm").toFile().text.trim()
if (engineRealm) {
engineRealm += "/"
}