plugins {
	id "org.jetbrains.kotlin.jvm" apply false
	id "io.spring.nohttp" version "0.0.10"
}


description = "${projectName} build"

defaultTasks "build"

ext {
	javaProjects = subprojects
}

nohttp {
	allowlistFile = project.file("src/nohttp/whitelist.lines")
	source.exclude "**/bin/**"
	source.exclude "**/build/**"
	source.exclude "**/out/**"
	source.exclude "**/target/**"
	source.exclude "**/frontend/**"
}

task build {
	dependsOn checkstyleNohttp
}

configure([rootProject] + javaProjects) { project ->
	group "${groupId}"

	repositories {
		mavenCentral()
	}

	configurations.all {
		resolutionStrategy {
			cacheChangingModulesFor 0, "seconds"
			cacheDynamicVersionsFor 0, "seconds"
		}
	}
}


configure(javaProjects) { project ->
	apply plugin: "java-library"
	apply plugin: "io.easybest.gradle.plugin.conventions"
	apply plugin: "io.easybest.gradle.plugin.deployed"
	apply plugin: "io.easybest.gradle.plugin.optional-dependencies"

	sourceCompatibility = 1.8
	targetCompatibility = 1.8

	java {
		toolchain {
			languageVersion = JavaLanguageVersion.of(8)
		}
	}
}

