/*
 * Copyright (C) 2024 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.SoftwareType

plugins {
    id("AndroidXPlugin")
    id("AndroidXRepackagePlugin")
    id("java-library")
}

repackage {
    addRelocation {
        sourcePackage = "org.antlr"
        targetPackage = "androidx.room.jarjarred.org.antlr"
    }
    addRelocation {
        sourcePackage = "org.stringtemplate"
        targetPackage =  "androidx.room.jarjarred.org.stringtemplate"
    }
    artifactId = "room-external-antlr"
}

dependencies {
    repackage(libs.antlr4) {
        // antlr has dependencies on unrelated projects for its gui stuff, do not include them
        exclude group: "org.abego.treelayout"
        exclude group: "com.ibm.icu"
        exclude group: "org.glassfish"
    }
}

androidx {
    type = SoftwareType.PUBLISHED_LIBRARY
    name = "Room External Antlr"
    inceptionYear = "2024"
    description =  "Repackaged antlr dependency for use by Room"
    doNotDocumentReason = "Repackaging only"
    license.name = "BSD-3-Clause"
    license.url = "https://opensource.org/licenses/BSD-3-Clause"
}
