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

plugins {
    id("java-gradle-plugin")
    alias(libs.plugins.kotlinJvm)
}

dependencies {
    implementation(project(":shared"))
    implementation("com.gradle:develocity-gradle-plugin:3.18")
    implementation("com.gradle:common-custom-user-data-gradle-plugin:2.0.1")
    implementation("supportBuildSrc:private")
    implementation("supportBuildSrc:public")
    implementation("supportBuildSrc:plugins")
    implementation(libs.androidGradleSettingsPlugin)
    testImplementation(libs.junit)
    testImplementation(libs.truth)
}

gradlePlugin {
    plugins {
        playgroundConventions {
            id = "playground"
            implementationClass = "androidx.playground.PlaygroundPlugin"
        }
        gradleEnterpriseConventions {
            id = "playground-develocity-conventions"
            implementationClass = "androidx.playground.GradleDevelocityConventionsPlugin"
        }
    }
}
