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-02-08 18:35:48 +00:00
|
|
|
apply plugin: 'androidx.navigation.safeargs'
|
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
|
|
|
|
versionCode Config.versionCode
|
|
|
|
versionName Config.versionName + Config.generateVersionSuffix()
|
2018-12-07 20:11:50 +00:00
|
|
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
release {
|
2019-02-12 20:54:02 +00:00
|
|
|
shrinkResources true
|
|
|
|
minifyEnabled true
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
2018-12-07 20:11:50 +00:00
|
|
|
}
|
2019-01-28 17:00:21 +00:00
|
|
|
debug {
|
|
|
|
applicationIdSuffix ".debug"
|
|
|
|
}
|
2018-12-07 20:11:50 +00:00
|
|
|
}
|
2019-01-07 20:23:30 +00:00
|
|
|
|
|
|
|
flavorDimensions "abi"
|
|
|
|
productFlavors {
|
|
|
|
// replace the libraries with 64-bit versions when they're ready
|
2019-01-30 00:26:03 +00:00
|
|
|
// Processor architectures
|
|
|
|
arm {
|
|
|
|
dimension "abi"
|
|
|
|
ndk {
|
|
|
|
abiFilter "armeabi-v7a"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
x86 {
|
|
|
|
dimension "abi"
|
|
|
|
ndk {
|
|
|
|
abiFilter "x86"
|
|
|
|
}
|
|
|
|
}
|
2019-01-07 20:23:30 +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-01-07 20:23:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
android.applicationVariants.all { variant ->
|
|
|
|
def buildType = variant.buildType.name
|
|
|
|
|
|
|
|
if (buildType == "release" || buildType == "nightly") {
|
|
|
|
def versionCode = generatedVersionCode
|
|
|
|
|
|
|
|
// 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-01-11 05:41:37 +00:00
|
|
|
if (variant.flavorName.contains("x86")) {
|
2019-01-07 20:23:30 +00:00
|
|
|
versionCode = versionCode + 1
|
|
|
|
}// else variant.flavorName.contains("Arm")) use generated version code
|
|
|
|
|
|
|
|
variant.outputs.all { output ->
|
|
|
|
setVersionCodeOverride(versionCode)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
println("----------------------------------------------")
|
|
|
|
println("Build type: " + buildType)
|
|
|
|
println("Flavor: " + variant.flavorName)
|
|
|
|
println("Version code: " + variant.mergedFlavor.versionCode)
|
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
|
|
|
|
implementation Deps.androidx_appcompat
|
|
|
|
implementation Deps.androidx_constraintlayout
|
2019-01-28 16:46:39 +00:00
|
|
|
|
|
|
|
implementation Deps.rxAndroid
|
|
|
|
implementation Deps.rxKotlin
|
|
|
|
implementation Deps.anko_commons
|
|
|
|
implementation Deps.anko_sdk
|
|
|
|
implementation Deps.anko_appcompat
|
|
|
|
implementation Deps.anko_constraintlayout
|
2019-01-10 00:07:33 +00:00
|
|
|
|
2019-01-29 16:42:10 +00:00
|
|
|
implementation Deps.sentry
|
|
|
|
|
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-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-01-18 23:33:40 +00:00
|
|
|
implementation Deps.mozilla_browser_engine_gecko_nightly
|
|
|
|
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-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-01-30 19:41:01 +00:00
|
|
|
implementation Deps.mozilla_feature_prompts
|
2019-01-18 23:33:40 +00:00
|
|
|
implementation Deps.mozilla_feature_session
|
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-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-02 05:03:04 +00:00
|
|
|
implementation Deps.mozilla_feature_findinpage
|
2019-01-23 16:13:05 +00:00
|
|
|
implementation Deps.mozilla_support_ktx
|
|
|
|
|
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-01-07 20:23:30 +00:00
|
|
|
testImplementation Deps.junit
|
|
|
|
androidTestImplementation Deps.tools_test_runner
|
|
|
|
androidTestImplementation Deps.tools_espresso_core
|
|
|
|
|
|
|
|
armImplementation Deps.geckoview_nightly_arm
|
|
|
|
x86Implementation Deps.geckoview_nightly_x86
|
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-01-15 01:42:58 +00:00
|
|
|
implementation Deps.android_arch_navigation
|
2019-02-07 23:37:52 +00:00
|
|
|
implementation Deps.android_arch_navigation_ui
|
2018-12-07 20:11:50 +00:00
|
|
|
}
|
2019-01-29 16:42:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
android.applicationVariants.all { variant ->
|
|
|
|
// 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) {
|
|
|
|
buildConfigField 'String', 'SENTRY_TOKEN', 'null'
|
|
|
|
}
|
|
|
|
|
|
|
|
// Activating crash reporting only if command line parameter was provided (in automation)
|
|
|
|
if (project.hasProperty("crashReports") && project.property("crashReports") == "true") {
|
|
|
|
buildConfigField 'boolean', 'CRASH_REPORTING', 'true'
|
|
|
|
} else {
|
|
|
|
buildConfigField 'boolean', 'CRASH_REPORTING', 'false'
|
|
|
|
}
|
2019-01-31 16:27:36 +00:00
|
|
|
|
|
|
|
// Activating telemetry only if command line parameter was provided (in automation)
|
|
|
|
if (project.hasProperty("telemetry") && project.property("telemetry") == "true") {
|
|
|
|
buildConfigField 'boolean', 'TELEMETRY', 'true'
|
|
|
|
} else {
|
|
|
|
buildConfigField 'boolean', 'TELEMETRY', 'false'
|
|
|
|
}
|
2019-01-29 16:42:10 +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.
|
|
|
|
apply from: 'https://github.com/mozilla-mobile/android-components/raw/master/components/service/glean/scripts/sdk_generator.gradle'
|