// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"
    defaultConfig {
        applicationId "com.microsoft.seal"
        minSdkVersion 24
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                cppFlags ""
                arguments "-DSEAL_BUILD_SEAL_C=1",
                          "-DSEAL_USE_INTRIN=1",
                          "-DSEAL_ARM64_EXITCODE=0",
                          "-DSEAL_ARM64_EXITCODE__TRYRUN_OUTPUT=''",
                          "-DSEAL___BUILTIN_CLZLL_FOUND_EXITCODE=0",
                          "-DSEAL___BUILTIN_CLZLL_FOUND_EXITCODE__TRYRUN_OUTPUT=''",
                          "-DSEAL__ADDCARRY_U64_FOUND_EXITCODE=0",
                          "-DSEAL__ADDCARRY_U64_FOUND_EXITCODE__TRYRUN_OUTPUT=''",
                          "-DSEAL__SUBBORROW_U64_FOUND_EXITCODE=0",
                          "-DSEAL__SUBBORROW_U64_FOUND_EXITCODE__TRYRUN_OUTPUT=''"
            }
        }
        ndk {
            abiFilters 'x86_64'
            abiFilters 'arm64-v8a'
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    externalNativeBuild {
        cmake {
            path "$rootDir/../CMakeLists.txt"
            version "3.12.0+"
        }
    }
    ndkVersion "22.1.7171670"
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
