def kotlinVersion = '1.9.25'
project.ext.kotlinVersion = kotlinVersion

ext {
    junitVersion = '4.13.2'
    androidxAppCompatVersion = '1.7.1'
    androidxJunitVersion = '1.3.0'
    androidxEspressoCoreVersion = '3.7.0'
}

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.13.0'
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25'
    }
}

apply plugin: 'com.android.library'
apply plugin: 'org.jetbrains.kotlin.android'

android {
    namespace = "app.capgo.plugin.health"
    compileSdk = 36

    defaultConfig {
        minSdk 26
        targetSdk 36
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    lint {
        abortOnError = false
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_21
        targetCompatibility JavaVersion.VERSION_21
    }
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_21.toString()
    }
}

repositories {
    google()
    mavenCentral()
}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation project(':capacitor-android')
    implementation "androidx.appcompat:appcompat:${androidxAppCompatVersion}"
    implementation ("org.jetbrains.kotlin:kotlin-stdlib:" + project.ext.kotlinVersion)
    implementation 'androidx.health.connect:connect-client:1.1.0'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1'
    testImplementation "junit:junit:${junitVersion}"
    androidTestImplementation "androidx.test.ext:junit:${androidxJunitVersion}"
    androidTestImplementation "androidx.test.espresso:espresso-core:${androidxEspressoCoreVersion}"
}
