/*
 * Copyright (C) 2022 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.LibraryType

plugins {
    id("AndroidXPlugin")
    id("AndroidXRepackagePlugin")
    id("java-library")
    id("com.google.protobuf")
}

repackage {
    // Must match what is in health/health-services-client-external-protobuf/build.gradle
    addRelocation {
        sourcePackage = "com.google.protobuf"
        targetPackage =  "androidx.health.services.client.proto"
    }
}

dependencies {
    implementation("androidx.annotation:annotation:1.8.1")
    // Must be compileOnly to not bring in protobufLite in runtime
    // Repackaged protobufLite brought in by
    // project(":health:health-services-client-external-protobuf") and used at runtime
    compileOnly(libs.protobufLite)
    api(project(":health:health-services-client-external-protobuf"))
}

androidx {
    name = "Health Services Client Proto"
    type = LibraryType.PUBLISHED_PROTO_LIBRARY
    mavenVersion = LibraryVersions.HEALTH_SERVICES_CLIENT
    inceptionYear = "2022"
    description = "Proto files for health-services-client"
}
