plugins {
    id 'com.android.application'
}

def signingFile = rootProject.file('.keystore.properties')
def signing = new Properties()
if (signingFile.exists()) {
    signing.load(new FileInputStream(signingFile))
}

android {
    namespace 'com.sheanpackaging.mauzotrack'
    compileSdk 35

    defaultConfig {
        applicationId 'com.sheanpackaging.mauzotrack'
        minSdk 24
        targetSdk 35
        versionCode 10037
        versionName '1.0'
    }

    if (signingFile.exists()) {
        signingConfigs {
            release {
                storeFile file(signing['storeFile'])
                storePassword signing['storePassword']
                keyAlias signing['keyAlias']
                keyPassword signing['keyPassword']
                enableV1Signing true
                enableV2Signing true
                enableV3Signing true
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            if (!signingFile.exists()) {
                throw new GradleException('Signed release requires native/android/.keystore.properties')
            }
            signingConfig signingConfigs.release
        }
        debug {
            applicationIdSuffix '.debug'
            versionNameSuffix '-debug'
        }
    }

    packagingOptions {
        resources.excludes += ['META-INF/DEPENDENCIES', 'META-INF/LICENSE*', 'META-INF/NOTICE*']
    }
}
