/*
 * Copyright 2019 The Android Open Source Project
 *
 * 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.
 */

import androidx.build.LibraryGroups
import androidx.build.LibraryVersions
import androidx.build.Publish
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

import static androidx.build.dependencies.DependenciesKt.*

plugins {
    id("AndroidXPlugin")
    id("com.android.library")
    id("AndroidXUiPlugin")
    id("org.jetbrains.kotlin.android")
}

dependencies {
    kotlinPlugin project(path: ":compose:compose-compiler", configuration: "embeddablePlugin")

    implementation(KOTLIN_COMPOSE_STDLIB)

    implementation "androidx.annotation:annotation:1.1.0"

    implementation project(":compose:compose-runtime")
    implementation project(":ui:ui-core")
    implementation project(":ui:ui-framework")
    implementation project(":ui:ui-layout")
    implementation project(":ui:ui-text")
    implementation project(":ui:ui-animation")
    implementation project(":ui:ui-foundation")
    implementation project(":ui:ui-vector")

    testImplementation(ANDROIDX_TEST_RULES)
    testImplementation(ANDROIDX_TEST_RUNNER)
    testImplementation(JUNIT)
    testImplementation(MOCKITO_CORE)
    testImplementation(TRUTH)
    testImplementation MOCKITO_KOTLIN, {
        exclude group: 'org.mockito' // to keep control on the mockito version
    }

    androidTestImplementation project(":ui:ui-material:integration-tests:samples")
    androidTestImplementation project(":ui:ui-test")
    androidTestApi project(":ui:ui-platform")

    androidTestImplementation(ANDROIDX_TEST_RULES)
    androidTestImplementation(ANDROIDX_TEST_RUNNER)
    androidTestImplementation(JUNIT)
    androidTestImplementation(TRUTH)
}

androidx {
    name = "Androidx Material"
    publish = Publish.SNAPSHOT_AND_RELEASE
    mavenVersion = LibraryVersions.UI
    mavenGroup = LibraryGroups.UI
    inceptionYear = "2018"
    description = "AndroidX Material"
}

tasks.withType(KotlinCompile).configureEach {
    kotlinOptions {
        useIR = true
    }
}
