/*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you 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
 *
 *    https://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 'groovy-gradle-plugin'
}

apply {
    from file('../dependencies.gradle')
}

repositories {
    // mavenLocal()
    mavenCentral()
    gradlePluginPortal()
    maven {
        url = 'https://repository.apache.org/content/groups/snapshots'
        content {
            includeVersionByRegex('org[.]apache[.]grails[.]gradle.*', '.*', '.*-SNAPSHOT')
        }
    }
    maven {
        url = 'https://central.sonatype.com/repository/maven-snapshots'
        content {
            includeVersionByRegex('cloud[.]wondrify.*', '.*', '.*-SNAPSHOT')
        }
        mavenContent {
            snapshotsOnly()
        }
    }
    maven {
        url = 'https://repository.apache.org/content/groups/staging'
        content {
            includeModuleByRegex('org[.]apache[.]grails[.]gradle', 'grails-publish')
        }
        mavenContent {
            releasesOnly()
        }
    }
}

file('../gradle.properties').withInputStream {
    Properties props = new Properties()
    props.load(it)
    project.ext.gradleProperties = props
}

version = '0.0.1'
group = 'org.apache.grails.buildsrc'

dependencies {
    implementation "${gradleBomDependencies['grails-publish-plugin']}"
    implementation "org.gradle.crypto.checksum:org.gradle.crypto.checksum.gradle.plugin:${gradleProperties.gradleChecksumPluginVersion}"
    implementation "org.cyclonedx.bom:org.cyclonedx.bom.gradle.plugin:${gradleProperties.gradleCycloneDxPluginVersion}"
}

gradlePlugin {
    plugins {
        publishPlugin {
            id = 'org.apache.grails.buildsrc.publish'
            implementationClass = 'org.apache.grails.buildsrc.PublishPlugin'
        }
        sbomPlugin {
            id = 'org.apache.grails.buildsrc.sbom'
            implementationClass = 'org.apache.grails.buildsrc.SbomPlugin'
        }
    }
}