-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
130 lines (110 loc) · 4.87 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val mockkVersion = "1.13.9"
val tokenSupportVersion = "4.1.3"
val springdocVersion = "1.7.0"
val navFoedselsnummerVersion = "1.0-SNAPSHOT.6"
val kontrakterVersion = "3.0_20240215101759_cea211f"
val mainClass = "no.nav.familie.ef.infotrygd.Main"
val ktlint by configurations.creating
plugins {
val kotlinVersion = "1.9.22"
val springBootVersion = "3.2.2"
id("org.springframework.boot") version springBootVersion
id("io.spring.dependency-management") version "1.1.4"
kotlin("jvm") version kotlinVersion
kotlin("plugin.spring") version kotlinVersion
kotlin("plugin.jpa") version kotlinVersion
}
group = "no.nav"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_21
java.targetCompatibility = JavaVersion.VERSION_21
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
maven {
name = "Github"
url = uri("https://maven.pkg.github.com/navikt/nav-foedselsnummer")
credentials {
username = "x-access-token" //project.findProperty("gpr.user") as String? ?: System.getenv("GPR_USER")
password = System.getenv("GPR_API_KEY") ?: System.getenv("GITHUB_TOKEN") ?: project.findProperty("gpr.key") as String?
}
}
}
dependencies {
ktlint("com.pinterest:ktlint:0.51.0-FINAL") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
}
}
implementation("nav-foedselsnummer:core:$navFoedselsnummerVersion")
testImplementation("nav-foedselsnummer:testutils:$navFoedselsnummerVersion")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("io.micrometer:micrometer-core")
implementation("io.micrometer:micrometer-registry-prometheus")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("net.ttddyy:datasource-proxy:1.10")
implementation("no.nav.security:token-validation-spring:$tokenSupportVersion")
implementation("no.nav.familie.kontrakter:enslig-forsorger:$kontrakterVersion")
implementation("no.nav.familie.kontrakter:felles:$kontrakterVersion")
testImplementation("no.nav.security:token-validation-spring-test:$tokenSupportVersion")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.springdoc:springdoc-openapi-ui:$springdocVersion")
implementation("org.springdoc:springdoc-openapi-kotlin:$springdocVersion")
implementation("net.logstash.logback:logstash-logback-encoder:7.4")
implementation("org.springframework.boot:spring-boot-starter-jdbc")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
runtimeOnly("org.postgresql:postgresql")
implementation("com.oracle.database.jdbc:ojdbc8:23.3.0.23.09")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("com.github.doyaaaaaken:kotlin-csv-jvm:1.9.3")
testImplementation("org.testcontainers:oracle-xe:1.19.5")
testImplementation("com.h2database:h2")
testImplementation("org.flywaydb:flyway-core")
testImplementation("io.mockk:mockk-jvm:$mockkVersion")
}
val inputFiles = project.fileTree(mapOf("dir" to "src", "include" to "**/*.kt"))
val ktlintCheck by tasks.creating(JavaExec::class) {
inputs.files(inputFiles)
// outputs.dir(outputDir)
description = "Check Kotlin code style."
classpath = ktlint
mainClass.set("com.pinterest.ktlint.Main")
args = listOf("src/**/*.kt")
}
val ktlintFormat by tasks.creating(JavaExec::class) {
inputs.files(inputFiles)
// outputs.dir(outputDir)
description = "Fix Kotlin code style deviations."
classpath = ktlint
mainClass.set("com.pinterest.ktlint.Main")
args = listOf("-F", "src/**/*.kt")
jvmArgs = listOf("--add-opens", "java.base/java.lang=ALL-UNNAMED")
}
tasks.withType<KotlinCompile> {
dependsOn("ktlintFormat")
dependsOn("ktlintCheck")
tasks.findByName("ktlintCheck")?.mustRunAfter("ktlintFormat")
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "21"
}
}
extensions.findByName("buildScan")?.withGroovyBuilder {
setProperty("termsOfServiceUrl", "https://gradle.com/terms-of-service")
setProperty("termsOfServiceAgree", "yes")
}
tasks.test {
jvmArgs = listOf("-Dnet.bytebuddy.experimental=true")
}
// tasks.findByName('publish').mustRunAfter 'build'