import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

apply plugin: 'io.spring.convention.spring-module'
apply plugin: 'trang'
apply plugin: 'kotlin'

dependencies {
	// NB: Don't add other compile time dependencies to the config module as this breaks tooling
	compile project(':spring-security-core')
	compile 'org.springframework:spring-aop'
	compile 'org.springframework:spring-beans'
	compile 'org.springframework:spring-context'
	compile 'org.springframework:spring-core'

	optional project(':spring-security-ldap')
	optional project(':spring-security-messaging')
	optional project(':spring-security-saml2-service-provider')
	optional project(':spring-security-oauth2-client')
	optional project(':spring-security-oauth2-jose')
	optional project(':spring-security-oauth2-resource-server')
	optional project(':spring-security-openid')
	optional project(':spring-security-rsocket')
	optional project(':spring-security-web')
	optional 'io.projectreactor:reactor-core'
	optional 'org.aspectj:aspectjweaver'
	optional 'org.springframework:spring-jdbc'
	optional 'org.springframework:spring-messaging'
	optional 'org.springframework:spring-tx'
	optional 'org.springframework:spring-webmvc'
	optional'org.springframework:spring-web'
	optional'org.springframework:spring-webflux'
	optional'org.springframework:spring-websocket'
	optional 'org.jetbrains.kotlin:kotlin-reflect'
	optional 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'

	provided 'javax.servlet:javax.servlet-api'

	testCompile project(':spring-security-aspects')
	testCompile project(':spring-security-cas')
	testCompile project(':spring-security-test')
	testCompile project(path : ':spring-security-core', configuration : 'tests')
	testCompile project(path : ':spring-security-ldap', configuration : 'tests')
	testCompile project(path : ':spring-security-oauth2-client', configuration : 'tests')
	testCompile project(path : ':spring-security-oauth2-resource-server', configuration : 'tests')
	testCompile project(path : ':spring-security-saml2-service-provider', configuration : 'tests')
	testCompile project(path : ':spring-security-web', configuration : 'tests')
	testCompile apachedsDependencies
	testCompile powerMock2Dependencies
	testCompile 'com.squareup.okhttp3:mockwebserver'
	testCompile 'ch.qos.logback:logback-classic'
	testCompile 'io.projectreactor.netty:reactor-netty'
	testCompile 'io.rsocket:rsocket-transport-netty'
	testCompile 'javax.annotation:jsr250-api:1.0'
	testCompile 'javax.xml.bind:jaxb-api'
	testCompile 'ldapsdk:ldapsdk:4.1'
	testCompile('net.sourceforge.htmlunit:htmlunit') {
		exclude group: 'commons-logging', module: 'commons-logging'
	}
	testCompile 'org.eclipse.persistence:javax.persistence'
	testCompile 'org.hibernate:hibernate-entitymanager'
	testCompile 'org.hsqldb:hsqldb'
	testCompile ('org.openid4java:openid4java-nodeps') {
		exclude group: 'com.google.code.guice', module: 'guice'
	}
	testCompile('org.seleniumhq.selenium:htmlunit-driver') {
		exclude group: 'commons-logging', module: 'commons-logging'
	}
	testCompile('org.seleniumhq.selenium:selenium-java') {
		exclude group: 'commons-logging', module: 'commons-logging'
		exclude group: 'io.netty', module: 'netty'
	}
	testCompile 'org.slf4j:jcl-over-slf4j'
	testCompile 'org.springframework.ldap:spring-ldap-core'
	testCompile 'org.springframework:spring-expression'
	testCompile 'org.springframework:spring-jdbc'
	testCompile 'org.springframework:spring-orm'
	testCompile 'org.springframework:spring-tx'
	testCompile ('org.springframework.data:spring-data-jpa') {
		exclude group: 'org.aspectj', module: 'aspectjrt'
	}

	testRuntime 'org.hsqldb:hsqldb'
}


rncToXsd {
	rncDir = file('src/main/resources/org/springframework/security/config/')
	xsdDir = rncDir
	xslFile = new File(rncDir, 'spring-security.xsl')
}

tasks.withType(KotlinCompile).configureEach {
	kotlinOptions {
		jvmTarget = "1.8"
		freeCompilerArgs = ["-Xjsr305=strict"]
	}
}

build.dependsOn rncToXsd
