chore: update build.gradle comments for adding an API key (#1756)

This commit is contained in:
Angela Yu 2024-08-16 12:26:28 -07:00 committed by GitHub
parent 710c6ee148
commit 8e47cfbe21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 48 additions and 34 deletions

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2020 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
Copyright 2024 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
@ -41,7 +41,7 @@
<!--
To add your Maps API key to this project:
1. Open the root project's local.properties file
1. Open the root project's secrets.properties file
2. Add this line, where YOUR_API_KEY is your API key:
MAPS_API_KEY=YOUR_API_KEY
-->

View File

@ -86,7 +86,7 @@ public final class MainActivity extends AppCompatActivity
list.setEmptyView(findViewById(R.id.empty));
if (BuildConfig.MAPS_API_KEY.isEmpty()) {
Toast.makeText(this, "Add your own API key in local.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show();
Toast.makeText(this, "Add your own API key in secrets.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show();
}
}

View File

@ -52,7 +52,7 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemClickListener {
}
if (BuildConfig.MAPS_API_KEY.isEmpty()) {
Toast.makeText(this, "Add your own API key in local.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show()
Toast.makeText(this, "Add your own API key in secrets.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show()
}
}

View File

@ -32,7 +32,7 @@
android:theme="@style/AppTheme">
<!--
To add your Maps API key to this project:
1. Open the root project'sl local.properties file
1. Open the root project'sl secrets.properties file
2. Add this line, where YOUR_API_KEY is your API key:
MAPS_API_KEY=YOUR_API_KEY
-->

View File

@ -57,7 +57,7 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemClickListener {
}
if (BuildConfig.MAPS_API_KEY.isEmpty()) {
Toast.makeText(this, "Add your own API key in local.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show()
Toast.makeText(this, "Add your own API key in secrets.properties as MAPS_API_KEY=YOUR_API_KEY", Toast.LENGTH_LONG).show()
}
}

View File

@ -37,8 +37,10 @@ dependencies {
}
secrets {
// Optionally specify a different file name containing your secrets.
// If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// To add your Maps API key to this project:
// 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// 2. Add this line, where YOUR_API_KEY is your API key:
// MAPS_API_KEY=YOUR_API_KEY
propertiesFileName = "secrets.properties"
// A properties file containing default secret values. This file can be

View File

@ -35,8 +35,10 @@ dependencies {
}
secrets {
// Optionally specify a different file name containing your secrets.
// If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// To add your Maps API key to this project:
// 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// 2. Add this line, where YOUR_API_KEY is your API key:
// MAPS_API_KEY=YOUR_API_KEY
propertiesFileName = "secrets.properties"
// To add your Maps API key to this project:

View File

@ -35,8 +35,10 @@ dependencies {
}
secrets {
// Optionally specify a different file name containing your secrets.
// If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// To add your Maps API key to this project:
// 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// 2. Add this line, where YOUR_API_KEY is your API key:
// MAPS_API_KEY=YOUR_API_KEY
propertiesFileName = "secrets.properties"
// To add your Maps API key to this project:

View File

@ -39,11 +39,13 @@ dependencies {
}
secrets {
// Optionally specify a different file name containing your secrets.
// If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// To add your Maps API key to this project:
// 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// 2. Add this line, where YOUR_API_KEY is your API key:
// MAPS_API_KEY=YOUR_API_KEY
propertiesFileName = "secrets.properties"
// A properties file containing default secret values. This file can be
// checked in version control.
defaultPropertiesFileName = 'local.defaults.properties'
}
}

View File

@ -48,8 +48,10 @@ dependencies {
}
secrets {
// Optionally specify a different file name containing your secrets.
// If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// To add your Maps API key to this project:
// 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// 2. Add this line, where YOUR_API_KEY is your API key:
// MAPS_API_KEY=YOUR_API_KEY
propertiesFileName = "secrets.properties"
// To add your Maps API key to this project:

View File

@ -43,10 +43,12 @@ dependencies {
}
secrets {
// Optionally specify a different file name containing your secrets.
// If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// To add your Maps API key to this project:
// 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// 2. Add this line, where YOUR_API_KEY is your API key:
// MAPS_API_KEY=YOUR_API_KEY
propertiesFileName = "secrets.properties"
// To add your Maps API key to this project:
// 1. Open the root project's local.properties file
// 2. Add this line, where YOUR_API_KEY is your API key:

View File

@ -41,8 +41,10 @@ dependencies {
}
secrets {
// Optionally specify a different file name containing your secrets.
// If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// To add your Maps API key to this project:
// 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// 2. Add this line, where YOUR_API_KEY is your API key:
// MAPS_API_KEY=YOUR_API_KEY
propertiesFileName = "secrets.properties"
// To add your Maps API key to this project: