apply plugin: 'io.spring.convention.docs'
apply plugin: 'io.spring.convention.spring-test'

dependencies {
	testCompile project(':spring-session-core')
	testCompile project(':spring-session-data-redis')
	testCompile project(':spring-session-hazelcast')
	testCompile project(':spring-session-jdbc')
	testCompile 'org.springframework:spring-jdbc'
	testCompile 'org.springframework:spring-messaging'
	testCompile 'org.springframework:spring-webmvc'
	testCompile 'org.springframework:spring-websocket'
	testCompile 'org.springframework.security:spring-security-config'
	testCompile 'org.springframework.security:spring-security-web'
	testCompile 'org.springframework.security:spring-security-test'
	testCompile 'org.mockito:mockito-core'
	testCompile 'org.springframework:spring-test'
	testCompile 'org.assertj:assertj-core'
	testCompile 'com.hazelcast:hazelcast'
	testCompile 'io.lettuce:lettuce-core'
	testCompile 'javax.servlet:javax.servlet-api'
	testCompile 'org.junit.jupiter:junit-jupiter-api'
	testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}

def versions = dependencyManagement.managedVersions

asciidoctorPdf {
    clearSources()
    sources {
        include "index.adoc"
    }
}

asciidoctor {
    clearSources()
    sources {
        include "index.adoc"
        include "guides/*.adoc"
    }
}

asciidoctorj {
	def ghTag = snapshotBuild ? 'main' : project.version
	def ghUrl = "https://github.com/spring-projects/spring-session/tree/$ghTag"

	attributes 'docs-itest-dir': "$rootProject.projectDir.path/spring-session-docs/src/integration-test/java/",
			'docs-test-dir': "$rootProject.projectDir.path/spring-session-docs/src/test/java/",
			'docs-test-resources-dir': "$rootProject.projectDir.path/spring-session-docs/src/test/resources/",
			'download-url': "https://github.com/spring-projects/spring-session/archive/${ghTag}.zip",
			'gh-samples-url': "$ghUrl/spring-session-samples/",
			'gh-url': ghUrl,
			'hazelcast-version': versions['com.hazelcast:hazelcast'],
			'lettuce-version': versions['io.lettuce:lettuce-core'],
			'samples-dir': "$rootProject.projectDir.path/spring-session-samples/",
			'session-jdbc-main-resources-dir': "${project(':spring-session-jdbc').projectDir.path}/src/main/resources/",
			'spring-boot-version': project.springBootVersion,
			'spring-data-redis-version': versions['org.springframework.data:spring-data-redis'],
			'spring-framework-version': versions['org.springframework:spring-core'],
			'spring-security-version': versions['org.springframework.security:spring-security-core'],
			'spring-session-version': project.version,
			'version-milestone': milestoneBuild,
			'version-release': releaseBuild,
			'version-snapshot': snapshotBuild,
			'highlightjsdir@': "js/highlight",
			'docinfodir@': "."
}

repositories {
    maven { url "https://repo.spring.io/release" }
}
