group = "space.nstart.pcp"

plugins {
	kotlin("jvm")
	kotlin("plugin.spring")
	kotlin("plugin.lombok")
	id("org.springframework.boot")
	id("io.spring.dependency-management")
	//id("org.sonarqube")
	jacoco
}

version = "1.0.0"


kotlin {
	jvmToolchain((property("versions.java") as String).toInt())
	compilerOptions {
		freeCompilerArgs.addAll("-Xjsr305=strict")
		jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(property("versions.java") as String))
	}
}

configurations {
	compileOnly {
		extendsFrom(configurations.annotationProcessor.get())
	}
}

dependencies {
	implementation(project(":libs:ballistics-lib"))
	implementation(project(":libs:pcp-types-lib"))
	implementation("org.springframework.boot:spring-boot-starter-logging")
	implementation("org.springframework.boot:spring-boot-starter-validation")
	implementation("jakarta.validation:jakarta.validation-api")
	implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
	implementation("org.springframework.boot:spring-boot-starter-web")

	implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
	implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
	implementation("org.springframework.boot:spring-boot-starter-webflux")
	implementation("org.springframework.cloud:spring-cloud-starter-config")

	implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:${property("versions.open-api")}")
	implementation("org.projectlombok:lombok")

	implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
	implementation("org.thymeleaf.extras:thymeleaf-extras-springsecurity6")

	implementation("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:3.2.1")
	implementation("org.webjars.npm:cesium:1.107.2")
//	implementation("org.webjars.npm:cesium:1.116.0")
	implementation("org.webjars:bootstrap:5.3.0")
	implementation("org.webjars:jquery:3.6.2")
	implementation("org.webjars:webjars-locator:0.45")


	implementation("org.locationtech.jts:jts-core:1.19.0")

	testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
	testImplementation("org.springframework.boot:spring-boot-starter-test")
}

kotlin {
	compilerOptions {
		freeCompilerArgs.addAll("-Xjsr305=strict", "-Xannotation-default-target=param-property")
		jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(property("versions.java") as String))
	}
}

tasks.withType<Test> {
	useJUnitPlatform()
}

dependencyManagement {
	imports {
		mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("versions.spring.cloud")}")
	}
}
