Skip to content

Commit

Permalink
Relying only on local.properties file for private keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
HLCaptain committed Aug 1, 2024
1 parent 42b349d commit 3d3eccd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ After you added the Android project, then you should follow the instructions [Fi

You will need a [Mapbox account] in order to get the private and public keys to get it up and running.

Follow the [Mapbox install] guide for further information. I placed both of my keys in the `«USER_HOME»/.gradle/gradle.properties` file.
Follow the [Mapbox install] guide for further information. I placed both of my keys in the `local.properties` file.

### Set up [SonarCloud] properly

Expand Down
23 changes: 22 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
* Copyright (c) 2024 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
* This file is part of Jay.
*
* Jay is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
* Jay is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Jay.
* If not, see <https://www.gnu.org/licenses/>.
*/

import org.gradle.util.internal.GUtil.loadProperties

/*
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
Expand Down Expand Up @@ -41,7 +61,8 @@ dependencyResolutionManagement {
// This should always be `mapbox` (not your username).
username = "mapbox"
// Use the secret token you stored in gradle.properties as the password
val mapboxDownloadsToken = settings.extra["MAPBOX_DOWNLOADS_TOKEN"].toString()
val localProperties = loadProperties(File("$rootDir/local.properties"))
val mapboxDownloadsToken = localProperties["MAPBOX_DOWNLOADS_TOKEN"].toString()
password = mapboxDownloadsToken
}
}
Expand Down

0 comments on commit 3d3eccd

Please sign in to comment.