/*
 * 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.App
import com.ankitsuda.rebound.buildSrc.Deps

plugins {
    id 'com.github.ben-manes.versions'
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-kapt'
    id 'dagger.hilt.android.plugin'
    id 'kotlin-parcelize'
    id 'org.jetbrains.kotlin.plugin.serialization'
}

android {
    compileSdk App.compileSdkVersion

    defaultConfig {
        applicationId App.id
        targetSdkVersion App.targetSdkVersion
        minSdkVersion App.minSdkVersion
        versionCode App.versionCode
        versionName "${App.versionName}"

        vectorDrawables {
            useSupportLibrary true
        }
    }
    buildTypes {
        lintOptions {
            checkReleaseBuilds false
            abortOnError false
        }
        release {
            // Using debug signing configs as of now
            signingConfig signingConfigs.debug
            debuggable false
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            applicationIdSuffix ".debug"
        }
    }
    compileOptions {
        coreLibraryDesugaringEnabled true

        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion Deps.Android.Compose.compilerVersion
//        kotlinCompilerVersion '1.5.31'
    }
    packagingOptions {
        resources {
            excludes += '/META-INF/{AL2.0,LGPL2.1}'
        }
    }
    namespace 'com.ankitsuda.rebound'
}
repositories {
    mavenCentral()
    maven { url "https://jitpack.io" }
}
dependencies {
    implementation project(":modules:common-ui-compose")
    implementation project(":modules:common-ui-theme")
    implementation project(":modules:common-ui-components")
    implementation project(":modules:core-data")
    implementation project(":modules:core-rest-timer")
    implementation project(":modules:navigation")
    implementation project(":modules:ui-settings")
    implementation project(":modules:ui-measure")
    implementation project(":modules:ui-part-measure")
    implementation project(":modules:ui-calendar")
    implementation project(":modules:ui-workout")
    implementation project(":modules:ui-workout-panel")
    implementation project(":modules:ui-workout-details")
    implementation project(":modules:ui-more-screen")
    implementation project(":modules:ui-create-exercise")
    implementation project(":modules:ui-exercises")
    implementation project(":modules:ui-home")
    implementation project(":modules:ui-history")
    implementation project(":modules:ui-personalization")
    implementation project(":modules:ui-exercise-details")
    implementation project(":modules:ui-workout-template-preview")
    implementation project(":modules:ui-rest-timer")
    implementation project(":modules:ui-workout-edit")
    implementation project(":modules:ui-keyboard")
    implementation project(":modules:ui-customize-plates")
    implementation project(":modules:common-ui-components-workout-editor")
    implementation project(":modules:stopwatch")
    implementation project(":modules:ui-customize-barbells")
    implementation project(":modules:ui-muscle-selector")
    implementation project(":modules:ui-exercise-category-selector")

    implementation Deps.Kotlin.coroutinesAndroid
    kapt Deps.Android.Lifecycle.compiler

    // dagger-2
    implementation Deps.Dagger.hilt
//    kapt Deps.Dagger.compiler
    kapt Deps.Dagger.hiltCompiler

    // leak canary
    //debugImplementation Deps.LeakCanary.leakCanary


    // OTHER
    api Deps.Kotlin.stdlib
    api Deps.Kotlin.coroutinesCore
    api Deps.Kotlin.coroutinesAndroid


    api Deps.Dagger.hilt

    // android
    api Deps.Android.activityCompose

//    api Deps.Android.navigationUi
    api Deps.Android.navigationCompose
    api Deps.Android.navigationHiltCompose

    api Deps.Android.Compose.ui
    api Deps.Android.Compose.uiUtil
//    api Deps.Android.Compose.uiTooling
    api Deps.Android.Compose.foundation
    api Deps.Android.Compose.materialDesign
    api Deps.Android.Compose.materialDesignIcons
    api Deps.Android.Compose.materialDesignIconsExtended
    api Deps.Android.Compose.constraintLayout
    api Deps.Android.Compose.liveData
    api Deps.Android.Compose.activity
    api Deps.Android.Compose.viewModels

    api Deps.Android.Accompanist.insets
    api Deps.Android.Accompanist.insetsUi
    api Deps.Android.Accompanist.systemUiController
    api Deps.Android.Accompanist.navigationMaterial
    api Deps.Android.Accompanist.navigationAnimation

    api Deps.Android.Lifecycle.runtime
    api Deps.Android.Lifecycle.runtimeKtx
    kapt Deps.Android.Lifecycle.compiler
    api Deps.Android.Lifecycle.extensions
    api Deps.Android.Lifecycle.vmKotlin
    api Deps.Android.Lifecycle.vmSavedState


    api Deps.Utils.timber

    api Deps.Dagger.hilt
    kapt Deps.Dagger.hiltCompiler

    coreLibraryDesugaring Deps.Android.desugaring
}