替换本地 GeckoView

1. 手动将本地 GeckoView 发布到本地 Maven

将我们的本地 GeckoView 发布到我们的本地 maven

./mach build && ./mach gradle \
    geckoview:publishWithGeckoBinariesDebugPublicationToMavenLocal \
    exoplayer2:publishDebugPublicationToMavenLocal

:warning: 每次进行更改时都需要运行此操作。 :warning

您需要复制日志中的版本或运行

./mach build | grep version

(例如 115.0.20230511122045-SNAPSHOT)

2. 修改 Fenix 以使用本地 GV

更新 Fenix 中的 build.gradle 和 Gecko.kt 文件(请参阅下面的差异)。请记住,使用您在步骤 2 中找到的版本更新 GV 版本!

fenix/build.gradle

diff --git a/fenix/build.gradle b/fenix/build.gradle
index 6a635a4818..4c8cc28995 100644
--- a/fenix/build.gradle
+++ b/fenix/build.gradle
@@ -5,6 +5,7 @@ import org.mozilla.fenix.gradle.tasks.GithubDetailsTask
 buildscript {
     // This logic is duplicated in the allprojects block: I don't know how to fix that.
     repositories {
+        mavenLocal()
         maven {
             name "Mozilla Nightly"
             url "https://nightly.maven.mozilla.org/maven2"
@@ -90,6 +91,7 @@ plugins {
 allprojects {
     // This logic is duplicated in the buildscript block: I don't know how to fix that.
     repositories {
+        mavenLocal()
         maven {
             name "Mozilla Nightly"
             url "https://nightly.maven.mozilla.org/maven2"

Gecko.kt

diff --git a/android-components/plugins/dependencies/src/main/java/Gecko.kt b/android-components/plugins/dependencies/src/main/java/Gecko.kt
index bed3fb0161..2d3a19a96e 100644
--- a/android-components/plugins/dependencies/src/main/java/Gecko.kt
+++ b/android-components/plugins/dependencies/src/main/java/Gecko.kt
@@ -9,7 +9,7 @@ object Gecko {
     /**
      * GeckoView Version.
      */
-    const val version = "115.0.20230511131014"
+    const val version = "115.0.20230511122045-SNAPSHOT"

     /**
      * GeckoView channel
@@ -23,7 +23,7 @@ object Gecko {
 enum class GeckoChannel(
     val artifactName: String,
 ) {
-    NIGHTLY("geckoview-nightly-omni"),
+    NIGHTLY("geckoview-default-omni"),
     BETA("geckoview-beta-omni"),
     RELEASE("geckoview-omni"),
 }

3. 使用本地 GV 构建 fenix

现在同步您的 gradle 更改并构建!

确认您正在使用本地 GV 的一种简单方法是将您的 Android Studio 项目工具窗口切换到“Project”,并在名为“External Libraries”的根目录中查找“GeckoView”。您应该会看到类似 Gradle: org.mozilla.geckoview-default-omni:115.0.20230511122045-SNAPSHOT@aar 的内容