apply plugin: 'com.android.application'

clean {
    delete 'assets'
    delete 'libs'
}

gradle.projectsEvaluated {
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
    }
}

android {
    compileSdkVersion 29
    buildToolsVersion '29.0.2'

    externalNativeBuild {
        ndkBuild {
            path "jni/Android.mk"
        }
    }

    sourceSets {          
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    }

    defaultConfig {
        applicationId "info.melda.sala.pktriggercord"
        minSdkVersion 16
        targetSdkVersion 29
        versionCode 8501
        versionName "0.85.01"
        setProperty("archivesBaseName", "info.melda.sala.pktriggercord.PkTriggerCord-$versionName" )
        externalNativeBuild {
            ndkBuild {
                abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
                targets "pktriggercord-cli"
                arguments  "V=1 install"
            }
        }
    }

    signingConfigs {
        release {
            storeFile file("${System.properties['user.home']}/progs/java_keystore_google_play.jks")
            def RELEASE_STORE_PASSWORD=project.properties['RELEASE_STORE_PASSWORD'] ?: ""
            storePassword RELEASE_STORE_PASSWORD
            keyAlias 'melda'
            def RELEASE_KEY_PASSWORD=project.properties['RELEASE_KEY_PASSWORD'] ?: ""
            keyPassword RELEASE_KEY_PASSWORD
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }
}

dependencies {
    api fileTree(dir: 'libs', include: ['*.jar'])
    api 'androidx.appcompat:appcompat:1.2.0'
}

buildscript {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}
