2019-01-31 16:27:36 +00:00
|
|
|
plugins {
|
|
|
|
id "com.jetbrains.python.envs" version "0.0.26"
|
|
|
|
}
|
|
|
|
|
2018-12-07 20:11:50 +00:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
apply plugin: 'kotlin-android'
|
|
|
|
apply plugin: 'kotlin-android-extensions'
|
2019-01-07 20:23:30 +00:00
|
|
|
apply from: "$project.rootDir/automation/gradle/versionCode.gradle"
|
2019-03-15 03:47:48 +00:00
|
|
|
apply plugin: 'androidx.navigation.safeargs.kotlin'
|
2018-12-07 20:11:50 +00:00
|
|
|
|
2019-05-06 17:09:29 +00:00
|
|
|
import com.android.build.gradle.internal.tasks.AppPreBuildTask
|
|
|
|
|
2018-12-07 20:11:50 +00:00
|
|
|
android {
|
|
|
|
compileSdkVersion 28
|
|
|
|
defaultConfig {
|
|
|
|
applicationId "org.mozilla.fenix"
|
2019-02-12 19:13:09 +00:00
|
|
|
minSdkVersion Config.minSdkVersion
|
|
|
|
targetSdkVersion Config.targetSdkVersion
|
2019-05-06 17:09:29 +00:00
|
|
|
versionCode 1
|
|
|
|
versionName Config.generateDebugVersionName()
|
2019-06-18 23:38:56 +00:00
|
|
|
vectorDrawables.useSupportLibrary = true
|
2019-04-10 16:59:38 +00:00
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
testInstrumentationRunnerArguments clearPackageData: 'true'
|
2019-02-25 23:32:17 +00:00
|
|
|
manifestPlaceholders.isRaptorEnabled = "false"
|
2019-06-03 14:32:38 +00:00
|
|
|
resValue "bool", "IS_DEBUG", "false"
|
|
|
|
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "false"
|
2019-04-22 18:02:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
def releaseTemplate = {
|
|
|
|
shrinkResources true
|
|
|
|
minifyEnabled true
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
|
|
matchingFallbacks = ['release'] // Use on the "release" build type in dependencies (AARs)
|
2018-12-07 20:11:50 +00:00
|
|
|
}
|
2019-03-28 15:30:55 +00:00
|
|
|
|
2018-12-07 20:11:50 +00:00
|
|
|
buildTypes {
|
2019-01-28 17:00:21 +00:00
|
|
|
debug {
|
2019-02-11 01:30:37 +00:00
|
|
|
shrinkResources false
|
|
|
|
minifyEnabled false
|
2019-01-28 17:00:21 +00:00
|
|
|
applicationIdSuffix ".debug"
|
2019-02-25 23:32:17 +00:00
|
|
|
manifestPlaceholders.isRaptorEnabled = "true"
|
2019-06-03 14:32:38 +00:00
|
|
|
resValue "bool", "IS_DEBUG", "true"
|
2019-06-14 18:44:36 +00:00
|
|
|
pseudoLocalesEnabled true
|
2019-01-28 17:00:21 +00:00
|
|
|
}
|
2019-06-03 14:32:38 +00:00
|
|
|
forPerformanceTest releaseTemplate >> { // the ">>" concatenates the raptor-specific options with the template
|
2019-04-22 18:02:39 +00:00
|
|
|
manifestPlaceholders.isRaptorEnabled = "true"
|
2019-06-03 14:32:38 +00:00
|
|
|
applicationIdSuffix ".performancetest"
|
|
|
|
debuggable true
|
2019-04-22 18:02:39 +00:00
|
|
|
}
|
2019-07-02 18:34:04 +00:00
|
|
|
nightlyLegacy releaseTemplate >> {
|
|
|
|
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
|
|
|
|
}
|
2019-04-22 18:02:39 +00:00
|
|
|
nightly releaseTemplate >> {
|
2019-06-28 23:56:55 +00:00
|
|
|
applicationIdSuffix ".nightly"
|
2019-06-03 14:32:38 +00:00
|
|
|
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
|
2019-04-22 18:02:39 +00:00
|
|
|
}
|
|
|
|
beta releaseTemplate >> {
|
2019-05-06 17:09:29 +00:00
|
|
|
applicationIdSuffix ".beta"
|
2019-06-03 14:32:38 +00:00
|
|
|
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
|
2019-04-22 18:02:39 +00:00
|
|
|
}
|
2019-06-05 15:48:10 +00:00
|
|
|
production releaseTemplate >> {
|
|
|
|
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
|
|
|
|
}
|
2019-04-22 18:02:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
variantFilter { // There's a "release" build type that exists by default that we don't use (it's replaced by "nightly" and "beta")
|
|
|
|
if (buildType.name == 'release') {
|
|
|
|
setIgnore true
|
|
|
|
}
|
2018-12-07 20:11:50 +00:00
|
|
|
}
|
2019-01-07 20:23:30 +00:00
|
|
|
|
2019-04-10 16:59:38 +00:00
|
|
|
testOptions {
|
|
|
|
execution 'ANDROIDX_TEST_ORCHESTRATOR'
|
2019-05-07 21:36:37 +00:00
|
|
|
unitTests.includeAndroidResources = true
|
2019-04-10 16:59:38 +00:00
|
|
|
}
|
|
|
|
|
2019-04-22 18:02:39 +00:00
|
|
|
flavorDimensions "abi"
|
2019-02-13 12:48:11 +00:00
|
|
|
|
2019-01-07 20:23:30 +00:00
|
|
|
productFlavors {
|
2019-01-30 00:26:03 +00:00
|
|
|
arm {
|
|
|
|
dimension "abi"
|
|
|
|
ndk {
|
|
|
|
abiFilter "armeabi-v7a"
|
|
|
|
}
|
|
|
|
}
|
2019-05-29 13:19:17 +00:00
|
|
|
aarch64 {
|
|
|
|
dimension "abi"
|
|
|
|
ndk {
|
|
|
|
abiFilter "arm64-v8a"
|
|
|
|
}
|
|
|
|
}
|
2019-01-30 00:26:03 +00:00
|
|
|
x86 {
|
|
|
|
dimension "abi"
|
|
|
|
ndk {
|
|
|
|
abiFilter "x86"
|
|
|
|
}
|
|
|
|
}
|
2019-05-29 13:19:17 +00:00
|
|
|
x86_64 {
|
2019-02-13 12:48:11 +00:00
|
|
|
dimension "abi"
|
|
|
|
ndk {
|
2019-05-29 13:19:17 +00:00
|
|
|
abiFilter "x86_64"
|
2019-02-13 12:48:11 +00:00
|
|
|
}
|
|
|
|
}
|
2019-04-02 16:24:43 +00:00
|
|
|
}
|
|
|
|
|
2019-01-07 21:47:47 +00:00
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
2019-01-29 16:42:10 +00:00
|
|
|
|
|
|
|
lintOptions {
|
|
|
|
lintConfig file("lint.xml")
|
|
|
|
}
|
2019-04-11 17:34:27 +00:00
|
|
|
|
|
|
|
packagingOptions {
|
|
|
|
exclude 'META-INF/atomicfu.kotlin_module'
|
|
|
|
}
|
2019-01-07 20:23:30 +00:00
|
|
|
}
|
|
|
|
|
2019-02-20 02:10:17 +00:00
|
|
|
android.applicationVariants.all { variant ->
|
2019-02-28 17:12:47 +00:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------------
|
|
|
|
// Set up kotlin-allopen plugin for writing tests
|
|
|
|
// -------------------------------------------------------------------------------------------------
|
|
|
|
|
2019-03-27 02:54:28 +00:00
|
|
|
boolean hasTest = gradle.startParameter.taskNames.find { it.contains("test") || it.contains("Test") } != null
|
2019-02-20 02:10:17 +00:00
|
|
|
if (hasTest) {
|
|
|
|
apply plugin: 'kotlin-allopen'
|
|
|
|
allOpen {
|
2019-05-07 21:36:37 +00:00
|
|
|
annotation("org.mozilla.fenix.test.OpenClass")
|
2019-02-20 02:10:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-28 17:12:47 +00:00
|
|
|
// -------------------------------------------------------------------------------------------------
|
|
|
|
// Generate version codes for builds
|
|
|
|
// -------------------------------------------------------------------------------------------------
|
|
|
|
|
2019-01-07 20:23:30 +00:00
|
|
|
def buildType = variant.buildType.name
|
2019-04-22 18:02:39 +00:00
|
|
|
def versionCode = null
|
2019-06-03 14:32:38 +00:00
|
|
|
def isDebug = variant.buildType.resValues['IS_DEBUG']?.value ?: false
|
|
|
|
def useReleaseVersioning = variant.buildType.buildConfigFields['USE_RELEASE_VERSIONING']?.value ?: false
|
2019-01-07 20:23:30 +00:00
|
|
|
|
2019-06-03 14:32:38 +00:00
|
|
|
if (useReleaseVersioning) {
|
2019-04-22 18:02:39 +00:00
|
|
|
versionCode = generatedVersionCode
|
2019-01-07 20:23:30 +00:00
|
|
|
|
|
|
|
// 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.
|
|
|
|
|
2019-01-11 00:01:05 +00:00
|
|
|
// Our generated version code now has a length of 9 (See automation/gradle/versionCode.gradle).
|
2019-01-07 20:23:30 +00:00
|
|
|
// Our x86 builds need a higher version code to avoid installing ARM builds on an x86 device
|
|
|
|
// with ARM compatibility mode.
|
|
|
|
|
2019-05-29 13:19:17 +00:00
|
|
|
if (variant.flavorName.contains("x86_64")) {
|
|
|
|
versionCode = versionCode + 3
|
|
|
|
} else if (variant.flavorName.contains("x86")) {
|
2019-02-14 14:17:25 +00:00
|
|
|
versionCode = versionCode + 2
|
|
|
|
} else if (variant.flavorName.contains("aarch64")) {
|
2019-01-07 20:23:30 +00:00
|
|
|
versionCode = versionCode + 1
|
|
|
|
}// else variant.flavorName.contains("Arm")) use generated version code
|
|
|
|
|
2019-04-22 18:02:39 +00:00
|
|
|
variant.outputs.all {
|
2019-05-06 17:09:29 +00:00
|
|
|
versionCodeOverride = versionCode
|
|
|
|
versionNameOverride = Config.releaseVersionName(project)
|
|
|
|
}
|
|
|
|
|
|
|
|
// If this is a release build, validate that "versionName" is set
|
|
|
|
tasks.withType(AppPreBuildTask) { prebuildTask ->
|
|
|
|
// You can't add a closure to a variant, so we need to look for an early variant-specific type
|
|
|
|
// of task (AppPreBuildTask is the first) and filter to make sure we're looking at the task for
|
|
|
|
// this variant that we're currently configuring
|
|
|
|
if (prebuildTask.variantName != variant.name) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// Append to the task so the first thing it does is run our validation
|
|
|
|
prebuildTask.doFirst {
|
|
|
|
if (!project.hasProperty('versionName')) {
|
2019-06-05 18:46:03 +00:00
|
|
|
throw new RuntimeException("Release builds require the 'versionName' property to be set.\n" +
|
|
|
|
"If you're using an IDE, set your build variant to be a \"debug\" type.\n" +
|
|
|
|
"If you're using the command-line, either build a debug variant instead ('./gradlew assembleDebug')\n" +
|
|
|
|
"\tor continue building the release build and set the \"versionName\" property ('./gradlew -PversionName=<...> assembleNightly').")
|
|
|
|
// TODO when Android Studio 3.5.0 is prevalent, we can set the "debug" build type as the default
|
|
|
|
// https://issuetracker.google.com/issues/36988145#comment59
|
2019-05-06 17:09:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-01-07 20:23:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
println("----------------------------------------------")
|
2019-06-03 14:32:38 +00:00
|
|
|
println("Variant name: " + variant.name)
|
|
|
|
println("Build type: " + variant.buildType.name)
|
|
|
|
println("Flavor: " + variant.flavorName)
|
|
|
|
println("Version code: " + (versionCode ?: variant.mergedFlavor.versionCode))
|
|
|
|
println("Telemetry enabled: " + !isDebug)
|
2019-02-28 17:12:47 +00:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------------
|
|
|
|
// BuildConfig: Set variables for Sentry, Crash Reporting, and Telemetry
|
|
|
|
// -------------------------------------------------------------------------------------------------
|
|
|
|
|
2019-06-03 14:32:38 +00:00
|
|
|
buildConfigField 'String', 'SENTRY_TOKEN', 'null'
|
|
|
|
if (!isDebug) {
|
2019-02-28 17:12:47 +00:00
|
|
|
buildConfigField 'boolean', 'CRASH_REPORTING', 'true'
|
2019-06-03 14:32:38 +00:00
|
|
|
// 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) {}
|
2019-02-28 17:12:47 +00:00
|
|
|
} else {
|
|
|
|
buildConfigField 'boolean', 'CRASH_REPORTING', 'false'
|
|
|
|
}
|
|
|
|
|
2019-06-03 14:32:38 +00:00
|
|
|
if (!isDebug) {
|
2019-02-28 17:12:47 +00:00
|
|
|
buildConfigField 'boolean', 'TELEMETRY', 'true'
|
|
|
|
} else {
|
|
|
|
buildConfigField 'boolean', 'TELEMETRY', 'false'
|
|
|
|
}
|
|
|
|
|
|
|
|
def buildDate = Config.generateBuildDate()
|
|
|
|
buildConfigField 'String', 'BUILD_DATE', '"' + buildDate + '"'
|
|
|
|
|
2019-03-07 07:19:31 +00:00
|
|
|
def variantName = variant.getName()
|
|
|
|
|
2019-02-28 17:12:47 +00:00
|
|
|
// -------------------------------------------------------------------------------------------------
|
2019-03-07 07:19:31 +00:00
|
|
|
// Adjust: Read token from local file if it exists (Only release builds)
|
2019-02-28 17:12:47 +00:00
|
|
|
// -------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
print("Adjust token: ")
|
|
|
|
|
2019-06-03 14:32:38 +00:00
|
|
|
if (!isDebug) {
|
2019-02-28 17:12:47 +00:00
|
|
|
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 07:19:31 +00: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")
|
|
|
|
}
|
2019-05-23 17:48:22 +00:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------------
|
|
|
|
// Feature build flags
|
|
|
|
// -------------------------------------------------------------------------------------------------
|
2019-06-18 23:37:51 +00:00
|
|
|
// NB: flipping SEND_TAB_ENABLED flag back and worth is currently not well supported and may need hand-holding.
|
|
|
|
// Consult with the android-components peers before changing.
|
|
|
|
buildConfigField 'Boolean', 'SEND_TAB_ENABLED', (buildType == "nightly" || isDebug).toString()
|
2019-06-03 19:10:53 +00:00
|
|
|
buildConfigField 'Boolean', 'PULL_TO_REFRESH_ENABLED', (false).toString()
|
2018-12-07 20:11:50 +00:00
|
|
|
}
|
|
|
|
|
2019-01-28 16:46:39 +00:00
|
|
|
androidExtensions {
|
|
|
|
experimental = true
|
|
|
|
}
|
|
|
|
|
2018-12-07 20:11:50 +00:00
|
|
|
dependencies {
|
2019-02-01 14:26:58 +00:00
|
|
|
implementation project(':architecture')
|
|
|
|
|
2019-01-07 20:23:30 +00:00
|
|
|
implementation Deps.kotlin_stdlib
|
2019-04-11 17:34:27 +00:00
|
|
|
implementation Deps.kotlin_coroutines
|
2019-01-07 20:23:30 +00:00
|
|
|
implementation Deps.androidx_appcompat
|
|
|
|
implementation Deps.androidx_constraintlayout
|
2019-06-05 19:33:42 +00:00
|
|
|
implementation Deps.androidx_coordinatorlayout
|
2019-01-28 16:46:39 +00:00
|
|
|
|
|
|
|
implementation Deps.rxAndroid
|
|
|
|
implementation Deps.rxKotlin
|
2019-04-04 20:40:39 +00:00
|
|
|
implementation Deps.rxBindings
|
|
|
|
implementation Deps.autodispose
|
|
|
|
implementation Deps.autodispose_android
|
|
|
|
implementation Deps.autodispose_android_aac
|
|
|
|
|
2019-01-28 16:46:39 +00:00
|
|
|
implementation Deps.anko_commons
|
|
|
|
implementation Deps.anko_sdk
|
|
|
|
implementation Deps.anko_constraintlayout
|
2019-01-10 00:07:33 +00:00
|
|
|
|
2019-01-29 16:42:10 +00:00
|
|
|
implementation Deps.sentry
|
|
|
|
|
2019-03-07 07:19:31 +00:00
|
|
|
implementation Deps.leanplum
|
|
|
|
|
2019-01-18 23:33:40 +00:00
|
|
|
implementation Deps.mozilla_concept_engine
|
|
|
|
implementation Deps.mozilla_concept_storage
|
2019-01-23 22:48:15 +00:00
|
|
|
implementation Deps.mozilla_concept_toolbar
|
2019-03-13 18:23:00 +00:00
|
|
|
implementation Deps.mozilla_concept_sync
|
2019-01-18 23:33:40 +00:00
|
|
|
|
2019-01-10 00:07:33 +00:00
|
|
|
implementation Deps.mozilla_browser_awesomebar
|
2019-01-29 19:20:29 +00:00
|
|
|
implementation Deps.mozilla_feature_downloads
|
2019-01-23 21:39:53 +00:00
|
|
|
implementation Deps.mozilla_browser_domains
|
2019-02-28 20:46:39 +00:00
|
|
|
implementation Deps.mozilla_browser_icons
|
2019-05-22 15:28:20 +00:00
|
|
|
implementation Deps.mozilla_browser_engine_gecko_beta
|
2019-01-18 23:33:40 +00:00
|
|
|
implementation Deps.mozilla_browser_session
|
2019-01-29 20:04:57 +00:00
|
|
|
implementation Deps.mozilla_browser_storage_sync
|
2019-01-10 00:07:33 +00:00
|
|
|
implementation Deps.mozilla_browser_toolbar
|
|
|
|
|
2019-02-15 22:44:43 +00:00
|
|
|
implementation Deps.mozilla_feature_accounts
|
2019-05-31 15:08:13 +00:00
|
|
|
implementation Deps.mozilla_feature_app_links
|
2019-01-24 20:10:16 +00:00
|
|
|
implementation Deps.mozilla_feature_awesomebar
|
2019-01-30 20:47:27 +00:00
|
|
|
implementation Deps.mozilla_feature_contextmenu
|
2019-01-31 17:58:52 +00:00
|
|
|
implementation Deps.mozilla_feature_customtabs
|
2019-01-28 21:26:28 +00:00
|
|
|
implementation Deps.mozilla_feature_downloads
|
2019-01-18 23:33:40 +00:00
|
|
|
implementation Deps.mozilla_feature_intent
|
2019-06-05 13:02:47 +00:00
|
|
|
implementation Deps.mozilla_feature_media
|
2019-01-30 19:41:01 +00:00
|
|
|
implementation Deps.mozilla_feature_prompts
|
2019-04-19 21:12:42 +00:00
|
|
|
implementation Deps.mozilla_feature_qr
|
2019-01-18 23:33:40 +00:00
|
|
|
implementation Deps.mozilla_feature_session
|
2019-03-13 18:23:00 +00:00
|
|
|
implementation Deps.mozilla_feature_sync
|
2019-01-23 21:39:53 +00:00
|
|
|
implementation Deps.mozilla_feature_toolbar
|
2019-01-23 22:48:15 +00:00
|
|
|
implementation Deps.mozilla_feature_tabs
|
2019-02-13 13:19:20 +00:00
|
|
|
implementation Deps.mozilla_feature_findinpage
|
2019-02-28 21:10:52 +00:00
|
|
|
implementation Deps.mozilla_feature_site_permissions
|
2019-05-03 21:01:45 +00:00
|
|
|
implementation Deps.mozilla_feature_readerview
|
2019-05-16 21:02:24 +00:00
|
|
|
implementation Deps.mozilla_feature_tab_collections
|
2019-02-13 13:19:20 +00:00
|
|
|
|
2019-02-15 22:44:43 +00:00
|
|
|
implementation Deps.mozilla_service_firefox_accounts
|
2019-01-29 19:20:29 +00:00
|
|
|
implementation Deps.mozilla_service_fretboard
|
2019-01-31 16:27:36 +00:00
|
|
|
implementation Deps.mozilla_service_glean
|
2019-02-13 13:19:20 +00:00
|
|
|
|
2019-01-23 16:13:05 +00:00
|
|
|
implementation Deps.mozilla_support_ktx
|
2019-02-15 21:19:14 +00:00
|
|
|
implementation Deps.mozilla_support_rustlog
|
2019-01-23 16:13:05 +00:00
|
|
|
|
2019-02-05 21:52:04 +00:00
|
|
|
implementation Deps.mozilla_ui_colors
|
|
|
|
implementation Deps.mozilla_ui_icons
|
|
|
|
|
2019-01-29 16:42:10 +00:00
|
|
|
implementation Deps.mozilla_lib_crash
|
2019-02-13 15:08:35 +00:00
|
|
|
debugImplementation Deps.leakcanary
|
|
|
|
releaseImplementation Deps.leakcanary_noop
|
2019-01-29 16:42:10 +00:00
|
|
|
|
2019-04-02 21:41:34 +00:00
|
|
|
implementation Deps.mozilla_lib_fetch_httpurlconnection
|
|
|
|
|
2019-05-22 15:28:20 +00:00
|
|
|
armImplementation Gecko.geckoview_beta_arm
|
|
|
|
aarch64Implementation Gecko.geckoview_beta_aarch64
|
2019-05-29 13:19:17 +00:00
|
|
|
x86Implementation Gecko.geckoview_beta_x86
|
|
|
|
x86_64Implementation Gecko.geckoview_beta_x86_64
|
2019-02-13 12:48:11 +00:00
|
|
|
|
2019-01-15 01:42:58 +00:00
|
|
|
implementation Deps.androidx_legacy
|
2019-01-30 20:02:11 +00:00
|
|
|
implementation Deps.androidx_preference
|
2019-02-07 23:37:52 +00:00
|
|
|
implementation Deps.androidx_fragment
|
2019-03-07 04:23:57 +00:00
|
|
|
implementation Deps.androidx_navigation_fragment
|
|
|
|
implementation Deps.androidx_navigation_ui
|
2019-04-07 02:06:27 +00:00
|
|
|
implementation Deps.androidx_recyclerview
|
2019-06-13 00:14:46 +00:00
|
|
|
implementation Deps.androidx_lifecycle_runtime
|
|
|
|
implementation Deps.androidx_lifecycle_viewmodel
|
2019-05-09 23:06:12 +00:00
|
|
|
implementation Deps.androidx_lifecycle_viewmodel_ss
|
2019-05-09 21:19:44 +00:00
|
|
|
implementation Deps.androidx_core
|
2019-06-10 12:50:37 +00:00
|
|
|
implementation Deps.androidx_core_ktx
|
2019-05-09 21:19:44 +00:00
|
|
|
implementation Deps.androidx_transition
|
2019-05-24 21:03:59 +00:00
|
|
|
implementation Deps.google_material
|
2019-02-17 01:04:32 +00:00
|
|
|
|
|
|
|
implementation Deps.autodispose
|
2019-02-20 02:10:17 +00:00
|
|
|
|
2019-02-28 17:12:47 +00:00
|
|
|
implementation Deps.adjust
|
|
|
|
implementation Deps.installreferrer // Required by Adjust
|
|
|
|
|
2019-05-03 14:40:22 +00:00
|
|
|
implementation Deps.google_ads_id // Required for the Google Advertising ID
|
|
|
|
|
2019-04-10 16:59:38 +00:00
|
|
|
// androidTestImplementation Deps.tools_test_runner
|
|
|
|
// androidTestImplementation Deps.tools_espresso_core
|
|
|
|
|
|
|
|
androidTestImplementation Deps.uiautomator
|
|
|
|
|
|
|
|
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.espresso_idling_resources
|
2019-04-20 21:15:18 +00:00
|
|
|
|
2019-02-20 02:10:17 +00:00
|
|
|
androidTestImplementation Deps.tools_test_runner
|
2019-04-10 16:59:38 +00:00
|
|
|
androidTestImplementation Deps.tools_test_rules
|
|
|
|
androidTestUtil Deps.orchestrator
|
|
|
|
androidTestImplementation Deps.espresso_core, {
|
|
|
|
exclude group: 'com.android.support', module: 'support-annotations'
|
|
|
|
}
|
2019-02-20 02:10:17 +00:00
|
|
|
|
2019-06-08 19:12:44 +00:00
|
|
|
testImplementation Deps.mozilla_support_test
|
|
|
|
testImplementation Deps.androidx_junit
|
2019-05-07 21:36:37 +00:00
|
|
|
testImplementation Deps.robolectric
|
2019-05-08 15:27:24 +00:00
|
|
|
implementation Deps.fragment_testing
|
2019-05-07 21:36:37 +00:00
|
|
|
testImplementation Deps.places_forUnitTests
|
2019-02-20 02:10:17 +00:00
|
|
|
|
|
|
|
testImplementation Deps.mockito_core
|
|
|
|
androidTestImplementation Deps.mockito_android
|
|
|
|
testImplementation Deps.mockk
|
2019-02-21 17:38:00 +00:00
|
|
|
|
|
|
|
implementation Deps.glide
|
|
|
|
annotationProcessor Deps.glideAnnotationProcessor
|
2019-03-22 21:19:10 +00:00
|
|
|
|
|
|
|
debugImplementation Deps.flipper
|
|
|
|
debugImplementation Deps.soLoader
|
2019-05-29 16:17:56 +00:00
|
|
|
releaseImplementation Deps.flipper_noop
|
2018-12-07 20:11:50 +00:00
|
|
|
}
|
2019-01-29 16:42:10 +00:00
|
|
|
|
2019-03-27 14:23:03 +00:00
|
|
|
// -------------------------------------------------------------------------------------------------
|
|
|
|
// Task for printing all build variants to build variants in parallel in automation
|
|
|
|
// -------------------------------------------------------------------------------------------------
|
|
|
|
task printBuildVariants {
|
|
|
|
doLast {
|
2019-05-27 13:00:44 +00:00
|
|
|
def variantData = android.applicationVariants.collect { variant -> [
|
|
|
|
name: variant.name,
|
|
|
|
buildType: variant.buildType.name,
|
|
|
|
abi: variant.productFlavors.find { it.dimension == 'abi' }.name,
|
|
|
|
isSigned: variant.signingReady,
|
|
|
|
]}
|
|
|
|
println "variants: " + groovy.json.JsonOutput.toJson(variantData)
|
2019-03-27 14:23:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 12:21:21 +00:00
|
|
|
task printGeckoviewVersions {
|
|
|
|
doLast {
|
2019-06-14 11:25:42 +00:00
|
|
|
println "beta: " + groovy.json.JsonOutput.toJson(GeckoVersions.beta_version)
|
2019-04-23 12:21:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-31 16:27:36 +00:00
|
|
|
// Normally this should use the same version as the glean dependency. But since we are currently using AC snapshots we
|
|
|
|
// can't reference a git tag with a specific version here. So we are just using "master" and hoping for the best.
|
2019-05-16 06:35:43 +00:00
|
|
|
apply from: 'https://github.com/mozilla-mobile/android-components/raw/master/components/service/glean/scripts/sdk_generator.gradle'
|
|
|
|
|
|
|
|
// For production builds, the native code for all `org.mozilla.appservices` dependencies gets compiled together
|
|
|
|
// into a single "megazord" build, and different megazords are published for different subsets of features.
|
|
|
|
// Ref https://mozilla.github.io/application-services/docs/applications/consuming-megazord-libraries.html
|
|
|
|
// Substitute all appservices dependencies with an appropriate megazord.
|
|
|
|
afterEvaluate {
|
|
|
|
def megazord = "fenix-megazord"
|
|
|
|
def appServicesGroup = "org.mozilla.appservices"
|
|
|
|
def appServicesVersion = null
|
|
|
|
configurations.each { configuration ->
|
|
|
|
configuration.resolutionStrategy.eachDependency { DependencyResolveDetails dependency ->
|
|
|
|
if (dependency.requested.group == appServicesGroup) {
|
|
|
|
// Ensure that we only depend on a single, consistent version of appservices.
|
|
|
|
if (appServicesVersion == null) {
|
|
|
|
appServicesVersion = dependency.requested.version
|
|
|
|
} else {
|
|
|
|
if (dependency.requested.version != appServicesVersion) {
|
|
|
|
logger.lifecycle("In ${configuration}: mismatched '${appServicesGroup}` dependency version:" +
|
|
|
|
" '${dependency.requested.group}:${dependency.requested.name}:${dependency.requested.version}'" +
|
|
|
|
" does not have expected version ${appServicesVersion}")
|
|
|
|
throw new RuntimeException("mismatched '${appServicesGroup}` dependency version")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Check whether it was already megazorded.
|
2019-06-10 21:53:56 +00:00
|
|
|
// Hack: sync15 is pure kotlin, and thus not part of the megazord.
|
|
|
|
if (! dependency.requested.name.endsWith("-withoutLib") && dependency.requested.name != "sync15") {
|
2019-05-16 06:35:43 +00:00
|
|
|
// Use either the -forUnitTests megazord, or the default one.
|
|
|
|
def substitution
|
|
|
|
if (dependency.requested.name.endsWith("-forUnitTests")) {
|
|
|
|
substitution = "org.mozilla.appservices:${megazord}-forUnitTests:${appServicesVersion}"
|
|
|
|
} else {
|
|
|
|
substitution = "org.mozilla.appservices:${megazord}:${appServicesVersion}"
|
|
|
|
}
|
|
|
|
logger.lifecycle("In ${configuration}: substituting megazord module '$substitution' for component module" +
|
|
|
|
" '${dependency.requested.group}:${dependency.requested.name}:${dependency.requested.version}'")
|
|
|
|
dependency.useTarget(substitution)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|