/*
 * Copyright (c) 2020 Nam Nguyen, nam@ene.im
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'

android {
  namespace 'kohii.v1.sample.tiktok'
  compileSdkVersion libs.versions.android.target.sdk.get().toInteger()

  defaultConfig {
    minSdkVersion libs.versions.android.min.sdk.get()
    targetSdkVersion libs.versions.android.target.sdk.get()
    versionCode libs.versions.release.code.get().toInteger()
    versionName libs.versions.release.name.get()
    applicationId "kohii.v1.sample.tiktok"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    testApplicationId 'kohii.v1.sample.tiktok.test'
  }

  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
  }
  packagingOptions {
    resources {
      excludes +=
          ['META-INF/services/javax.annotation.processing.Processor', 'META-INF/DEPENDENCIES']
    }
  }

  buildFeatures {
    viewBinding true
  }

  productFlavors {}

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }

  kotlinOptions {
    jvmTarget = "1.8"
  }
}

dependencies {
  implementation fileTree(dir: "libs", include: ["*.jar"])
  implementation project(':kohii-core')
  implementation project(':kohii-exoplayer')

  implementation(libs.android.exoplayer.all)
  implementation(libs.androidx.media2.widget)

  implementation(libs.androidx.core)
  implementation(libs.androidx.fragment)
  implementation(libs.androidx.appcompat)
  implementation(libs.androidx.recyclerview)
  implementation(libs.androidx.recyclerview.selection)
  implementation(libs.androidx.constraintlayout)
  implementation(libs.androidx.material)

  implementation(libs.androidx.navigation.common)
  implementation(libs.androidx.navigation.runtime)
  implementation(libs.androidx.navigation.fragment)
  implementation(libs.androidx.navigation.ui)

  implementation(libs.androidx.lifecycle.runtime)
  implementation(libs.androidx.lifecycle.viewmodel)
  implementation(libs.androidx.lifecycle.livedata)
  implementation(libs.androidx.lifecycle.java8)
  implementation(libs.androidx.lifecycle.process)

  implementation(libs.square.moshi)
  kapt(libs.square.moshi.codegen)
  implementation(libs.okio)

  implementation(libs.coil.common)

  implementation(libs.androidx.vectordrawable)

  testImplementation(libs.androidx.core.ktx)
  testImplementation(libs.androidx.rules)
  testImplementation(libs.androidx.runner)

  androidTestImplementation(libs.androidx.junit.ktx)
  androidTestImplementation(libs.androidx.espresso.core)
}
