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

android {
    compileSdkVersion 31
    defaultConfig {
        applicationId "org.decsync.cc"
        minSdkVersion 21
        targetSdkVersion 31
        versionCode 35
        versionName "2.2.3"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }

    compileOptions {
        // enable because ical4android requires desugaring
        coreLibraryDesugaringEnabled true

        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }

    buildTypes {
        debug {
            // minifyEnabled enables R8 and thus desugaring (which is needed for working debug builds)
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.md'
        exclude 'META-INF/NOTICE.md'
        exclude 'META-INF/kotlinx-serialization-runtime.kotlin_module'
    }

    lintOptions {
        warning 'InvalidPackage'
    }
    buildFeatures {
        viewBinding true
    }
}

repositories {
    google()
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
    implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
    implementation 'androidx.room:room-ktx:2.4.2'
    kapt 'androidx.room:room-compiler:2.4.2'
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.work:work-runtime-ktx:2.7.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.preference:preference-ktx:1.2.0'
    testImplementation 'junit:junit:4.13.2'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.1'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2'
    implementation 'com.nononsenseapps:filepicker:4.2.1'
    implementation 'org.decsync:libdecsync:2.2.1'
    implementation 'com.github.AppIntro:AppIntro:6.1.0'
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
    implementation 'com.github.QuadFlask:colorpicker:0.0.15'

    implementation project(":vcard4android")
    implementation project(":ical4android")
}
