plugins {
    id 'com.android.application'
}

android {
    namespace 'com.eltechs.ed'

    compileSdk 29

    defaultConfig {
        applicationId "com.eltechs.ed"
        // minSdkVersion >= 23 并且 Android Gradle plugin >= 3.6.0情况下，打包时android:extractNativeLibs=false.即 so不解压，这样会有问题
        minSdk 21
        //noinspection ExpiredTargetSdkVersion
        targetSdk 27
        //noinspection ExpiredTargetSdkVersion
        versionCode 31
        versionName "3.0.1"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        ndk {
            // Specifies the ABI configurations of your native
            // libraries Gradle should build and package with your app.
            abiFilters 'armeabi-v7a','x86_64'//, 'arm64-v8a','x86', 'x86_64', 'armeabi'
        }
    }

    // Encapsulates your external native build configurations.
    externalNativeBuild {

        // Encapsulates your CMake build configurations.
        cmake {

            // Provides a relative path to your CMake build script.
            path "CMakeLists.txt"

        }
    }


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

    lint {
        baseline = file("lint-baseline.xml")
    }

    sourceSets {
        main {
            jniLibs.srcDirs = ['src/main/00jniLibs']
        }
    }
}

// 自定义打包名称
android.applicationVariants.all { variant ->
    variant.outputs.all {
        outputFileName = "patcher.apk"
    }
}


sourceSets {
    main {
        java{

        }
        resources {
            // 打包忽略目录: src/main/resources/img
            exclude 'img/**'
            // 打包忽略文件: src/main/resources/icons/scanner.vsdx
            exclude 'icons/scanner.vsdx'
        }
    }
}
dependencies {

    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    //noinspection GradleCompatible
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:2.0.4'
    implementation 'android.arch.lifecycle:livedata:1.1.1'
    implementation 'android.arch.lifecycle:viewmodel:1.1.1'
    implementation 'android.arch.navigation:navigation-fragment:1.0.0'
    implementation 'android.arch.navigation:navigation-ui:1.0.0'
    //noinspection GradleCompatible
    implementation 'com.android.support:support-v4:28.0.0'
    //noinspection GradleCompatible
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    //noinspection GradleCompatible
    implementation 'com.android.support:preference-v14:28.0.0'
    //noinspection GradleCompatible
    implementation 'com.android.support:preference-v7:28.0.0'

//    implementation project(path: ':customcontrols')

    implementation 'commons-io:commons-io:2.4'
    implementation 'org.apache.commons:commons-compress:1.21'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
    //貌似与安卓代码有冲突用不了。。。httpclient defines classes that conflict with classes now provided by Android.
//    implementation 'org.apache.httpcomponents:httpclient:4.5.14'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore
    implementation 'org.apache.httpcomponents:httpcore:4.4.16'
    // https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
    implementation 'org.apache.commons:commons-lang3:3.12.0'
    // https://mvnrepository.com/artifact/org.apache.commons/commons-collections4
    implementation 'org.apache.commons:commons-collections4:4.4'
    implementation 'com.github.iwgang:countdownview:2.1.6'
    implementation 'com.google.code.gson:gson:2.10.1'
    implementation 'org.tukaani:xz:1.9' //下载wine压缩包，解压tar.xz需要


    //tx11的类，只作为提供api，最新代码应该去termuxx11那个project里找

//    implementation project(path: ':edapi')
    testImplementation 'junit:junit:4.13.2'
//    implementation project(path: ':overlayapp')
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    compileOnly project(':app:stub')
}