/*
 * Copyright (c) 2019 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.library'
apply plugin: 'kotlin-android'

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

  defaultConfig {
    minSdkVersion libs.versions.android.min.sdk.get()
    targetSdkVersion libs.versions.android.target.sdk.get()

    buildConfigField("String", "LIB_NAME", "\"" + "Kohii for ExoPlayer, v" + libs.versions.release.name.get() + "\"")

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    consumerProguardFiles 'consumer-rules.pro'
  }

  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
  }

  testOptions {
    unitTests {
      includeAndroidResources = true
    }
  }

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
}

dependencies {
  implementation project(':kohii-core')

  implementation(libs.android.exoplayer.all)

  implementation(libs.androidx.appcompat)
  implementation(libs.androidx.core)
  implementation(libs.androidx.collection)

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

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

project.archivesBaseName = "kohii-exoplayer"
apply from: rootProject.file('gradle/release_maven.gradle')
