apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

// This handles both kotlin and java. Use kapt instead of annotationProcessor
apply plugin: 'kotlin-kapt'
android {
    namespace 'com.ghstudios.android.mhgendatabase'
    compileSdkVersion 30

    defaultConfig {
        applicationId "com.ghstudios.android.mhgendatabase"
        minSdkVersion 14
        targetSdkVersion 35

        //1.00   Version Code: 1   Released 7-14-2016
        //1.0.1  Version Code: 2   Released 7-19-2016
        //1.0.2  Version Code: 3   Released 7-19-2016
        //1.1.0  Version Code: 4   Released 7-31-2016
        //1.1.1  Version Code: 5   Released 8-05-2016
        //1.1.2  Version Code: 6   Released 10-17-2016
        //?????  Version Code: 7   Released ????????
        //2.0.0  Version Code: 8   Released 9-8-2018
        //2.0.1  Version Code: 9   Released 9-8-2018
        //2.0.2  Version Code:10   Released 9-??-2018
        //2.1.0  Version Code:11   Released 9-??-2018
        //2.1.1  Version Code:12   Released 9-??-2018
        //2.2.0  Version Code:13   Released 10-08-2018
        //2.2.1  Version Code:14   Released 10-14-2018
        //2.3.0  Version Code:15   Released 11-07-2018
        //2.3.1  Version Code:16   Released 11-07-2018
        //2.3.2  Version Code:17   Released 12-15-2018
        //2.3.3  Version Code:18   Released 12-19-2018
        //2.3.4  Version Code:19   Released 12-20-2018
        //2.3.5  Version Code:20   Released 12-20-2018
        //2.3.6  Version Code:21   Released 12-20-2018
        //2.4.4  Version Code:25   Released 6-17-2025
        versionCode 26
        versionName "2.4.4"

        compileOptions {
            // we'll still be able to target lower java versions because of desugar
            // however, avoid using java 8 only libraries like @FunctionalInterface and streams
            // this enables us to use language features like lambdas and interface defaults
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }

        kotlinOptions {
            jvmTarget = "1.8"
        }

        sourceSets{
            //Small hack to separate icons into a different resource folder
            main.res.srcDirs += 'src/main/icon-res/'
        }
    }


    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }

    buildFeatures {
        viewBinding true
        buildConfig true
    }
    lint {
        disable 'MissingTranslation'
    }
}

dependencies {
    // kotlin
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    /*
     * Google Support Libraries
     */
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.preference:preference:1.1.0'
    implementation 'androidx.legacy:legacy-preference-v14:1.0.0'

    /*
     * lifecycle components
     */
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
//    testImplementation 'androidx.arch.core:core-testing:2.1.0'

    implementation 'com.google.android.flexbox:flexbox:3.0.0'

    // Resources here https://github.com/ApmeM/android-flowlayout
    implementation 'de.cketti.library.changelog:ckchangelog:1.2.2' // Library to display a changelog on first run
    // Integration instructions here https://github.com/cketti/ckChangeLog
    implementation project(':multilevelexpindlistview')
    implementation project(':android-sqlite-asset-helper')
    implementation project(':android-section-adapter')

    /*
     * Adapter Delegates
     * https://github.com/sockeqwe/AdapterDelegates
     */
    implementation 'com.hannesdorfmann:adapterdelegates3:3.0.1'
}

repositories {
    google()
    mavenCentral()
}
