plugins {
    alias(libs.plugins.android.application)
}

android {
    namespace 'tr.dhee.abox.demo'
    compileSdk 34
    // SDK(libABSDK0630.jar) 内部依赖 Apache HttpClient(org.apache.http)。
    // 自包含方案: 四个 Apache jar 直接打进 APK, 不依赖设备系统库(任意机型可装)。

    defaultConfig {
        applicationId "tr.dhee.abox.demo"
        minSdk 21
        targetSdk 34
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

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

    // 多个 Apache HTTP 相关 jar 均带 META-INF 元数据文件, 打包进同一 APK 会冲突, 排除这些重复元数据(不影响运行时类)。
    packagingOptions {
        resources {
            excludes += ['META-INF/DEPENDENCIES', 'META-INF/LICENSE', 'META-INF/LICENSE.txt',
                         'META-INF/NOTICE', 'META-INF/NOTICE.txt', 'META-INF/ASL2.0',
                         'META-INF/license.txt', 'META-INF/notice.txt']
        }
    }
}

dependencies {
    // 引入 libs 下全部 jar: SDK(libABSDK0630.jar) + Apache HttpClient 四件套(自包含, 不依赖系统库)。
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation libs.activity.ktx
    implementation libs.annotation
    implementation libs.appcompat
    implementation libs.constraintlayout
    implementation libs.lifecycle.livedata.ktx
    implementation libs.lifecycle.viewmodel.ktx
    implementation libs.material
    testImplementation libs.junit
    androidTestImplementation libs.espresso.core
    androidTestImplementation libs.ext.junit
}