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

plugins {
	id 'org.springframework.boot' version '2.7.7'
	id 'io.spring.dependency-management' version '1.0.15.RELEASE'
	id 'org.jetbrains.kotlin.jvm' version '1.7.21'
	id 'org.jetbrains.kotlin.plugin.spring' version '1.7.21'
	id 'org.jetbrains.kotlin.plugin.jpa' version '1.7.21'
	id 'org.jetbrains.kotlin.plugin.allopen' version '1.7.21'
	id 'org.jetbrains.kotlin.kapt' version '1.7.21'
}

group = 'de.thpeetz.kontor'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

repositories {
	mavenCentral()
}

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
	implementation 'org.springframework.boot:spring-boot-starter-mustache'
	implementation 'org.springframework.boot:spring-boot-starter-web'
	implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
	implementation 'org.jetbrains.kotlin:kotlin-reflect'
	implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
	developmentOnly 'org.springframework.boot:spring-boot-devtools'
	kapt 'org.springframework.boot:spring-boot-configuration-processor'
	runtimeOnly 'com.h2database:h2'
	runtimeOnly 'org.springframework.boot:spring-boot-devtools'
	testImplementation("org.springframework.boot:spring-boot-starter-test") {
		exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
		exclude module: 'mockito-core'
	}
	testImplementation 'org.junit.jupiter:junit-jupiter-api'
	testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
	testImplementation 'com.ninja-squad:springmockk:3.1.1'


}

tasks.withType(KotlinCompile) {
	kotlinOptions {
		freeCompilerArgs = ['-Xjsr305=strict']
		jvmTarget = '11'
	}
}

tasks.named('test') {
	useJUnitPlatform()
}

allOpen {
	annotation("javax.persistence.Entity")
	annotation("javax.persistence.Embeddable")
	annotation("javax.persistence.MappedSuperclass")
}
