apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
group='com.github.antvis'

android {

    compileSdk rootProject.extensions.sdks.CompileSDK
    ndkVersion rootProject.extensions.sdks.ndkVersion

    defaultConfig {
        namespace "com.antgroup.antv.f2"
        minSdkVersion rootProject.extensions.sdks.MinSDK
        targetSdkVersion rootProject.extensions.sdks.TargetSDK
        versionCode 1
        versionName "1.0"
        multiDexEnabled false

        externalNativeBuild {
            cmake {
                cppFlags rootProject.extensions.externalNativeCmake.cppFlags
                arguments = []
                arguments.addAll(rootProject.extensions.externalNativeCmake.arguments)
            }
        }
        ndk {
            abiFilters 'armeabi-v7a', 'arm64-v8a'
        }
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

    buildTypes {
        release {
            minifyEnabled false
        }
    }

    compileOptions {
        targetCompatibility rootProject.extensions.compileOptions.targetCompatibility
        sourceCompatibility rootProject.extensions.compileOptions.sourceCompatibility
    }

    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }

    packagingOptions {
        exclude '**/libc++_shared.so'
        exclude '**/**/libc++_shared.so'
    }

    sourceSets {
        main.manifest.srcFile 'src/main/AndroidManifest.xml'
        main.java.srcDirs = ['src/main/java']
        main.res.srcDirs = ['src/main/res']
    }
}

dependencies {
    compileOnly rootProject.extensions.dependencies.fastjson
}


publishing {
    publications {
        release(MavenPublication) {
            groupId = 'com.github.antvis'
            artifactId = 'F2Native'
            version = '2.1.22'

            afterEvaluate {
                artifact bundleReleaseAar
            }
        }
    }
}