buildscript {
	repositories {
		jcenter()
	}

	dependencies {
		classpath 'org.kordamp.gradle:livereload-gradle-plugin:0.2.1'
	}
}

apply plugin: 'org.kordamp.gradle.livereload'
apply from: JAVA_GRADLE
apply plugin: 'org.asciidoctor.convert'

liveReload {
	docRoot asciidoctor.sourceDir.canonicalPath
}

repositories {
	maven { url 'http://dist.gemstone.com/maven/release' }
}

asciidoctorj {

}

tasks.findByPath("artifactoryPublish")?.enabled = false

dependencies {
		testCompile project(':spring-session'),
				"org.springframework.data:spring-data-gemfire:$springDataGemFireVersion",
				"org.springframework.data:spring-data-redis:$springDataRedisVersion",
				"org.springframework.data:spring-data-gemfire:$springDataGemFireVersion",
				"org.springframework:spring-websocket:${springVersion}",
				"org.springframework:spring-messaging:${springVersion}",
				"org.springframework.security:spring-security-web:${springSecurityVersion}",
				"org.springframework.security:spring-security-test:${springSecurityVersion}",
				'junit:junit:4.11',
				'org.mockito:mockito-core:1.9.5',
				"org.springframework:spring-test:$springVersion",
				"org.assertj:assertj-core:$assertjVersion",
				"com.hazelcast:hazelcast:$hazelcastVersion",
				"redis.clients:jedis:2.4.1",
				"javax.servlet:javax.servlet-api:$servletApiVersion"
}

asciidoctor {
	def ghTag = snapshotBuild ? 'master' : project.version
	def ghUrl = "https://github.com/spring-projects/spring-session/tree/$ghTag/"
	attributes	'version-snapshot': snapshotBuild,
			'version-milestone': milestoneBuild,
			'version-release': releaseBuild,
			'gh-url': ghUrl,
			'gh-samples-url': "$ghUrl/samples/",
			'download-url' : "https://github.com/spring-projects/spring-session/archive/${ghTag}.zip",
			'spring-session-version' : version,
			'spring-version' : springVersion,
			'hazelcast-version' : hazelcastVersion,
			'docs-itest-dir' : rootProject.projectDir.path + '/docs/src/integration-test/java/',
			'docs-test-dir' : rootProject.projectDir.path + '/docs/src/test/java/',
			'docs-test-resources-dir' : rootProject.projectDir.path + '/docs/src/test/resources/',
			'samples-dir' : rootProject.projectDir.path + '/samples/',

			'source-highlighter' : 'coderay',
			'imagesdir':'./images',
			'icons': 'font',
			'sectanchors':'',
			'idprefix':'',
			'idseparator':'-',
			'docinfo1':'true',
			'revnumber' : project.version
}
