plugins { id("com.android.application") }

android {
  compileSdk = libs.versions.compileSdk.get().toInt()
  namespace = "io.sentry.java.tests.perf.appsentry"

  defaultConfig {
    applicationId = "io.sentry.java.tests.perf.appsentry"
    minSdk = libs.versions.minSdk.get().toInt()
    targetSdk = libs.versions.targetSdk.get().toInt()
    versionCode = 1
    versionName = "1.0"
  }

  buildTypes {
    getByName("release") {
      isMinifyEnabled = true
      signingConfig = signingConfigs.getByName("debug") // to be able to run release mode
      proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
      ndk {
        abiFilters.clear()
        abiFilters.add("arm64-v8a")
      }
    }
  }
  compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
  }
  buildFeatures { viewBinding = true }
  signingConfigs {
    getByName("debug") {
      storeFile = rootProject.file("debug.keystore")
      storePassword = "android"
      keyAlias = "androiddebugkey"
      keyPassword = "android"
    }
  }

  androidComponents.beforeVariants {
    it.enable = !Config.Android.shouldSkipDebugVariant(it.buildType)
  }
}

dependencies {
  implementation("androidx.appcompat:appcompat:1.3.0")
  implementation("com.google.android.material:material:1.4.0")
  implementation("androidx.constraintlayout:constraintlayout:2.2.1")
  implementation("androidx.navigation:navigation-fragment:2.3.5")
  implementation("androidx.navigation:navigation-ui:2.3.5")
  implementation(projects.sentryAndroid)
}
