/*
 *  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'
    id 'java-library'
    id 'project-report'
    id 'org.apache.grails.buildsrc.publish'
    id 'org.apache.grails.buildsrc.sbom'
}

version = projectVersion
group = 'org.apache.grails.views'

ext {
    pomTitle = 'Groovy Server Pages (GSP)'
    pomDescription = 'Groovy Server Pages (GSP) - A server-side view rendering technology based on Groovy'
    pomDevelopers = ['graemerocher': 'Graeme Rocher']
}

dependencies {

    implementation platform(project(':grails-bom'))
    api project(':grails-core')
    api project(':grails-taglib')
    api 'org.apache.groovy:groovy-templates'

//    api project(':grails-bootstrap'), { // ConfigMap
//        // API dependencies in grails-bootstrap
//        exclude group: 'org.yaml', module: 'snakeyaml'
//    }
//    api 'org.apache.groovy:groovy-templates' // Template, TemplateEngine
//
//    api project(':grails-taglib'), { // GrailsTagException, OutputEncodingSettings are used
//        // API dependencies in grails-taglib
//        exclude group: 'org.apache.grails', module: 'grails-core'
//        exclude group: 'org.apache.grails', module: 'grails-encoder'
//    }
//    api 'org.apache.grails:grails-core', { // GrailsStringUtils
//        // API dependencies in grails-core
//        exclude group: 'org.apache.groovy', module: 'groovy'
//        exclude group: 'jakarta.inject', module: 'jakarta.inject-api'
//        exclude group: 'jakarta.persistence', module: 'jakarta.persistence-api'
//        exclude group: 'jakarta.annotation', module: 'jakarta.annotation-api'
//        exclude group: 'org.apache.grails.bootstrap', module: 'grails-bootstrap'
//        //exclude group: 'org.apache.grails.data', module: 'grails-datastore-core' // ClassPropertyFetcher
//        //exclude group: 'org.apache.grails', module: 'grails-spring' // RuntimeSpringConfiguration (somehow needed for groovydoc)
//        exclude group: 'org.slf4j', module: 'jcl-over-slf4j'
//        exclude group: 'org.slf4j', module: 'slf4j-api'
//        exclude group: 'org.yaml', module: 'snakeyaml'
//        exclude group: 'org.springframework', module: 'spring-beans'
//        exclude group: 'org.springframework', module: 'spring-core'
//        exclude group: 'org.springframework', module: 'spring-context'
//        exclude group: 'org.springframework', module: 'spring-tx'
//        exclude group: 'org.springframework.boot', module: 'spring-boot'
//        exclude group: 'org.springframework.boot', module: 'spring-boot-autoconfigure'
//    }
//    implementation 'org.apache.grails.web:grails-encoder', { // FastStringWriter, StreamByteBuffer, StreamCharBuffer are used
//        // API dependencies in grails-encoder
//        exclude group: 'org.apache.groovy', module: 'groovy'
//        exclude group: 'org.apache.groovy', module: 'groovy-json'
//        exclude group: 'org.apache.grails', module: 'grails-core'
//        exclude group: 'org.slf4j', module: 'jcl-over-slf4j'
//        exclude group: 'org.slf4j', module: 'slf4j-api'
//        exclude group: 'org.springframework', module: 'spring-web'
//    }
//    implementation 'org.springframework:spring-context' // ApplicationContext
//
    testImplementation 'org.junit.jupiter:junit-jupiter-api'
    testImplementation 'org.spockframework:spock-core'

    testRuntimeOnly 'org.slf4j:slf4j-nop'
    // Get rid of warning about missing slf4j implementation during test compilation
}

apply {
    // java-configuration must be applied first since tasks are now lazy registered
    from rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
    from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle')
    from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle')
    from rootProject.layout.projectDirectory.file('gradle/test-config.gradle')
}