|
1 | 1 | import com.google.protobuf.gradle.id |
| 2 | +import org.jetbrains.kotlin.gradle.dsl.JvmTarget |
| 3 | +import java.io.FileInputStream |
| 4 | +import java.util.Properties |
2 | 5 |
|
3 | 6 | plugins { |
4 | 7 | alias(libs.plugins.android.application) |
@@ -45,20 +48,21 @@ android { |
45 | 48 | versionCode = 86 |
46 | 49 | versionName = "0.0.85" |
47 | 50 |
|
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}\"") |
| 51 | + // Retrieve the tile provider URL and API key from local.properties. This is not under |
| 52 | + // version control and must be configured by each developer locally. GitHub actions fill in |
| 53 | + // local.properties from a secret. |
| 54 | + var tileProviderUrl = "" |
| 55 | + var tileProviderApiKey = "" |
| 56 | + try { |
| 57 | + val localProperties = Properties() |
| 58 | + localProperties.load(FileInputStream(rootProject.file("local.properties"))) |
| 59 | + tileProviderUrl = localProperties["tileProviderUrl"].toString() |
| 60 | + tileProviderApiKey = localProperties["tileProviderApiKey"].toString() |
| 61 | + } catch (e: Exception) { |
| 62 | + println("Failed to load local.properties for tile provider: $e") |
| 63 | + } |
| 64 | + buildConfigField("String", "TILE_PROVIDER_URL", "\"${tileProviderUrl}\"") |
| 65 | + buildConfigField("String", "TILE_PROVIDER_API_KEY", "\"${tileProviderApiKey}\"") |
62 | 66 |
|
63 | 67 | buildConfigField("String", "VERSION_NAME", "\"${versionName}\"") |
64 | 68 | buildConfigField("String", "FMOD_LIB", "\"fmod\"") |
@@ -102,8 +106,11 @@ android { |
102 | 106 | sourceCompatibility = JavaVersion.VERSION_19 |
103 | 107 | targetCompatibility = JavaVersion.VERSION_19 |
104 | 108 | } |
105 | | - kotlinOptions { |
106 | | - jvmTarget = "19" |
| 109 | + |
| 110 | + kotlin { |
| 111 | + compilerOptions { |
| 112 | + compilerOptions.jvmTarget.set(JvmTarget.JVM_19) |
| 113 | + } |
107 | 114 | } |
108 | 115 | buildFeatures { |
109 | 116 | compose = true |
|
0 commit comments