apply plugin: 'com.android.application'

// how to apply the sentry android gradle plugin plugin
apply plugin: 'io.sentry.android.gradle'

// how to apply the native bundle plugin
apply plugin: 'com.ydq.android.gradle.native-aar.import'

android {
    compileSdkVersion 30

    defaultConfig {
        applicationId "io.sentry.samples"
        minSdkVersion 14
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        externalNativeBuild {
            cmake {
                arguments.add(0, "-DANDROID_STL=c++_static")
            }
        }

        ndk {
            abiFilters("x86", "armeabi-v7a", "x86_64", "arm64-v8a")
        }
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig = signingConfigs.debug // to be able to run release mode
        }
    }

    externalNativeBuild {
        cmake {
            setPath("CMakeLists.txt")
        }
    }

    signingConfigs {
        debug {
            storeFile = rootProject.file("debug.keystore")
            storePassword = "android"
            keyAlias = "androiddebugkey"
            keyPassword = "android"
        }
    }

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
}

// how to configure the sentry android gradle plugin
 sentry {
     // Only enable it if you are using sentry-android <= v1.7,
     // sentry-android >= v2.0 already does it automatically.
     autoProguardConfig false

//     Disables or enables the automatic configuration of Native Symbols
     uploadNativeSymbols true

//     Does or doesn't include the source code of native code for Sentry.
     includeNativeSources true
 }

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'io.sentry:sentry-android:4.3.0'
}
