Bug 1876335 - use GRADLE_MAVEN_REPOSITORIES in more places. r=owlish,geckoview-review...
[gecko.git] / mobile / android / android-components / components / service / nimbus / build.gradle
blobb8ef48ec0a2df0da9645815588c1ff9af537083c
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/. */
5 buildscript {
6     repositories {
7         gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORIES.each { repository ->
8             maven {
9                 url repository
10                 if (gradle.mozconfig.substs.ALLOW_INSECURE_GRADLE_REPOSITORIES) {
11                     allowInsecureProtocol = true
12                 }
13             }
14         }
15     }
17     dependencies {
18         classpath "${ApplicationServicesConfig.groupId}:tooling-nimbus-gradle:${ApplicationServicesConfig.version}"
19         classpath "org.mozilla.telemetry:glean-gradle-plugin:${Versions.mozilla_glean}"
20     }
23 plugins {
24     id "com.jetbrains.python.envs" version "$python_envs_plugin"
27 apply plugin: 'com.android.library'
28 apply plugin: 'kotlin-android'
30 android {
31     defaultConfig {
32         minSdkVersion config.minSdkVersion
33         compileSdk config.compileSdkVersion
34         targetSdkVersion config.targetSdkVersion
35     }
37     buildTypes {
38         debug {
39             // Export experiments proguard rules even in debug since consuming apps may still
40             // enable proguard/R8
41             consumerProguardFiles 'proguard-rules-consumer.pro'
42         }
43         release {
44             minifyEnabled false
45             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
46             consumerProguardFiles 'proguard-rules-consumer.pro'
47         }
48     }
50     buildFeatures {
51         buildConfig true
52     }
54     namespace 'mozilla.components.service.nimbus'
57 dependencies {
58     // These dependencies are part of this module's public API.
59     api (ComponentsDependencies.mozilla_appservices_nimbus) {
60         // Use our own version of the Glean dependency,
61         // which might be different from the version declared by A-S.
62         exclude group: 'org.mozilla.components', module: 'service-glean'
63     }
65     implementation ComponentsDependencies.androidx_core_ktx
66     implementation ComponentsDependencies.androidx_constraintlayout
67     implementation ComponentsDependencies.androidx_coordinatorlayout
68     implementation ComponentsDependencies.androidx_recyclerview
69     implementation ComponentsDependencies.androidx_work_runtime
71     implementation ComponentsDependencies.kotlin_coroutines
73     implementation ComponentsDependencies.mozilla_appservices_nimbus
75     implementation project(':support-base')
76     implementation project(':support-locale')
77     implementation project(':support-ktx')
78     implementation project(':support-utils')
80     // We only compile against GeckoView and Glean. It's up to the app to add those dependencies if it wants to
81     // send crash reports to Socorro (GV).
82     compileOnly project(":service-glean")
84     testImplementation ComponentsDependencies.mozilla_appservices_full_megazord_forUnitTests
85     testImplementation ComponentsDependencies.androidx_test_core
86     testImplementation ComponentsDependencies.androidx_test_junit
87     testImplementation ComponentsDependencies.testing_mockwebserver
88     testImplementation ComponentsDependencies.testing_robolectric
89     testImplementation ComponentsDependencies.testing_coroutines
90     testImplementation ComponentsDependencies.mozilla_glean_forUnitTests
91     testImplementation ComponentsDependencies.androidx_work_testing
92     testImplementation project(':support-test')
93     testImplementation project(":service-glean")
96 apply from: '../../../android-lint.gradle'
97 apply from: '../../../publish.gradle'
98 ext.configurePublish(config.componentsGroupId, archivesBaseName, project.ext.description)
101 apply plugin: "org.mozilla.appservices.nimbus-gradle-plugin"
103 nimbus {
104     // The path to the Nimbus feature manifest file
105     manifestFile = "messaging.fml.yaml"
107     // Map from the variant name to the channel as experimenter and nimbus understand it.
108     // If nimbus's channels were accurately set up well for this project, then this
109     // shouldn't be needed.
110     channels = [
111             debug: "debug",
112             release: "release",
113     ]
115     // This is an optional value, and updates the plugin to use a copy of application
116     // services. The path should be relative to the root project directory.
117     // *NOTE*: This example will not work for all projects, but should work for Fenix, Focus, and Android Components
118     applicationServicesDir = gradle.hasProperty('localProperties.autoPublish.application-services.dir')
119             ? gradle.getProperty('localProperties.autoPublish.application-services.dir') : null
122 apply plugin: "org.mozilla.telemetry.glean-gradle-plugin"