plugins {
    id 'com.android.library'
//    id 'maven-publish'
    id 'org.jetbrains.kotlin.android'
}

android {
    namespace 'com.eqgis.eqr'
    compileSdk 28

    defaultConfig {
        minSdk 24
        targetSdk 28
        versionCode 10
        versionName "1.0.9"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        ndk{
            abiFilters 'armeabi-v7a','arm64-v8a'
        }
        
        externalNativeBuild {
            cmake {
                cppFlags '-std=c++11'
            }
        }
    }

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

    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }
    externalNativeBuild {
        cmake {
//            path file('src/main/cpp/CMakeLists.txt')
            path file('CMakeLists.txt')
            version '3.22.1'
        }
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
    implementation 'androidx.core:core-ktx:1.10.1'

    //AR相关采用在线依赖
//    compileOnly 'com.google.ar:core:1.39.0'
    compileOnly 'com.google.ar:core:1.45.0'

    compileOnly 'com.huawei.hms:arenginesdk:4.0.0.5'

    //离线依赖，注：需要相应so库,现为方便调试，引入filament-源码
//    implementation files("libs/filament-v1.12.0-android.jar")
//    implementation files("libs/gltfio-v1.12.0-android.jar")
//    implementation files("libs/filament-utils-v1.12.0.jar")

    //slam库 不再引入，已将EqSlamLayout移至app模块
//    compileOnly files("libs/eq-slam.jar")//若要使用”eq-slam“的功能，需单独引用”eq-slam-1.x.x.aar“,这里仅在编译时使用
    //opencv 的java部分代码库，注意：这里要剔除opencv.so和libc++_shared.so，用户使用时单独引用opencv，不合并在这个模块中
//    compileOnly files('libs\\opencv-4.5.5-java.jar')
}

ext {
    GITHUB_REPO_PATH = "D:\\AndroidDev\\GIT_DEV\\repo\\repo"//本地储存路径
//    GITHUB_REPO_PATH = "F:\\0WorkRepo\\repo"//本地储存路径

    PUBLISH_GROUP_ID = 'com.eqgis'//包名

    PUBLISH_ARTIFACT_ID = 'eq-renderer'//自定义名

    PUBLISH_VERSION = '1.0.9'//版本号，每一次更新迭代升级版本
}
//
//afterEvaluate {
//    publishing {
//        publications {
//            maven(MavenPublication) {
//                artifact bundleReleaseAar
//
//                groupId project.PUBLISH_GROUP_ID
//                artifactId project.PUBLISH_ARTIFACT_ID
//                version project.PUBLISH_VERSION
//
//            }
//        }
//
//        repositories {
//            maven {
////            url = layout.buildDirectory.dir('repo')
//                def deployPath = file(project.GITHUB_REPO_PATH)
//                url = layout.buildDirectory.dir("file://${deployPath.absolutePath}")
//            }
//        }
//    }
//    java {
//        sourceCompatibility = JavaVersion.VERSION_1_8
//        targetCompatibility = JavaVersion.VERSION_1_8
//    }
//}