group 'io.ably.flutter.plugin'
// Use the snapshot suffix to show that build artifacts are not shared.
// This Gradle file is used by Flutter to build itself.
version '1.0-SNAPSHOT'

buildscript {
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:8.12.1'
    }
}

rootProject.allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

apply plugin: 'com.android.library'

dependencies {
    // https://github.com/ably/ably-java/
    implementation 'io.ably:ably-android:1.6.0'

    // https://firebase.google.com/docs/cloud-messaging/android/client
    implementation 'com.google.firebase:firebase-messaging:23.0.6'
}

android {
    // older version of flutter sdk doesn't provide `compileSdkVersion` defaults to 34
    compileSdkVersion flutter.compileSdkVersion ?: 34

    // Conditional for compatibility with AGP <4.2.
    if (project.android.hasProperty("namespace")) {
        namespace 'io.ably.flutter.plugin'
    }

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

    defaultConfig {
        minSdkVersion 19
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    lintOptions {
        disable 'InvalidPackage'
    }
    buildFeatures {
        buildConfig true
    }
}

gradle.projectsEvaluated {
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
    }
}

apply from: file("./ably-agent.gradle")
