|
1 | 1 | import com.google.protobuf.gradle.id |
| 2 | +import java.io.FileInputStream |
| 3 | +import java.util.Properties |
2 | 4 |
|
3 | 5 | plugins { |
4 | 6 | alias(libs.plugins.android.application) |
@@ -45,20 +47,21 @@ android { |
45 | 47 | versionCode = 86 |
46 | 48 | versionName = "0.0.85" |
47 | 49 |
|
48 | | -// We don't currently require a Tile provider API key |
49 | | -// |
50 | | -// // Retrieve the tile provider API from local.properties. This is not under version control |
51 | | -// // and must be configured by each developer locally. GitHb actions fill in local.properties |
52 | | -// // from a secret. |
53 | | -// var tileProviderApiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" |
54 | | -// try { |
55 | | -// val localProperties = Properties() |
56 | | -// localProperties.load(FileInputStream(rootProject.file("local.properties"))) |
57 | | -// tileProviderApiKey = localProperties["tileProviderApiKey"].toString() |
58 | | -// } catch (e: Exception) { |
59 | | -// println("Failed to load local.properties for TILE_PROVIDER_API_KEY: $e") |
60 | | -// } |
61 | | -// buildConfigField("String", "TILE_PROVIDER_API_KEY", "\"${tileProviderApiKey}\"") |
| 50 | + // Retrieve the tile provider URL and API key from local.properties. This is not under |
| 51 | + // version control and must be configured by each developer locally. GitHub actions fill in |
| 52 | + // local.properties from a secret. |
| 53 | + var tileProviderUrl = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" |
| 54 | + var tileProviderApiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" |
| 55 | + try { |
| 56 | + val localProperties = Properties() |
| 57 | + localProperties.load(FileInputStream(rootProject.file("local.properties"))) |
| 58 | + tileProviderUrl = localProperties["tileProviderUrl"].toString() |
| 59 | + tileProviderApiKey = localProperties["tileProviderApiKey"].toString() |
| 60 | + } catch (e: Exception) { |
| 61 | + println("Failed to load local.properties for tile provider: $e") |
| 62 | + } |
| 63 | + buildConfigField("String", "TILE_PROVIDER_URL", "\"${tileProviderUrl}\"") |
| 64 | + buildConfigField("String", "TILE_PROVIDER_API_KEY", "\"${tileProviderApiKey}\"") |
62 | 65 |
|
63 | 66 | buildConfigField("String", "VERSION_NAME", "\"${versionName}\"") |
64 | 67 | buildConfigField("String", "FMOD_LIB", "\"fmod\"") |
|
0 commit comments