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

android {
    namespace 'com.example.makcar'
    compileSdk 34

    defaultConfig {
        applicationId "com.example.makcar"
        minSdk 27
        targetSdk 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        ndk {
            abiFilters 'arm64-v8a' // 当前 MSDK 只支持 arm64-v8a 架构
        }
        // MSDK 相关的 so 库，加上一下配置
        packagingOptions {
            pickFirst 'lib/arm64-v8a/libc++_shared.so'
            pickFirst 'lib/armeabi-v7a/libc++_shared.so'
        }

        // MSDK 相关的 so 库，加上一下配置
        packagingOptions {
            doNotStrip "*/*/libconstants.so"
            doNotStrip "*/*/libdji_innertools.so"
            doNotStrip "*/*/libdjibase.so"
            doNotStrip "*/*/libDJICSDKCommon.so"
            doNotStrip "*/*/libDJIFlySafeCore-CSDK.so"
            doNotStrip "*/*/libdjifs_jni-CSDK.so"
            doNotStrip "*/*/libDJIRegister.so"
            doNotStrip "*/*/libdjisdk_jni.so"
            doNotStrip "*/*/libDJIUpgradeCore.so"
            doNotStrip "*/*/libDJIUpgradeJNI.so"
            doNotStrip "*/*/libDJIWaypointV2Core-CSDK.so"
            doNotStrip "*/*/libdjiwpv2-CSDK.so"
            doNotStrip "*/*/libFlightRecordEngine.so"
            doNotStrip "*/*/libvideo-framing.so"
            doNotStrip "*/*/libwaes.so"
            doNotStrip "*/*/libagora-rtsa-sdk.so"
            doNotStrip "*/*/libc++.so"
            doNotStrip "*/*/libc++_shared.so"
            doNotStrip "*/*/libmrtc_28181.so"
            doNotStrip "*/*/libmrtc_agora.so"
            doNotStrip "*/*/libmrtc_core.so"
            doNotStrip "*/*/libmrtc_core_jni.so"
            doNotStrip "*/*/libmrtc_data.so"
            doNotStrip "*/*/libmrtc_log.so"
            doNotStrip "*/*/libmrtc_onvif.so"
            doNotStrip "*/*/libmrtc_rtmp.so"
            doNotStrip "*/*/libmrtc_rtsp.so"
        }
    }

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

dependencies {
    implementation project(":android-sdk-v5-uxsdk")
    implementation "com.dji:dji-sdk-v5-aircraft:$SDK_VERSION"
    compileOnly "com.dji:dji-sdk-v5-aircraft-provided:$SDK_VERSION"

    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.8.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")

//    implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.10')
//    implementation 'org.jetbrains.kotlin:kotlin-stdlib'   // 仅此一句即可

    // 2. 把其他库拖进来的旧 jdk7/jdk8 排除掉
    configurations.all {
        exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
        exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
    }

}