buildscript {
    ext.kotlin_version = '1.9.23'
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.4.1'
        classpath 'org.codehaus.groovy:groovy-xml:3.0.9'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.4.1'
        classpath 'com.google.firebase:perf-plugin:1.4.2'
        // Add the Crashlytics Gradle plugin
        classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.1'
        classpath 'com.github.wyjsonGo.GoRouter:GoRouter-Gradle-Plugin:2.5.1'
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
        //aliyun maven for old library
        maven { url "https://maven.aliyun.com/repository/central" }
        maven { url "https://maven.aliyun.com/repository/google" }
        maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
        maven { url "https://maven.aliyun.com/repository/jcenter" }
        maven { url "https://maven.aliyun.com/repository/spring" }
        maven { url "https://maven.aliyun.com/repository/spring-plugin" }
        maven { url "https://maven.aliyun.com/repository/public" }
        maven { url "https://maven.aliyun.com/repository/releases" }
        maven { url "https://maven.aliyun.com/repository/snapshots" }
        maven { url "https://maven.aliyun.com/repository/grails-core" }
        maven { url "https://maven.aliyun.com/repository/mapr-public" }
        maven { url "https://maven.aliyun.com/repository/apache-snapshots" }
        //[Android]依赖了包含aar包的库后出现Failed to resolve库aar包问题的解决办法
        flatDir {
            dirs project(':focus-common').file('libs')
        }
    }

    tasks.withType(org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile).configureEach {
        kotlinOptions {
            jvmTarget = "17"
        }
    }
}


project.ext {
    //app info
    applicationId = "allen.town.focus.podcast"
    compileSdkVersion = 35 //jdk need 17 and latter
    minSdkVersion = 21
    targetSdkVersion = 35
    targetFreeSdkVersion = 33
    versionCode = 79
    versionName = "2.8.5.20250928"

    // AndroidX
    annotationVersion = "1.8.0"
    appcompatVersion = "1.4.2"
    coreVersion = "1.5.0"
    fragmentVersion = "1.3.6"
    mediaVersion = "1.4.3"
    paletteVersion = "1.0.0"
    preferenceVersion = "1.2.0"
    recyclerViewVersion = "1.2.1"
    viewPager2Version = "1.1.0-beta01"
    workManagerVersion = "2.7.1"
    googleMaterialVersion = "1.7.0-alpha02"
    lifecycle_version = "2.0.0"

    // Third-party
    commonslangVersion = "3.7"
    commonsioVersion = "2.5"
    jsoupVersion = "1.15.1"
    glideVersion = "4.13.2"
    okhttpVersion = "4.9.2"
    okioVersion = "1.17.5"
    eventbusVersion = "3.3.1"
    rxAndroidVersion = "2.1.1"
    rxJavaVersion = "2.2.2"
    iconifyVersion = "2.2.2"
    exoPlayerVersion = "2.15.1"
    exoOkhttpExtensionPlayerVersion = "2.14.2"
    audioPlayerVersion = "v2.0.0"
    lattieVersion = "5.0.3"

    // Only used for free builds. This version should be updated regularly.
    conscryptVersion = "2.5.2"

    // Google Play build
    wearableSupportVersion = "2.6.0"
    playServicesVersion = "18.0.1"

    //Tests
    awaitilityVersion = "3.1.6"
    junitVersion = "4.13"
    robolectricVersion = "4.5-alpha-1"
    robotiumSoloVersion = "5.6.3"
    espressoVersion = "3.2.0"
    runnerVersion = "1.2.0"
    rulesVersion = "1.2.0"
}

apply plugin: "checkstyle"
checkstyle {
    toolVersion '8.24'
}

task checkstyle(type: Checkstyle) {
    classpath = files()
    source "${project.rootDir}"
    exclude("**/gen/**")
    exclude("**/generated/**")
}
