1
0
Fork 0
fenix/app/build.gradle

673 lines
26 KiB
Groovy
Raw Permalink Normal View History

plugins {
id "com.jetbrains.python.envs" version "0.0.26"
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
2019-08-09 02:09:54 +02:00
apply plugin: 'jacoco'
apply plugin: 'androidx.navigation.safeargs.kotlin'
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
2019-11-06 02:30:04 +01:00
import com.android.build.OutputFile
import org.gradle.internal.logging.text.StyledTextOutput.Style
import org.gradle.internal.logging.text.StyledTextOutputFactory
import org.mozilla.fenix.gradle.tasks.LintUnitTestRunner
2019-11-06 02:30:04 +01:00
import static org.gradle.api.tasks.testing.TestResult.ResultType
android {
compileSdkVersion Config.compileSdkVersion
defaultConfig {
applicationId "org.mozilla"
minSdkVersion Config.minSdkVersion
targetSdkVersion Config.targetSdkVersion
versionCode 1
versionName Config.generateDebugVersionName()
vectorDrawables.useSupportLibrary = true
2019-04-10 18:59:38 +02:00
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments clearPackageData: 'true'
resValue "bool", "IS_DEBUG", "false"
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "false"
buildConfigField "String", "AMO_COLLECTION", "\"3204bb44a6ef44d39ee34917f28055\""
def deepLinkSchemeValue = "fenix-dev"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [
"deepLinkScheme": deepLinkSchemeValue
]
}
def releaseTemplate = {
shrinkResources true
minifyEnabled true
proguardFiles 'proguard-android-optimize-3.5.0-modified.txt', 'proguard-rules.pro'
matchingFallbacks = ['release'] // Use on the "release" build type in dependencies (AARs)
if (gradle.hasProperty("localProperties.autosignReleaseWithDebugKey")) {
signingConfig signingConfigs.debug
}
if (gradle.hasProperty("localProperties.debuggable")) {
debuggable true
}
}
buildTypes {
debug {
shrinkResources false
minifyEnabled false
applicationIdSuffix ".fenix.debug"
resValue "bool", "IS_DEBUG", "true"
pseudoLocalesEnabled true
}
nightly releaseTemplate >> {
applicationIdSuffix ".fenix"
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
def deepLinkSchemeValue = "fenix-nightly"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = ["deepLinkScheme": deepLinkSchemeValue]
}
beta releaseTemplate >> {
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
applicationIdSuffix ".firefox_beta"
def deepLinkSchemeValue = "fenix-beta"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [
// This release type is meant to replace Firefox (Beta channel) and therefore needs to inherit
Adds custom search engines (#6551) * For #5577 - Adds button to add a new search engine * For #5577 - Adds custom engine store * For #5577 - Creates a custom SearchEngineProvider * For #5577 - Gives the ability to delete search engines * For #5577 - Adds the UI to add a custom search engine * For #5577 - Adds form to create a custom search engine * For #5577 - Adds the ability to add a custom search engine * For #5577 - Adds the ability to delete custom search engines * For #5577 - Selects the first element on the add custom search engine screen * For #5577 - Prevents adding a search engine that already exists * For #5577 - Styles the add search engine preference * For #5577 - Makes the name check case-insensitive * For #5577 - Fix bug where home screen doesnt see new search engines * For #5577 - Moves Search URL validation to its own type * For #5577 - Fixes linting errors * For #5577 - Adds the ability to edit a custom search engine * For #5577 - Allows the user to edit a serach engine even when it is the last item in the list * For #5577 - Adds an undo snackbar when deleting a search engine * For #5577 - Moves all of the strings to be translated * For #5577 - Fixes bug when deleting your default search engine * For #5577 - Puts adding search engines behind a feature flag * For #5577 - Navigate to custom search engine SUMO article when tapping learn more * For #5577 - Fixes nits * For #5577 - Uses concept-fetch to validate search string * For #5577 - Adds string resources for the cannot reach error state
2019-11-20 01:30:56 +01:00
// its sharedUserId for all eternity. See:
// https://searchfox.org/mozilla-central/search?q=moz_android_shared_id&case=false&regexp=false&path=
// Shipping an app update without sharedUserId can have
// fatal consequences. For example see:
// - https://issuetracker.google.com/issues/36924841
// - https://issuetracker.google.com/issues/36905922
"sharedUserId": "org.mozilla.firefox.sharedID",
"deepLinkScheme": deepLinkSchemeValue
]
}
release releaseTemplate >> {
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
applicationIdSuffix ".firefox"
def deepLinkSchemeValue = "fenix"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [
// This release type is meant to replace Firefox (Release channel) and therefore needs to inherit
// its sharedUserId for all eternity. See:
// https://searchfox.org/mozilla-central/search?q=moz_android_shared_id&case=false&regexp=false&path=
// Shipping an app update without sharedUserId can have
// fatal consequences. For example see:
// - https://issuetracker.google.com/issues/36924841
// - https://issuetracker.google.com/issues/36905922
"sharedUserId": "org.mozilla.firefox.sharedID",
"deepLinkScheme": deepLinkSchemeValue
]
}
}
aaptOptions {
// All JavaScript code used internally by GeckoView is packaged in a
// file called omni.ja. If this file is compressed in the APK,
// GeckoView must uncompress it before it can do anything else which
// causes a significant delay on startup.
noCompress 'ja'
// manifest.template.json is converted to manifest.json at build time.
// No need to package the template in the APK.
ignoreAssetsPattern "manifest.template.json"
}
2019-04-10 18:59:38 +02:00
testOptions {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
unitTests.includeAndroidResources = true
animationsDisabled = true
2019-04-10 18:59:38 +02:00
}
Configure either geckoview beta or nightly at compile-time (#4851) * Remove "abi" product flavor and introduce "engine" product flavor. This patch will allow us to build Fenix against GeckoView Nightly and GeckoView Beta by introducing a new flavor dimension: engine = [geckoNightly, geckoBeta]. In addition to that it adds a "fenix" prefix to the nightly, beta and production flavors to reduce the ambiguity between fenix beta/nightly and GeckoView beta/nightly. For now the build types have the following engine variants enabled: **debug**: geckoNightly, geckoBeta Both variants enabled for local development and testing. **forPerformanceTest**: geckoNightly, geckoBeta Both variants enabled unless the perf team only cares about Nightly (tbd) **fenixNightlyLegacy**: geckoBeta Uses GeckoView Beta for now - the same version we ship production builds with (same behavior as before). This release type will eventualyl be decommissioned once we switch to a separate Nightly app on Google Play. **fenixNightly**: geckoBeta Uses GeckoView Beta for now - the same version we ship production builds with (same behavior as before). Changing this build to use GeckoView Nightly is currently being discussed. **fenixBeta**: geckoBeta Fenix Beta uses GeckoView Beta. **fenixProduction** Fenix Production uses GeckoView Beta (69) currently. * gradle.py/variant.py: Replace "abi" with "engine". * Disable enableUnitTestBinaryResources until we can switch to Android Gradle plugin 3.5. * Fenix nightly should use both geckoview nightly and beta * Updates automation to use apk splitting and support different engine
2019-08-21 17:32:01 +02:00
flavorDimensions "engine"
sourceSets {
androidTest {
Adds custom search engines (#6551) * For #5577 - Adds button to add a new search engine * For #5577 - Adds custom engine store * For #5577 - Creates a custom SearchEngineProvider * For #5577 - Gives the ability to delete search engines * For #5577 - Adds the UI to add a custom search engine * For #5577 - Adds form to create a custom search engine * For #5577 - Adds the ability to add a custom search engine * For #5577 - Adds the ability to delete custom search engines * For #5577 - Selects the first element on the add custom search engine screen * For #5577 - Prevents adding a search engine that already exists * For #5577 - Styles the add search engine preference * For #5577 - Makes the name check case-insensitive * For #5577 - Fix bug where home screen doesnt see new search engines * For #5577 - Moves Search URL validation to its own type * For #5577 - Fixes linting errors * For #5577 - Adds the ability to edit a custom search engine * For #5577 - Allows the user to edit a serach engine even when it is the last item in the list * For #5577 - Adds an undo snackbar when deleting a search engine * For #5577 - Moves all of the strings to be translated * For #5577 - Fixes bug when deleting your default search engine * For #5577 - Puts adding search engines behind a feature flag * For #5577 - Navigate to custom search engine SUMO article when tapping learn more * For #5577 - Fixes nits * For #5577 - Uses concept-fetch to validate search string * For #5577 - Adds string resources for the cannot reach error state
2019-11-20 01:30:56 +01:00
resources.srcDirs += ['src/androidTest/resources']
}
debug {
java.srcDirs = ['src/geckoNightly/java']
}
nightly {
java.srcDirs = ['src/geckoNightly/java']
}
beta {
java.srcDirs = ['src/migration/java', 'src/geckoBeta/java']
manifest.srcFile "src/migration/AndroidManifest.xml"
}
release {
java.srcDirs = ['src/migration/java', 'src/geckoRelease/java']
manifest.srcFile "src/migration/AndroidManifest.xml"
}
Configure either geckoview beta or nightly at compile-time (#4851) * Remove "abi" product flavor and introduce "engine" product flavor. This patch will allow us to build Fenix against GeckoView Nightly and GeckoView Beta by introducing a new flavor dimension: engine = [geckoNightly, geckoBeta]. In addition to that it adds a "fenix" prefix to the nightly, beta and production flavors to reduce the ambiguity between fenix beta/nightly and GeckoView beta/nightly. For now the build types have the following engine variants enabled: **debug**: geckoNightly, geckoBeta Both variants enabled for local development and testing. **forPerformanceTest**: geckoNightly, geckoBeta Both variants enabled unless the perf team only cares about Nightly (tbd) **fenixNightlyLegacy**: geckoBeta Uses GeckoView Beta for now - the same version we ship production builds with (same behavior as before). This release type will eventualyl be decommissioned once we switch to a separate Nightly app on Google Play. **fenixNightly**: geckoBeta Uses GeckoView Beta for now - the same version we ship production builds with (same behavior as before). Changing this build to use GeckoView Nightly is currently being discussed. **fenixBeta**: geckoBeta Fenix Beta uses GeckoView Beta. **fenixProduction** Fenix Production uses GeckoView Beta (69) currently. * gradle.py/variant.py: Replace "abi" with "engine". * Disable enableUnitTestBinaryResources until we can switch to Android Gradle plugin 3.5. * Fenix nightly should use both geckoview nightly and beta * Updates automation to use apk splitting and support different engine
2019-08-21 17:32:01 +02:00
}
splits {
abi {
enable true
reset()
include "x86", "armeabi-v7a", "arm64-v8a", "x86_64"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
lintConfig file("lint.xml")
}
packagingOptions {
exclude 'META-INF/atomicfu.kotlin_module'
}
testOptions {
unitTests.returnDefaultValues = true
}
}
android.applicationVariants.all { variant ->
// -------------------------------------------------------------------------------------------------
// Set up kotlin-allopen plugin for writing tests
// -------------------------------------------------------------------------------------------------
boolean hasTest = gradle.startParameter.taskNames.find { it.contains("test") || it.contains("Test") } != null
if (hasTest) {
apply plugin: 'kotlin-allopen'
allOpen {
annotation("org.mozilla.fenix.utils.OpenClass")
}
}
// -------------------------------------------------------------------------------------------------
// Generate version codes for builds
// -------------------------------------------------------------------------------------------------
def isDebug = variant.buildType.resValues['IS_DEBUG']?.value ?: false
def useReleaseVersioning = variant.buildType.buildConfigFields['USE_RELEASE_VERSIONING']?.value ?: false
def versionName = Config.releaseVersionName(project)
println("----------------------------------------------")
println("Variant name: " + variant.name)
println("Application ID: " + [variant.mergedFlavor.applicationId, variant.buildType.applicationIdSuffix].findAll().join())
println("Build type: " + variant.buildType.name)
println("Flavor: " + variant.flavorName)
println("Telemetry enabled: " + !isDebug)
if (useReleaseVersioning) {
// The Google Play Store does not allow multiple APKs for the same app that all have the
// same version code. Therefore we need to have different version codes for our ARM and x86
// builds.
Configure either geckoview beta or nightly at compile-time (#4851) * Remove "abi" product flavor and introduce "engine" product flavor. This patch will allow us to build Fenix against GeckoView Nightly and GeckoView Beta by introducing a new flavor dimension: engine = [geckoNightly, geckoBeta]. In addition to that it adds a "fenix" prefix to the nightly, beta and production flavors to reduce the ambiguity between fenix beta/nightly and GeckoView beta/nightly. For now the build types have the following engine variants enabled: **debug**: geckoNightly, geckoBeta Both variants enabled for local development and testing. **forPerformanceTest**: geckoNightly, geckoBeta Both variants enabled unless the perf team only cares about Nightly (tbd) **fenixNightlyLegacy**: geckoBeta Uses GeckoView Beta for now - the same version we ship production builds with (same behavior as before). This release type will eventualyl be decommissioned once we switch to a separate Nightly app on Google Play. **fenixNightly**: geckoBeta Uses GeckoView Beta for now - the same version we ship production builds with (same behavior as before). Changing this build to use GeckoView Nightly is currently being discussed. **fenixBeta**: geckoBeta Fenix Beta uses GeckoView Beta. **fenixProduction** Fenix Production uses GeckoView Beta (69) currently. * gradle.py/variant.py: Replace "abi" with "engine". * Disable enableUnitTestBinaryResources until we can switch to Android Gradle plugin 3.5. * Fenix nightly should use both geckoview nightly and beta * Updates automation to use apk splitting and support different engine
2019-08-21 17:32:01 +02:00
variant.outputs.each { output ->
def abi = output.getFilter(OutputFile.ABI)
// We use the same version code generator, that we inherited from Fennec, across all channels - even on
// channels that never shipped a Fennec build.
def versionCodeOverride = Config.generateFennecVersionCode(abi)
Configure either geckoview beta or nightly at compile-time (#4851) * Remove "abi" product flavor and introduce "engine" product flavor. This patch will allow us to build Fenix against GeckoView Nightly and GeckoView Beta by introducing a new flavor dimension: engine = [geckoNightly, geckoBeta]. In addition to that it adds a "fenix" prefix to the nightly, beta and production flavors to reduce the ambiguity between fenix beta/nightly and GeckoView beta/nightly. For now the build types have the following engine variants enabled: **debug**: geckoNightly, geckoBeta Both variants enabled for local development and testing. **forPerformanceTest**: geckoNightly, geckoBeta Both variants enabled unless the perf team only cares about Nightly (tbd) **fenixNightlyLegacy**: geckoBeta Uses GeckoView Beta for now - the same version we ship production builds with (same behavior as before). This release type will eventualyl be decommissioned once we switch to a separate Nightly app on Google Play. **fenixNightly**: geckoBeta Uses GeckoView Beta for now - the same version we ship production builds with (same behavior as before). Changing this build to use GeckoView Nightly is currently being discussed. **fenixBeta**: geckoBeta Fenix Beta uses GeckoView Beta. **fenixProduction** Fenix Production uses GeckoView Beta (69) currently. * gradle.py/variant.py: Replace "abi" with "engine". * Disable enableUnitTestBinaryResources until we can switch to Android Gradle plugin 3.5. * Fenix nightly should use both geckoview nightly and beta * Updates automation to use apk splitting and support different engine
2019-08-21 17:32:01 +02:00
println("versionCode for $abi = $versionCodeOverride")
output.versionNameOverride = versionName
output.versionCodeOverride = versionCodeOverride
}
}
// -------------------------------------------------------------------------------------------------
// BuildConfig: Set variables for Sentry, Crash Reporting, and Telemetry
// -------------------------------------------------------------------------------------------------
buildConfigField 'String', 'SENTRY_TOKEN', 'null'
if (!isDebug) {
buildConfigField 'boolean', 'CRASH_REPORTING', 'true'
// Reading sentry token from local file (if it exists). In a release task on taskcluster it will be available.
try {
def token = new File("${rootDir}/.sentry_token").text.trim()
buildConfigField 'String', 'SENTRY_TOKEN', '"' + token + '"'
} catch (FileNotFoundException ignored) {}
} else {
buildConfigField 'boolean', 'CRASH_REPORTING', 'false'
}
if (!isDebug) {
buildConfigField 'boolean', 'TELEMETRY', 'true'
} else {
buildConfigField 'boolean', 'TELEMETRY', 'false'
}
def buildDate = Config.generateBuildDate()
// Setting buildDate with every build changes the generated BuildConfig, which slows down the
// build. Only do this for non-debug builds, to speed-up builds produced during local development.
if (isDebug) {
buildConfigField 'String', 'BUILD_DATE', '"debug build"'
} else {
buildConfigField 'String', 'BUILD_DATE', '"' + buildDate + '"'
}
2019-03-07 08:19:31 +01:00
// -------------------------------------------------------------------------------------------------
2019-03-07 08:19:31 +01:00
// Adjust: Read token from local file if it exists (Only release builds)
// -------------------------------------------------------------------------------------------------
print("Adjust token: ")
if (!isDebug) {
try {
def token = new File("${rootDir}/.adjust_token").text.trim()
buildConfigField 'String', 'ADJUST_TOKEN', '"' + token + '"'
println "(Added from .adjust_token file)"
} catch (FileNotFoundException ignored) {
buildConfigField 'String', 'ADJUST_TOKEN', 'null'
println("X_X")
}
} else {
buildConfigField 'String', 'ADJUST_TOKEN', 'null'
println("--")
}
2019-03-07 08:19:31 +01:00
// -------------------------------------------------------------------------------------------------
// Leanplum: Read token from local file if it exists
// -------------------------------------------------------------------------------------------------
print("Leanplum token: ")
try {
def parts = new File("${rootDir}/.leanplum_token").text.trim().split(":")
def id = parts[0]
def key = parts[1]
buildConfigField 'String', 'LEANPLUM_ID', '"' + id + '"'
buildConfigField 'String', 'LEANPLUM_TOKEN', '"' + key + '"'
println "(Added from .leanplum_token file)"
} catch (FileNotFoundException ignored) {
buildConfigField 'String', 'LEANPLUM_ID', 'null'
buildConfigField 'String', 'LEANPLUM_TOKEN', 'null'
println("X_X")
}
// -------------------------------------------------------------------------------------------------
// MLS: Read token from local file if it exists
// -------------------------------------------------------------------------------------------------
print("MLS token: ")
try {
def token = new File("${rootDir}/.mls_token").text.trim()
buildConfigField 'String', 'MLS_TOKEN', '"' + token + '"'
println "(Added from .mls_token file)"
} catch (FileNotFoundException ignored) {
buildConfigField 'String', 'MLS_TOKEN', '""'
println("X_X")
}
}
2019-01-28 17:46:39 +01:00
androidExtensions {
experimental = true
}
2020-02-27 20:35:49 +01:00
// Generate Kotlin code and markdown docs for the Fenix Glean metrics.
ext.gleanGenerateMarkdownDocs = true
ext.gleanDocsDirectory = "$rootDir/docs"
apply plugin: "org.mozilla.telemetry.glean-gradle-plugin"
dependencies {
debugImplementation Deps.mozilla_browser_engine_gecko_nightly
nightlyImplementation Deps.mozilla_browser_engine_gecko_nightly
betaImplementation Deps.mozilla_browser_engine_gecko_beta
releaseImplementation Deps.mozilla_browser_engine_gecko_release
Configure either geckoview beta or nightly at compile-time (#4851) * Remove "abi" product flavor and introduce "engine" product flavor. This patch will allow us to build Fenix against GeckoView Nightly and GeckoView Beta by introducing a new flavor dimension: engine = [geckoNightly, geckoBeta]. In addition to that it adds a "fenix" prefix to the nightly, beta and production flavors to reduce the ambiguity between fenix beta/nightly and GeckoView beta/nightly. For now the build types have the following engine variants enabled: **debug**: geckoNightly, geckoBeta Both variants enabled for local development and testing. **forPerformanceTest**: geckoNightly, geckoBeta Both variants enabled unless the perf team only cares about Nightly (tbd) **fenixNightlyLegacy**: geckoBeta Uses GeckoView Beta for now - the same version we ship production builds with (same behavior as before). This release type will eventualyl be decommissioned once we switch to a separate Nightly app on Google Play. **fenixNightly**: geckoBeta Uses GeckoView Beta for now - the same version we ship production builds with (same behavior as before). Changing this build to use GeckoView Nightly is currently being discussed. **fenixBeta**: geckoBeta Fenix Beta uses GeckoView Beta. **fenixProduction** Fenix Production uses GeckoView Beta (69) currently. * gradle.py/variant.py: Replace "abi" with "engine". * Disable enableUnitTestBinaryResources until we can switch to Android Gradle plugin 3.5. * Fenix nightly should use both geckoview nightly and beta * Updates automation to use apk splitting and support different engine
2019-08-21 17:32:01 +02:00
implementation Deps.kotlin_stdlib
implementation Deps.kotlin_coroutines
implementation Deps.kotlin_coroutines_android
testImplementation Deps.kotlin_coroutines_test
implementation Deps.androidx_appcompat
implementation Deps.androidx_constraintlayout
2019-06-05 21:33:42 +02:00
implementation Deps.androidx_coordinatorlayout
2019-01-28 17:46:39 +01:00
implementation Deps.sentry
2019-03-07 08:19:31 +01:00
implementation Deps.leanplum_core
implementation Deps.leanplum_fcm
implementation Deps.mozilla_concept_engine
2020-07-26 00:23:27 +02:00
implementation Deps.mozilla_concept_menu
implementation Deps.mozilla_concept_push
implementation Deps.mozilla_concept_storage
implementation Deps.mozilla_concept_sync
implementation Deps.mozilla_concept_toolbar
implementation Deps.mozilla_concept_tabstray
2019-01-10 01:07:33 +01:00
implementation Deps.mozilla_browser_awesomebar
implementation Deps.mozilla_feature_downloads
implementation Deps.mozilla_browser_domains
implementation Deps.mozilla_browser_icons
implementation Deps.mozilla_browser_menu
implementation Deps.mozilla_browser_menu2
implementation Deps.mozilla_browser_search
implementation Deps.mozilla_browser_session
2019-08-30 18:56:22 +02:00
implementation Deps.mozilla_browser_state
implementation Deps.mozilla_browser_storage_sync
2020-05-29 03:14:56 +02:00
implementation Deps.mozilla_browser_tabstray
implementation Deps.mozilla_browser_thumbnails
2019-01-10 01:07:33 +01:00
implementation Deps.mozilla_browser_toolbar
implementation Deps.mozilla_support_extensions
implementation Deps.mozilla_feature_addons
implementation Deps.mozilla_feature_accounts
2019-05-31 17:08:13 +02:00
implementation Deps.mozilla_feature_app_links
implementation Deps.mozilla_feature_awesomebar
implementation Deps.mozilla_feature_contextmenu
implementation Deps.mozilla_feature_customtabs
implementation Deps.mozilla_feature_downloads
implementation Deps.mozilla_feature_intent
implementation Deps.mozilla_feature_media
implementation Deps.mozilla_feature_prompts
implementation Deps.mozilla_feature_push
implementation Deps.mozilla_feature_privatemode
implementation Deps.mozilla_feature_pwa
2019-04-19 23:12:42 +02:00
implementation Deps.mozilla_feature_qr
implementation Deps.mozilla_feature_search
implementation Deps.mozilla_feature_session
implementation Deps.mozilla_feature_syncedtabs
implementation Deps.mozilla_feature_toolbar
implementation Deps.mozilla_feature_tabs
implementation Deps.mozilla_feature_findinpage
2020-07-02 04:37:03 +02:00
implementation Deps.mozilla_feature_logins
2019-02-28 22:10:52 +01:00
implementation Deps.mozilla_feature_site_permissions
implementation Deps.mozilla_feature_readerview
implementation Deps.mozilla_feature_tab_collections
implementation Deps.mozilla_feature_top_sites
implementation Deps.mozilla_feature_share
implementation Deps.mozilla_feature_accounts_push
2019-09-19 20:36:22 +02:00
implementation Deps.mozilla_feature_webcompat
implementation Deps.mozilla_feature_webnotifications
implementation Deps.mozilla_feature_webcompat_reporter
2020-06-24 18:55:22 +02:00
implementation Deps.mozilla_service_digitalassetlinks
2020-05-28 18:37:45 +02:00
implementation Deps.mozilla_service_experiments
2019-10-24 18:29:41 +02:00
implementation Deps.mozilla_service_sync_logins
implementation Deps.mozilla_service_firefox_accounts
implementation Deps.mozilla_service_glean
implementation Deps.mozilla_service_location
For #5574 - Migrate SessionControl to LibState (#6651) * For #5574 - Part 1: Port TabAction.SaveTabGroup to TabSessionInteractor and SessionControlController. (#6651) - Introduces the TabSessionInteractor, SessionControlInteractor and SessionControlController classes. - Removes the TabAction.SaveTabGroup. * For #5574 - Part 2: Port TabAction.PrivateBrowsingLearnMore to TabSessionInteractor and SessionControlController (#6651) * For #5574 - Part 3: Port TabAction.ShareTabs to TabSessionInteractor and SessionControlController (#6651) * For #5574 - Part 4: Remove unused TabAction.Share and TabItemMenu (#6651) In #2205, the tab overflow button was removed which would have shown the TabItemMenu when clicked. So, we can remove TabItemMenu since it is not used and as a result, we can also remove TabAction.Share since there are no consumers. * For #5574 - Part 5: Port TabAction.PlayMedia and TabAction.PauseMedia to TabSessionInteractor and SessionControlController (#6651) * For #5574 - Part 6: Port TabAction.Select to TabSessionInteractor and SessionControlController (#6651) * For #5574 - Part 7: Port Onboarding.Finish to OnboardingInteractor and SessionControlController (#6651) * For #5574 - Part 8: Port TabAction.Close and TabAction.CloseAll to TabSessionInteractor and SessionControlController (#6651) - Removes TabAction * For #5574 - Part 9: Port CollectionAction.Delete to CollectionInteractor and SessionControlController (#6651) * For #5574 - Part 10: Port CollectionAction.ShareTabs to CollectionInteractor and SessionControlController (#6651) * For #5574 - Part 11: Port CollectionAction.AddTab and CollectionAction.Rename to CollectionInteractor and SessionControlController (#6651) * For #5574 - Part 12: Port CollectionAction.RemoveTab to CollectionInteractor and SessionControlController (#6651) * For #5574 - Part 13: Port CollectionAction.OpenTab to CollectionInteractor and SessionControlController (#6651) * For #5574 - Part 14: Port CollectionAction.CloseTabs to CollectionInteractor and SessionControlController (#6651) * For #5574 - Part 15: Introduce a HomeFragmentStore (#6651) - We will hook up the HomeFragmentStore in later parts. - Removes List<Tab>.toSessionBundle(context: Context) since it is unused. * For #5574 - Part 16: Port CollectionAction.Collapse and CollectionAction.Expand to CollectionInteractor and SessionControlController (#6651) - We assume the store is hooked up to the SessionControlController in this part, but this work will be done in a later part. - Removes CollectionAction. * For #5574 - Part 20: Remove the architecture module. (#6651) * For #5574 - Part 17: Remove duplicate subscribeToTabCollections in BrowserFragment.kt (#6651) There is a duplicate call of subscribeToTabCollections() in both HomeFragment and BrowserFragment. In this patch, we remove the call in BrowserFragment to avoid passing the HomeFragmentStore to BrowserFragment in order to dispatch the CollectionsChange event. * For #5574 - Part 18: Delete SessionControlComponent and fix TabCollection and Tab imports (#6651) * For #5574 - Part 19: Use the new HomeFragmentStore in the HomeFragment (#6651) - Renames SessionControlUIView to SessionControlView * For #5574 - Part 21: Fix white screen on home fragment (#6651) * For #5574 - Part 22: Fix formatting in SessionControlInteractor and replace See with @see in SessionControlController (#6651) * For #5574 - Part 23: Move to metrics.track call to the beginning of handleCollectionRemoveTab (#6651) This ensures that the metrics.track will be called immediately before the tab is removed from the collection. * For #5574 - Part 24: Use the sessionManager getter in SessionControlController (#6651) * For #5574 - Part 25: Use mapNotNull in List<Tab>.toSessionBundle (#6651) * For #5574 - Part 26: Simplify closeTab and closeAllTabs functions by assigning a deletionJob constant (#6651) * For #5574 - Part 27: Replace listOf() with emptyList() in removeAllTabsWithUndo (#6651) * For #5574 - Part 28: Replace the Context parameter with the HomeActivity in SessionControlController (#6651) * For #5574 - Part 29: Add test for HomeFragmentStore, DefaultSessionControlController and SessionControlInteractor (#6651) * For #5574 - Removes running CI against the architecture debug build varient
2019-12-05 04:06:05 +01:00
implementation Deps.mozilla_support_base
implementation Deps.mozilla_support_images
implementation Deps.mozilla_support_ktx
implementation Deps.mozilla_support_rustlog
implementation Deps.mozilla_support_utils
implementation Deps.mozilla_support_locale
2020-01-15 06:59:08 +01:00
implementation Deps.mozilla_support_migration
implementation Deps.mozilla_ui_colors
implementation Deps.mozilla_ui_icons
implementation Deps.mozilla_lib_publicsuffixlist
implementation Deps.mozilla_ui_widgets
implementation Deps.mozilla_lib_crash
implementation Deps.mozilla_lib_push_firebase
implementation Deps.mozilla_lib_dataprotect
debugImplementation Deps.leakcanary
implementation Deps.androidx_legacy
implementation Deps.androidx_biometric
implementation Deps.androidx_paging
implementation Deps.androidx_preference
implementation Deps.androidx_fragment
2019-03-07 05:23:57 +01:00
implementation Deps.androidx_navigation_fragment
implementation Deps.androidx_navigation_ui
2019-04-07 04:06:27 +02:00
implementation Deps.androidx_recyclerview
2019-11-06 02:30:04 +01:00
implementation Deps.androidx_lifecycle_livedata
implementation Deps.androidx_lifecycle_runtime
implementation Deps.androidx_lifecycle_viewmodel
implementation Deps.androidx_core
implementation Deps.androidx_core_ktx
implementation Deps.androidx_transition
implementation Deps.androidx_work_ktx
implementation Deps.google_material
implementation Deps.google_flexbox
2019-09-10 22:29:21 +02:00
implementation Deps.lottie
implementation Deps.adjust
implementation Deps.installreferrer // Required by Adjust
implementation Deps.google_ads_id // Required for the Google Advertising ID
2019-04-10 18:59:38 +02:00
androidTestImplementation Deps.uiautomator
// Removed pending AndroidX fixes
androidTestImplementation "tools.fastlane:screengrab:2.0.0"
// androidTestImplementation "br.com.concretesolutions:kappuccino:1.2.1"
2019-04-10 18:59:38 +02:00
androidTestImplementation Deps.espresso_core, {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation(Deps.espresso_contrib) {
exclude module: 'appcompat-v7'
exclude module: 'support-v4'
exclude module: 'support-annotations'
exclude module: 'recyclerview-v7'
exclude module: 'design'
exclude module: 'espresso-core'
}
androidTestImplementation Deps.androidx_test_core
2019-04-10 18:59:38 +02:00
androidTestImplementation Deps.espresso_idling_resources
androidTestImplementation Deps.espresso_intents
androidTestImplementation Deps.tools_test_runner
2019-04-10 18:59:38 +02:00
androidTestImplementation Deps.tools_test_rules
androidTestUtil Deps.orchestrator
androidTestImplementation Deps.espresso_core, {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation Deps.androidx_junit
androidTestImplementation Deps.androidx_work_testing
2019-07-05 19:38:09 +02:00
androidTestImplementation Deps.mockwebserver
testImplementation Deps.mozilla_support_test
testImplementation Deps.androidx_junit
testImplementation Deps.androidx_work_testing
testImplementation (Deps.robolectric) {
exclude group: 'org.apache.maven'
}
testImplementation 'org.apache.maven:maven-ant-tasks:2.1.3'
2019-07-18 00:09:47 +02:00
implementation Deps.mozilla_support_rusthttp
testImplementation Deps.mockk
// For the initial release of Glean 19, we require consumer applications to
// depend on a separate library for unit tests. This will be removed in future releases.
2020-02-27 20:35:49 +01:00
testImplementation "org.mozilla.telemetry:glean-forUnitTests:${project.ext.glean_version}"
2020-03-03 19:44:54 +01:00
lintChecks project(":mozilla-lint-rules")
}
2019-08-09 02:09:54 +02:00
if (project.hasProperty("coverage")) {
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}
android.applicationVariants.all { variant ->
2020-08-05 18:17:30 +02:00
tasks.register("jacoco${variant.name.capitalize()}TestReport", JacocoReport) {
dependsOn "test${variant.name.capitalize()}UnitTest"
2019-08-09 02:09:54 +02:00
reports {
xml.enabled = true
html.enabled = true
}
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*',
'**/*Test*.*', 'android/**/*.*', '**/*$[0-9].*']
def kotlinDebugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/${variant.name}", excludes: fileFilter)
def javaDebugTree = fileTree(dir: "$project.buildDir/intermediates/classes/${variant.flavorName}/${variant.buildType.name}",
excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/java"
2020-08-05 18:17:30 +02:00
sourceDirectories.setFrom(files([mainSrc]))
classDirectories.setFrom(files([kotlinDebugTree, javaDebugTree]))
executionData.setFrom(fileTree(dir: project.buildDir, includes: [
"jacoco/test${variant.name.capitalize()}UnitTest.exec",
'outputs/code-coverage/connected/*coverage.ec'
]))
2019-08-09 02:09:54 +02:00
}
}
android {
buildTypes {
debug {
testCoverageEnabled true
}
}
}
}
2019-03-27 15:23:03 +01:00
// -------------------------------------------------------------------------------------------------
Configure either geckoview beta or nightly at compile-time (#4851) * Remove "abi" product flavor and introduce "engine" product flavor. This patch will allow us to build Fenix against GeckoView Nightly and GeckoView Beta by introducing a new flavor dimension: engine = [geckoNightly, geckoBeta]. In addition to that it adds a "fenix" prefix to the nightly, beta and production flavors to reduce the ambiguity between fenix beta/nightly and GeckoView beta/nightly. For now the build types have the following engine variants enabled: **debug**: geckoNightly, geckoBeta Both variants enabled for local development and testing. **forPerformanceTest**: geckoNightly, geckoBeta Both variants enabled unless the perf team only cares about Nightly (tbd) **fenixNightlyLegacy**: geckoBeta Uses GeckoView Beta for now - the same version we ship production builds with (same behavior as before). This release type will eventualyl be decommissioned once we switch to a separate Nightly app on Google Play. **fenixNightly**: geckoBeta Uses GeckoView Beta for now - the same version we ship production builds with (same behavior as before). Changing this build to use GeckoView Nightly is currently being discussed. **fenixBeta**: geckoBeta Fenix Beta uses GeckoView Beta. **fenixProduction** Fenix Production uses GeckoView Beta (69) currently. * gradle.py/variant.py: Replace "abi" with "engine". * Disable enableUnitTestBinaryResources until we can switch to Android Gradle plugin 3.5. * Fenix nightly should use both geckoview nightly and beta * Updates automation to use apk splitting and support different engine
2019-08-21 17:32:01 +02:00
// Task for printing APK information for the requested variant
2019-09-24 16:18:45 +02:00
// Usage: "./gradlew printVariants
2019-03-27 15:23:03 +01:00
// -------------------------------------------------------------------------------------------------
2019-09-24 16:18:45 +02:00
task printVariants {
2019-03-27 15:23:03 +01:00
doLast {
2019-09-24 16:18:45 +02:00
def variants = android.applicationVariants.collect {[
Adds custom search engines (#6551) * For #5577 - Adds button to add a new search engine * For #5577 - Adds custom engine store * For #5577 - Creates a custom SearchEngineProvider * For #5577 - Gives the ability to delete search engines * For #5577 - Adds the UI to add a custom search engine * For #5577 - Adds form to create a custom search engine * For #5577 - Adds the ability to add a custom search engine * For #5577 - Adds the ability to delete custom search engines * For #5577 - Selects the first element on the add custom search engine screen * For #5577 - Prevents adding a search engine that already exists * For #5577 - Styles the add search engine preference * For #5577 - Makes the name check case-insensitive * For #5577 - Fix bug where home screen doesnt see new search engines * For #5577 - Moves Search URL validation to its own type * For #5577 - Fixes linting errors * For #5577 - Adds the ability to edit a custom search engine * For #5577 - Allows the user to edit a serach engine even when it is the last item in the list * For #5577 - Adds an undo snackbar when deleting a search engine * For #5577 - Moves all of the strings to be translated * For #5577 - Fixes bug when deleting your default search engine * For #5577 - Puts adding search engines behind a feature flag * For #5577 - Navigate to custom search engine SUMO article when tapping learn more * For #5577 - Fixes nits * For #5577 - Uses concept-fetch to validate search string * For #5577 - Adds string resources for the cannot reach error state
2019-11-20 01:30:56 +01:00
apks: it.variantData.outputScope.apkDatas.collect {[
abi: it.filters.find { it.filterType == 'ABI' }.identifier,
fileName: it.outputFileName,
]},
build_type: it.buildType.name,
name: it.name,
2019-09-24 16:18:45 +02:00
]}
2019-11-07 17:38:17 +01:00
// AndroidTest is a special case not included above
variants.add([
apks: [[
abi: 'noarch',
fileName: 'app-debug-androidTest.apk',
2019-11-07 17:38:17 +01:00
]],
build_type: 'androidTest',
name: 'androidTest',
])
2019-09-24 16:18:45 +02:00
println 'variants: ' + groovy.json.JsonOutput.toJson(variants)
2019-03-27 15:23:03 +01:00
}
}
task buildTranslationArray {
def foundLocales = new StringBuilder()
foundLocales.append("new String[]{")
fileTree("src/main/res").visit { FileVisitDetails details ->
if(details.file.path.endsWith("/strings.xml")){
def languageCode = details.file.parent.tokenize('/').last().replaceAll('values-','').replaceAll('-r','-')
languageCode = (languageCode == "values") ? "en-US" : languageCode
foundLocales.append("\"").append(languageCode).append("\"").append(",")
}
}
foundLocales.append("}")
def foundLocalesString = foundLocales.toString().replaceAll(',}','}')
android.defaultConfig.buildConfigField "String[]", "SUPPORTED_LOCALE_ARRAY", foundLocalesString
}
task lintUnitTestRunner(type: LintUnitTestRunner)
afterEvaluate {
// Format test output. Ported from AC #2401
tasks.matching {it instanceof Test}.all {
systemProperty "robolectric.logging", "stdout"
systemProperty "logging.test-mode", "true"
testLogging.events = []
def out = services.get(StyledTextOutputFactory).create("tests")
beforeSuite { descriptor ->
if (descriptor.getClassName() != null) {
out.style(Style.Header).println("\nSUITE: " + descriptor.getClassName())
}
}
beforeTest { descriptor ->
out.style(Style.Description).println(" TEST: " + descriptor.getName())
}
onOutput { descriptor, event ->
logger.lifecycle(" " + event.message.trim())
}
afterTest { descriptor, result ->
switch (result.getResultType()) {
case ResultType.SUCCESS:
out.style(Style.Success).println(" SUCCESS")
break
case ResultType.FAILURE:
out.style(Style.Failure).println(" FAILURE")
logger.lifecycle("", result.getException())
break
case ResultType.SKIPPED:
out.style(Style.Info).println(" SKIPPED")
break
}
logger.lifecycle("")
}
}
}
if (gradle.hasProperty('localProperties.dependencySubstitutions.geckoviewTopsrcdir')) {
if (gradle.hasProperty('localProperties.dependencySubstitutions.geckoviewTopobjdir')) {
ext.topobjdir = gradle."localProperties.dependencySubstitutions.geckoviewTopobjdir"
}
ext.topsrcdir = gradle."localProperties.dependencySubstitutions.geckoviewTopsrcdir"
apply from: "${topsrcdir}/substitute-local-geckoview.gradle"
}
if (gradle.hasProperty('localProperties.autoPublish.android-components.dir')) {
ext.acSrcDir = gradle."localProperties.autoPublish.android-components.dir"
apply from: "../${acSrcDir}/substitute-local-ac.gradle"
}
if (gradle.hasProperty('localProperties.autoPublish.application-services.dir')) {
ext.appServicesSrcDir = gradle."localProperties.autoPublish.application-services.dir"
apply from: "../${appServicesSrcDir}/build-scripts/substitute-local-appservices.gradle"
}
// Define a reusable task for updating the versions of our built-in web extensions. We automate this
// to make sure we never forget to update the version, either in local development or for releases.
// In both cases, we want to make sure the latest version of all extensions (including their latest
// changes) are installed on first start-up.
// We're using the A-C version here as we want to uplift all built-in extensions to A-C (Once that's
// done we can also remove the task below):
// https://github.com/mozilla-mobile/android-components/issues/7249
ext.updateExtensionVersion = { task, extDir ->
configure(task) {
from extDir
include 'manifest.template.json'
rename { 'manifest.json' }
into extDir
def values = ['version': AndroidComponents.VERSION + "." + new Date().format('MMddHHmmss')]
inputs.properties(values)
expand(values)
}
}
tasks.register("updateAdsExtensionVersion", Copy) { task ->
updateExtensionVersion(task, 'src/main/assets/extensions/ads')
}
tasks.register("updateCookiesExtensionVersion", Copy) { task ->
updateExtensionVersion(task, 'src/main/assets/extensions/cookies')
}
preBuild.dependsOn updateAdsExtensionVersion
preBuild.dependsOn updateCookiesExtensionVersion