Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relying only on local.properties file for private keys. #119

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading