Correction bug, modernisation
This commit is contained in:
@@ -2,9 +2,19 @@ plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
// Load local.properties
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withInputStream { localProperties.load(it) }
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.boidelov3'
|
||||
compileSdk 33
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
packagingOptions { resources.excludes.add("META-INF/*") } // This line is added to avoid the error: Duplicate files copied in APK META-INF/LICENSE.txt
|
||||
defaultConfig {
|
||||
applicationId "com.example.boidelov3"
|
||||
@@ -14,6 +24,11 @@ android {
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
// Inject database credentials into BuildConfig
|
||||
buildConfigField "String", "DB_URL", "\"${localProperties.getProperty('db.url', '')}\""
|
||||
buildConfigField "String", "DB_USER", "\"${localProperties.getProperty('db.user', '')}\""
|
||||
buildConfigField "String", "DB_PASSWORD", "\"${localProperties.getProperty('db.password', '')}\""
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
Reference in New Issue
Block a user