plugins {
    id 'com.android.application'
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "com.xplora.xpsettings"
        minSdk 27
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    android.applicationVariants.all { variant ->
        variant.outputs.all {
            outputFileName = "xpsettings.apk"
        }
    }
}

String SDK_DIR = System.getenv("ANDROID_SDK_HOME")

if(SDK_DIR == null) {
    Properties properties = new Properties()
    properties.load(new FileInputStream(project.rootProject.file("local.properties")))
    SDK_DIR = properties.get('sdk.dir')
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.4.2'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    implementation "com.google.zxing:core:3.2.1"
    compileOnly(files("${SDK_DIR}/platforms/android-24/data/layoutlib.jar"))
    implementation 'com.google.code.gson:gson:2.8.0'
    implementation(fileTree("libs"))
    implementation 'com.makeramen:roundedimageview:2.3.0'
}