/*
 * Copyright 2020 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.
 */

/**
 * This file was created using the `create_project.py` script located in the
 * `<AndroidX root>/development/project-creator` directory.
 *
 * Please use that script when creating a new project, rather than copying an existing project and
 * modifying its settings.
 */

import androidx.build.KotlinTarget
import androidx.build.LibraryType
import androidx.build.SdkHelperKt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    id("AndroidXPlugin")
    id("kotlin")
}

androidx.configureAarAsJarForConfiguration("testImplementation")

dependencies {
    implementation(libs.kotlinStdlib)
    implementation("androidx.room:room-compiler-processing:2.6.0")
    implementation(libs.javapoet)
    implementation(libs.kspApi)

    testImplementation(project(":hilt:hilt-common"))
    testImplementation("androidx.annotation:annotation:1.8.1")
    testImplementation(libs.junit)
    testImplementation(libs.truth)
    testImplementation(project(":room:room-compiler-processing-testing"))
    testImplementation(libs.hiltCore)
    testImplementationAarAsJar(project(":hilt:hilt-work"))
    testImplementation(SdkHelperKt.getSdkDependency(project))
}

tasks.withType(KotlinCompile).configureEach {
    kotlinOptions {
        freeCompilerArgs += [
                "-opt-in=androidx.room.compiler.processing.ExperimentalProcessingApi",
                "-opt-in=com.squareup.kotlinpoet.javapoet.KotlinPoetJavaPoetPreview"
        ]
    }
}

tasks.withType(Test).configureEach {
    // https://github.com/google/compile-testing/issues/222
    it.jvmArgs "--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
}

androidx {
    name = "Hilt Extension Compiler"
    type = LibraryType.ANNOTATION_PROCESSOR
    mavenVersion = LibraryVersions.HILT
    inceptionYear = "2020"
    description = "AndroidX Hilt Extension Compiler"
    kotlinTarget = KotlinTarget.KOTLIN_1_9
}
