buildscript {
    ext.kotlin_version = "1.4.10"

    repositories {
        google()
        jcenter()
    }
    dependencies {
        // replace with the current version of the Android plugin
        classpath "com.android.tools.build:gradle:4.1.1"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
    }
}

repositories {
    google()
    mavenLocal()
    mavenCentral()
}

apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "kotlin-allopen"
apply plugin: "kotlin-kapt"

android {
    compileSdkVersion 29

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 29
    }
    sourceSets {
        main.java.srcDirs += "src/main/kotlin"
    }
}

allOpen {
    annotation("org.androidannotations.api.KotlinOpen")
}

// If you have different applicationIds for buildTypes or productFlavors uncomment this block.
//kapt {
//    arguments {
//        arg("resourcePackageName", "org.androidannotations.gradle")
//    }
//
//    correctErrorTypes = true // add this if you use data binding
//}

def AAVersion = "4.9.0-SNAPSHOT" // change this to your desired version, for example the latest stable: 4.8.0

dependencies {
    kapt "org.androidannotations:androidannotations:$AAVersion"
    implementation "org.androidannotations:androidannotations-api:$AAVersion"
}
