/*
 * Copyright (c) 2022 Ankit Suda.
 *
 * Licensed under the GNU General Public License v3
 *
 * This is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 */

import com.ankitsuda.rebound.buildSrc.Deps

buildscript {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }

    dependencies {
        classpath Deps.Android.gradle
        classpath Deps.Kotlin.gradle
        classpath Deps.Kotlin.serialization
//        classpath Deps.Android.navigationSafeArgs
        classpath Deps.Dagger.hiltGradle
//        classpath Deps.Kotlin.gradle
//        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
        classpath "com.github.ben-manes:gradle-versions-plugin:0.42.0"
    }
}


allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
        jcenter()
        gradlePluginPortal()
    }

    tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
        kotlinOptions {
            jvmTarget = "1.8"

            freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
            freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.FlowPreview"
            freeCompilerArgs += "-Xopt-in=kotlin.Experimental"
            freeCompilerArgs += "-Xopt-in=coil.annotation.ExperimentalCoilApi"
            freeCompilerArgs += "-Xopt-in=com.google.accompanist.pager.ExperimentalPagerApi"
        }
    }
}

subprojects {
    configurations.configureEach {
        exclude group: 'androidx.appcompat'
        exclude group: 'com.google.android.material', module: 'material'
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}