From 9d5066bf9d4d855c275f51e2190347c9813a1dd7 Mon Sep 17 00:00:00 2001 From: Jackson Rosenthal Date: Sat, 5 Feb 2022 21:11:53 -0500 Subject: [PATCH] move mapbox auth back to build gradle --- app/build.gradle | 6 +++--- build.gradle | 24 ++++++++++++++++++++++++ settings.gradle | 26 +------------------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 316d6f1c..813d00ff 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -127,9 +127,6 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'androidx.core:core-ktx:1.7.0' implementation 'androidx.fragment:fragment-ktx:1.4.0' - implementation('com.mapbox.maps:android:10.2.0') { - exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-telemetry' - } implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.3' @@ -169,6 +166,9 @@ dependencies { // mapbox implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.7.1' + implementation('com.mapbox.maps:android:10.2.0') { + exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-telemetry' + } // mapbox specifies a really old version of okhttp3 which causes lots of API warnings. trying a newer version implementation 'com.squareup.okhttp3:okhttp:4.9.0' diff --git a/build.gradle b/build.gradle index 0fe1b0c8..c46b6bd7 100644 --- a/build.gradle +++ b/build.gradle @@ -33,6 +33,30 @@ buildscript { } } +allprojects { + repositories { + maven { + // Per https://docs.mapbox.com/android/maps/guides/install/ we now need to signin to download mapbox lib + url 'https://api.mapbox.com/downloads/v2/releases/maven' + authentication { + basic(BasicAuthentication) + } + credentials { + // Do not change the username below. + // This should always be `mapbox` (not your username). + username = 'mapbox' + // Use the secret token you stored in gradle.properties as the password + password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: "" + } + } + google() + mavenCentral() + // jcenter() + maven { url 'https://jitpack.io' } + //maven { url "https://plugins.gradle.org/m2/" } + } +} + task clean(type: Delete) { delete rootProject.buildDir } diff --git a/settings.gradle b/settings.gradle index 5b7a0b4b..7477052e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,29 +1,5 @@ include ':app' -rootProject.name = 'Mesh Util' +rootProject.name='Mesh Util' include ':geeksville-androidlib' project(':geeksville-androidlib').projectDir = new File('geeksville-androidlib') - - -dependencyResolutionManagement { - repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) - repositories { - google() - mavenCentral() - // jcenter() // Warning: this repository is going to shut down soon - maven { - url 'https://api.mapbox.com/downloads/v2/releases/maven' - authentication { - basic(BasicAuthentication) - } - credentials { - // Do not change the username below. - // This should always be `mapbox` (not your username). - username = "mapbox" - // Use the secret token you stored in gradle.properties as the password - password = System.properties["MAPBOX_DOWNLOADS_TOKEN"] - } - } - maven { url 'https://jitpack.io' } - } -} \ No newline at end of file