forked from mirrors/gecko-dev
Bug 1822393 - Support Fenix consuming GeckoView directly. r=owlish,nalexander,geckoview-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D201493
This commit is contained in:
parent
eae8e93805
commit
a4eecece6d
6 changed files with 52 additions and 12 deletions
14
build.gradle
14
build.gradle
|
|
@ -19,6 +19,9 @@ buildscript {
|
||||||
detekt_plugin = Versions.detekt
|
detekt_plugin = Versions.detekt
|
||||||
python_envs_plugin = Versions.python_envs_plugin
|
python_envs_plugin = Versions.python_envs_plugin
|
||||||
ksp_plugin = Versions.ksp_plugin
|
ksp_plugin = Versions.ksp_plugin
|
||||||
|
|
||||||
|
// Used in mobile/android/fenix/app/build.gradle
|
||||||
|
protobuf_plugin = FenixVersions.protobuf_plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
@ -28,6 +31,13 @@ buildscript {
|
||||||
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0'
|
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0'
|
||||||
classpath 'org.tomlj:tomlj:1.1.0'
|
classpath 'org.tomlj:tomlj:1.1.0'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
|
||||||
|
// Used in mobile/android/fenix/app/build.gradle
|
||||||
|
classpath FenixDependencies.androidx_safeargs
|
||||||
|
classpath FenixDependencies.osslicenses_plugin
|
||||||
|
classpath FenixDependencies.tools_benchmarkgradle
|
||||||
|
classpath "org.mozilla.telemetry:glean-gradle-plugin:${Versions.mozilla_glean}"
|
||||||
|
classpath "${ApplicationServicesConfig.groupId}:tooling-nimbus-gradle:${ApplicationServicesConfig.version}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -357,10 +367,10 @@ afterEvaluate {
|
||||||
"-Xlint:-serial",
|
"-Xlint:-serial",
|
||||||
// Classfile, because javac has a bug with MethodParameters attributes
|
// Classfile, because javac has a bug with MethodParameters attributes
|
||||||
// with Java 7. https://bugs.openjdk.java.net/browse/JDK-8190452
|
// with Java 7. https://bugs.openjdk.java.net/browse/JDK-8190452
|
||||||
"-Xlint:-classfile",
|
"-Xlint:-classfile"]
|
||||||
// Turn all remaining warnings into errors,
|
// Turn all remaining warnings into errors,
|
||||||
// unless marked by @SuppressWarnings.
|
// unless marked by @SuppressWarnings.
|
||||||
"-Werror"]
|
//"-Werror"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,23 +34,30 @@ object Config {
|
||||||
// ergonomically validate (sometimes IDEs default to a release variant and mysteriously fail due to the
|
// ergonomically validate (sometimes IDEs default to a release variant and mysteriously fail due to the
|
||||||
// validation, sometimes devs just need a release build and specifying project properties is annoying in IDEs),
|
// validation, sometimes devs just need a release build and specifying project properties is annoying in IDEs),
|
||||||
// so instead we'll allow the `versionName` to silently default to an empty string.
|
// so instead we'll allow the `versionName` to silently default to an empty string.
|
||||||
return if (project.hasProperty("versionName")) project.property("versionName") as String else null
|
return if (project.hasProperty("versionName")) project.property("versionName").toString() else null
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun nightlyVersionName(): String {
|
fun nightlyVersionName(project: Project): String {
|
||||||
// Nightly versions will use the version from "version.txt".
|
// Nightly versions will use the version from "version.txt".
|
||||||
return readVersionFromFile()
|
return readVersionFromFile(project)
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun readVersionFromFile(): String {
|
fun readVersionFromFile(project: Project): String {
|
||||||
return File("../version.txt").useLines { it.firstOrNull() ?: "" }
|
var versionPath = "../version.txt"
|
||||||
|
|
||||||
|
if (project.findProject(":geckoview") != null) {
|
||||||
|
versionPath = "./mobile/android/version.txt"
|
||||||
|
}
|
||||||
|
|
||||||
|
return File(versionPath).useLines { it.firstOrNull() ?: "" }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun majorVersion(): String {
|
fun majorVersion(project: Project): String {
|
||||||
return readVersionFromFile().split(".")[0]
|
return readVersionFromFile(project).split(".")[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@ plugins {
|
||||||
id "com.google.protobuf" version "$protobuf_plugin"
|
id "com.google.protobuf" version "$protobuf_plugin"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (findProject(":geckoview") != null) {
|
||||||
|
buildDir "${topobjdir}/gradle/build/mobile/android/fenix"
|
||||||
|
}
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-parcelize'
|
apply plugin: 'kotlin-parcelize'
|
||||||
|
|
@ -13,6 +17,10 @@ apply plugin: 'jacoco'
|
||||||
apply plugin: 'androidx.navigation.safeargs.kotlin'
|
apply plugin: 'androidx.navigation.safeargs.kotlin'
|
||||||
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
|
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
|
||||||
|
|
||||||
|
if (findProject(":geckoview") != null) {
|
||||||
|
apply from: "${topsrcdir}/mobile/android/gradle/product_flavors.gradle"
|
||||||
|
}
|
||||||
|
|
||||||
import groovy.json.JsonOutput
|
import groovy.json.JsonOutput
|
||||||
import org.gradle.internal.logging.text.StyledTextOutput.Style
|
import org.gradle.internal.logging.text.StyledTextOutput.Style
|
||||||
import org.gradle.internal.logging.text.StyledTextOutputFactory
|
import org.gradle.internal.logging.text.StyledTextOutputFactory
|
||||||
|
|
@ -188,6 +196,11 @@ android {
|
||||||
animationsDisabled = true
|
animationsDisabled = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (findProject(":geckoview") != null) {
|
||||||
|
project.configureProductFlavors.delegate = it
|
||||||
|
project.configureProductFlavors()
|
||||||
|
}
|
||||||
|
|
||||||
flavorDimensions.add("product")
|
flavorDimensions.add("product")
|
||||||
|
|
||||||
productFlavors {
|
productFlavors {
|
||||||
|
|
@ -297,7 +310,7 @@ android.applicationVariants.configureEach { variant ->
|
||||||
// same version code. Therefore we need to have different version codes for our ARM and x86
|
// same version code. Therefore we need to have different version codes for our ARM and x86
|
||||||
// builds.
|
// builds.
|
||||||
|
|
||||||
def versionName = variant.buildType.name == 'nightly' ? Config.nightlyVersionName() : Config.releaseVersionName(project)
|
def versionName = variant.buildType.name == 'nightly' ? Config.nightlyVersionName(project) : Config.releaseVersionName(project)
|
||||||
println("versionName override: $versionName")
|
println("versionName override: $versionName")
|
||||||
|
|
||||||
variant.outputs.each { output ->
|
variant.outputs.each { output ->
|
||||||
|
|
@ -906,4 +919,4 @@ def getSupportedLocales() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable expiration by major version.
|
// Enable expiration by major version.
|
||||||
ext.gleanExpireByVersion = Config.majorVersion()
|
ext.gleanExpireByVersion = Config.majorVersion(project)
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ channels:
|
||||||
- beta
|
- beta
|
||||||
- nightly
|
- nightly
|
||||||
- developer
|
- developer
|
||||||
|
- withGeckoBinariesFenixDebug
|
||||||
includes:
|
includes:
|
||||||
- onboarding.fml.yaml
|
- onboarding.fml.yaml
|
||||||
- pbm.fml.yaml
|
- pbm.fml.yaml
|
||||||
|
|
|
||||||
|
|
@ -373,7 +373,7 @@ android.applicationVariants.configureEach { variant ->
|
||||||
|
|
||||||
if (buildType == "release" || buildType == "nightly" || buildType == "beta") {
|
if (buildType == "release" || buildType == "nightly" || buildType == "beta") {
|
||||||
def baseVersionCode = generatedVersionCode
|
def baseVersionCode = generatedVersionCode
|
||||||
def versionName = buildType == "nightly" ? Config.nightlyVersionName() : Config.releaseVersionName(project)
|
def versionName = buildType == "nightly" ? Config.nightlyVersionName(project) : Config.releaseVersionName(project)
|
||||||
println("versionName override: $versionName")
|
println("versionName override: $versionName")
|
||||||
|
|
||||||
// The Google Play Store does not allow multiple APKs for the same app that all have the
|
// The Google Play Store does not allow multiple APKs for the same app that all have the
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,16 @@
|
||||||
pluginManagement {
|
pluginManagement {
|
||||||
|
includeBuild("${rootProject.projectDir.absolutePath}/mobile/android/android-components/plugins/config")
|
||||||
includeBuild("${rootProject.projectDir.absolutePath}/mobile/android/android-components/plugins/dependencies")
|
includeBuild("${rootProject.projectDir.absolutePath}/mobile/android/android-components/plugins/dependencies")
|
||||||
includeBuild("${rootProject.projectDir.absolutePath}/mobile/android/android-components/plugins/publicsuffixlist")
|
includeBuild("${rootProject.projectDir.absolutePath}/mobile/android/android-components/plugins/publicsuffixlist")
|
||||||
|
includeBuild("${rootProject.projectDir.absolutePath}/mobile/android/fenix/plugins/apksize")
|
||||||
|
includeBuild("${rootProject.projectDir.absolutePath}/mobile/android/fenix/plugins/fenixdependencies")
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
id "mozac.ConfigPlugin"
|
||||||
id 'mozac.DependenciesPlugin'
|
id 'mozac.DependenciesPlugin'
|
||||||
|
id 'ApkSizePlugin'
|
||||||
|
id 'FenixDependenciesPlugin'
|
||||||
}
|
}
|
||||||
|
|
||||||
// You might think topsrcdir is '.', but that's not true when the Gradle build
|
// You might think topsrcdir is '.', but that's not true when the Gradle build
|
||||||
|
|
@ -27,6 +33,8 @@ include ':test_runner'
|
||||||
include ':exoplayer2'
|
include ':exoplayer2'
|
||||||
include ':android-components'
|
include ':android-components'
|
||||||
include ':samples-browser'
|
include ':samples-browser'
|
||||||
|
include ':fenix'
|
||||||
|
include ':mozilla-lint-rules'
|
||||||
|
|
||||||
project(':annotations').projectDir = new File("${gradle.mozconfig.topsrcdir}/mobile/android/annotations")
|
project(':annotations').projectDir = new File("${gradle.mozconfig.topsrcdir}/mobile/android/annotations")
|
||||||
project(':geckoview').projectDir = new File("${gradle.mozconfig.topsrcdir}/mobile/android/geckoview")
|
project(':geckoview').projectDir = new File("${gradle.mozconfig.topsrcdir}/mobile/android/geckoview")
|
||||||
|
|
@ -35,6 +43,7 @@ project(':test_runner').projectDir = new File("${gradle.mozconfig.topsrcdir}/mob
|
||||||
project(':exoplayer2').projectDir = new File("${gradle.mozconfig.topsrcdir}/mobile/android/exoplayer2")
|
project(':exoplayer2').projectDir = new File("${gradle.mozconfig.topsrcdir}/mobile/android/exoplayer2")
|
||||||
project(':android-components').projectDir = new File("${gradle.mozconfig.topsrcdir}/mobile/android/android-components")
|
project(':android-components').projectDir = new File("${gradle.mozconfig.topsrcdir}/mobile/android/android-components")
|
||||||
project(':samples-browser').projectDir = new File("${gradle.mozconfig.topsrcdir}/mobile/android/android-components/samples/browser")
|
project(':samples-browser').projectDir = new File("${gradle.mozconfig.topsrcdir}/mobile/android/android-components/samples/browser")
|
||||||
|
project(':fenix').projectDir = new File("${gradle.mozconfig.topsrcdir}/mobile/android/fenix/app")
|
||||||
|
|
||||||
if (hasProperty("androidFormatLintTest")) {
|
if (hasProperty("androidFormatLintTest")) {
|
||||||
include ':androidFormatLintTest'
|
include ':androidFormatLintTest'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue