/*
 *  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 'java-library'
	id 'org.apache.grails.gradle.grails-gsp'
	id 'org.apache.grails.gradle.grails-plugin'
}

group = 'org.apache.grails'

ext {
	publishArtifactId = 'grails-spring-security'
	pomTitle = 'Grails spring-security-core plugin'
	pomDescription = 'The Spring Security plugin simplifies the integration of Spring Security into Grails® framework applications.'
	pomDevelopers = [
			'burtbeckwith': 'Burt Beckwith',
			'puneetbehl': 'Puneet Behl'
	]
}

dependencies {

	implementation platform("org.apache.grails:grails-bom:$grailsVersion")

	compileOnly 'org.apache.grails:grails-core' // Provided as this is a Grails Plugin
	api 'org.apache.grails.data:grails-datastore-core' // API because used in templates
	api 'org.apache.grails.data:grails-datamapping-core' // API because used in templates
	api 'org.apache.grails.events:grails-events-transforms' // API because used in templates
	api 'org.apache.grails:grails-mimetypes'
	api 'org.apache.grails:grails-async' // AsyncGrailsWebRequest is used in public API
	api 'org.apache.grails.web:grails-web-common'
	api 'org.apache.grails.web:grails-web-url-mappings'
	api 'org.springframework:spring-beans'
	api 'org.springframework:spring-context'
	api 'org.springframework:spring-context'
	api 'org.springframework.security:spring-security-core'
	api 'org.springframework.security:spring-security-web'
	api 'org.springframework:spring-web'

	implementation 'org.apache.commons:commons-text'
	implementation "org.ehcache:ehcache"
	implementation 'org.apache.grails.bootstrap:grails-bootstrap'
	implementation 'org.apache.grails:grails-rest-transforms'
	implementation 'org.apache.grails:grails-converters'
	implementation 'org.apache.grails:grails-events' // Events Plugin is required to implement EventBus
	implementation 'org.springframework.boot:spring-boot'
	implementation 'org.springframework:spring-context-support'
	implementation 'org.springframework:spring-core'
	implementation 'org.springframework.security:spring-security-crypto'
	implementation 'org.springframework:spring-tx'

	compileOnly 'jline:jline' // for shell commands
	compileOnly 'org.apache.groovy:groovy' // Compile-time annotations
	compileOnly 'jakarta.servlet:jakarta.servlet-api' // Provided
	compileOnly 'org.slf4j:slf4j-nop' // Prevents warnings about missing slf4j implementation during compilation

	runtimeOnly 'org.apache.grails:grails-services' // A service is defined in the plugin

	testImplementation 'org.apache.grails:grails-testing-support-datamapping'
	testImplementation 'org.apache.grails:grails-testing-support-web'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
	testImplementation 'org.spockframework:spock-core'
	testImplementation 'org.springframework:spring-test'
	testImplementation 'org.springframework.security:spring-security-config'

	testRuntimeOnly 'net.bytebuddy:byte-buddy'
	testRuntimeOnly 'org.slf4j:slf4j-nop' // Prevents warnings about missing slf4j implementation during tests
}

apply {
	from rootProject.layout.projectDirectory.file('gradle/plugin-config.gradle')
	from rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
	from rootProject.layout.projectDirectory.file('gradle/groovydoc-config.gradle')
	from rootProject.layout.projectDirectory.file('gradle/test-config.gradle')
	from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle')
	from rootProject.layout.projectDirectory.file('gradle/reproducible-config.gradle')
}
