build.gradle (7152B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 plugins { 6 alias(libs.plugins.kotlin.android) 7 alias(libs.plugins.kotlin.compose) 8 } 9 10 apply plugin: 'com.android.application' 11 12 android { 13 compileSdk { version = release(config.compileSdkMajorVersion) { minorApiLevel = config.compileSdkMinorVersion } } 14 15 defaultConfig { 16 applicationId "org.mozilla.samples.browser" 17 minSdk config.minSdkVersion 18 targetSdk config.targetSdkVersion 19 versionCode 1 20 versionName "1.0" 21 22 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 23 testInstrumentationRunnerArgument "clearPackageData", "true" 24 testInstrumentationRunnerArgument "listener", "leakcanary.FailTestOnLeakRunListener" 25 } 26 27 buildTypes { 28 release { 29 minifyEnabled = false 30 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 31 } 32 } 33 34 flavorDimensions += "engine" 35 36 productFlavors { 37 gecko { 38 dimension "engine" 39 } 40 41 // WebView 42 system { 43 dimension "engine" 44 } 45 } 46 47 variantFilter { variant -> 48 if (variant.buildType.name == "release") { 49 // This is a sample app that we are not releasing. Save some time and do not build 50 // release versions. 51 setIgnore(true) 52 } 53 } 54 55 buildFeatures { 56 viewBinding = true 57 compose = true 58 } 59 60 namespace = 'org.mozilla.samples.browser' 61 } 62 63 tasks.register("updateBorderifyExtensionVersion", Copy) { task -> 64 updateExtensionVersion(task, 'src/main/assets/extensions/borderify') 65 } 66 67 tasks.register("updateTestExtensionVersion", Copy) { task -> 68 updateExtensionVersion(task, 'src/main/assets/extensions/test') 69 } 70 71 dependencies { 72 geckoImplementation project(':components:browser-engine-gecko') 73 74 implementation project(':components:browser-domains') 75 implementation project(':components:browser-engine-system') 76 implementation project(':components:browser-icons') 77 implementation project(':components:browser-menu') 78 implementation project(':components:browser-session-storage') 79 implementation project(':components:browser-state') 80 implementation project(':components:browser-storage-sync') 81 implementation project(':components:browser-tabstray') 82 implementation project(':components:browser-thumbnails') 83 implementation project(':components:browser-toolbar') 84 implementation project(':components:compose-awesomebar') 85 implementation project(':components:concept-awesomebar') 86 implementation project(':components:concept-base') 87 implementation project(':components:concept-engine') 88 implementation project(':components:concept-fetch') 89 implementation project(':components:concept-storage') 90 implementation project(':components:concept-tabstray') 91 implementation project(':components:concept-toolbar') 92 implementation project(':components:feature-addons') 93 implementation project(':components:feature-app-links') 94 implementation project(":components:feature-autofill") 95 implementation project(':components:feature-awesomebar') 96 implementation project(':components:feature-contextmenu') 97 implementation project(':components:feature-customtabs') 98 implementation project(':components:feature-downloads') 99 implementation project(':components:feature-findinpage') 100 implementation project(':components:feature-intent') 101 implementation project(':components:feature-media') 102 implementation project(':components:feature-privatemode') 103 implementation project(':components:feature-prompts') 104 implementation project(':components:feature-pwa') 105 implementation project(':components:feature-readerview') 106 implementation project(':components:feature-screendetection') 107 implementation project(':components:feature-search') 108 implementation project(':components:feature-session') 109 implementation project(':components:feature-sitepermissions') 110 implementation project(':components:feature-tabs') 111 implementation project(':components:feature-toolbar') 112 implementation project(':components:feature-webcompat') 113 implementation project(':components:feature-webcompat-reporter') 114 implementation project(':components:feature-webnotifications') 115 implementation project(":components:lib-crash") 116 implementation project(':components:lib-dataprotect') 117 implementation project(':components:lib-fetch-httpurlconnection') 118 implementation project(":components:lib-publicsuffixlist") 119 implementation project(':components:service-digitalassetlinks') 120 // Add a dependency on glean to simplify the testing workflow 121 // for engineers that want to test Gecko metrics exfiltrated via the Glean 122 // SDK. See bug 1592935 for more context. 123 implementation project(":components:service-glean") 124 implementation project(':components:service-location') 125 implementation project(':components:service-sync-logins') 126 implementation project(':components:support-appservices') 127 implementation project(':components:support-base') 128 implementation project(':components:support-ktx') 129 implementation project(':components:support-locale') 130 implementation project(':components:support-utils') 131 implementation project(':components:support-webextensions') 132 implementation project(':components:ui-autocomplete') 133 implementation project(':components:ui-tabcounter') 134 implementation project(':components:ui-widgets') 135 136 implementation libs.androidx.appcompat 137 implementation platform(libs.androidx.compose.bom) 138 implementation libs.androidx.compose.foundation 139 implementation libs.androidx.compose.material3 140 implementation libs.androidx.compose.ui.tooling 141 implementation libs.androidx.constraintlayout 142 implementation libs.androidx.core.ktx 143 implementation libs.androidx.localbroadcastmanager 144 implementation libs.androidx.swiperefreshlayout 145 implementation libs.google.material 146 implementation libs.mozilla.glean 147 148 debugImplementation libs.leakcanary 149 150 testImplementation libs.androidx.test.core 151 testImplementation libs.androidx.test.junit 152 testImplementation libs.kotlinx.coroutines.test 153 testImplementation libs.mockito 154 testImplementation libs.robolectric 155 156 androidTestImplementation project(':components:support-android-test') 157 158 androidTestImplementation libs.androidx.test.core 159 androidTestImplementation libs.androidx.test.espresso.core 160 androidTestImplementation libs.androidx.test.junit 161 androidTestImplementation libs.androidx.test.monitor 162 androidTestImplementation libs.androidx.test.rules 163 androidTestImplementation libs.androidx.test.runner 164 androidTestImplementation libs.androidx.test.uiautomator 165 androidTestImplementation libs.leakcanary.instrumentation 166 androidTestImplementation libs.mockwebserver 167 } 168 169 preBuild.dependsOn updateBorderifyExtensionVersion 170 preBuild.dependsOn updateTestExtensionVersion