buildscript {
    ext.kotlin_version = '1.3.70'
    repositories {
        jcenter() // or mavenCentral()
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

ext {
//	supportLibVersion = '27.1.1'  // variable that can be referenced to keep support libs consistent
    commonLibVersion= '2.12.4'
    versionBuildTool = '27.0.3'
    versionCompiler = 29
    versionTarget = 21
    versionMin = 21
    versionNameString = '1.0.0'
    javaSourceCompatibility = JavaVersion.VERSION_1_8
    javaTargetCompatibility = JavaVersion.VERSION_1_8

    dependencies = [
            //material-dialogs
            "material-dialogs-core"                : "com.afollestad.material-dialogs:core:0.9.4.5",
            "material-dialogs-commons"             : "com.afollestad.material-dialogs:commons:0.9.4.5",
    ]
}

apply plugin: 'com.android.application'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'

android {
    splits {
        abi {
            enable true
            reset()
            include 'armeabi-v7a'
        }
    }

    lintOptions {
        disable "ResourceType"
        checkReleaseBuilds false
    }

    buildToolsVersion '29.0.2'
    compileSdkVersion versionCompiler

    defaultConfig {
        applicationId "kr.co.icontrols.ilp300_700"
        minSdkVersion versionMin
        targetSdkVersion versionTarget
        versionCode 2
        //versionName "2021.12.24.99"
        versionName "2026.02.06.01"
//        versionName "2021.10.22.01"
        multiDexEnabled true

        ndk {
            moduleName "iLP300_700_JNI"
        }
    }

    signingConfigs {
        config {
            keyAlias 'HDC_HN_RELEASE_KEY'
            keyPassword 'hdchnsys1776'
            storeFile file('../HDC_HN_RELEASE_KEY.jks')
            storePassword 'hdchnsys1776'
        }
    }

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

    applicationVariants.all { variant ->
        variant.outputs.all { output ->
            outputFileName = new File("../", "ILP_300FR_6410.apk");
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

    repositories {
        flatDir {
            dirs 'libs'
        }
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }

    packagingOptions {

        exclude 'META-INF/DEPENDENCIES.txt'

        exclude 'META-INF/LICENSE.txt'

        exclude 'META-INF/NOTICE.txt'

        exclude 'META-INF/NOTICE'

        exclude 'META-INF/LICENSE'

        exclude 'META-INF/DEPENDENCIES'

        exclude 'META-INF/notice.txt'

        exclude 'META-INF/license.txt'

        exclude 'META-INF/dependencies.txt'

        exclude 'META-INF/LGPL2.1'

    }


}

dependencies {
    implementation 'com.android.support:support-v4:23.4.0'
	implementation files('libs/milsiplib.aar')
    implementation files('libs/daum-speech-openapi-2.1.jar')
    implementation files('libs/iencryptor.jar')
    implementation files('libs/SttTTsAPI.jar')
    implementation files('libs/WallPadAPI.jar')
    implementation files('libs/WallPadSupport.jar')

    implementation(name:'libuvccamera-release', ext:'aar')
    implementation(name:'libmtc-release', ext:'aar')
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.navigation:navigation-fragment:2.2.2'
    implementation 'androidx.navigation:navigation-ui:2.2.2'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1'
    implementation 'androidx.navigation:navigation-ui-ktx:2.3.1'

    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'

    // Optional, if you use support library fragments:
    debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.3'

    implementation 'io.reactivex.rxjava2:rxjava:2.2.8'
    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72"
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.github.bumptech.glide:glide:4.10.0' // Glide
    api(rootProject.ext.dependencies["material-dialogs-core"]) {
        exclude group: 'com.android.support'
    }
    api(rootProject.ext.dependencies["material-dialogs-commons"]) {
        exclude group: 'com.android.support'
    }

    implementation project(path: ':commlibs')
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.blankj:utilcodex:1.31.0'
}


