-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
115 lines (94 loc) · 2.98 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version PluginVersions.SPRING_BOOT_FRAMEWORK_VERSION
id("io.spring.dependency-management") version PluginVersions.SPRING_DEPENDENCY_MANAGEMENT_VERSION
kotlin("jvm") version PluginVersions.JVM_VERSION
kotlin("plugin.spring") version PluginVersions.PLUGIN_SPRING_VERSION
kotlin("plugin.jpa") version PluginVersions.PLUGIN_JPA_VERSION
kotlin("kapt") version PluginVersions.KAPT_VERSION
}
group = "com.cheajib"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
}
dependencyManagement {
imports {
mavenBom(Dependency.CLOUD_AWS_DEPENDENCIES)
}
}
dependencies {
implementation(Dependency.VALIDATION)
implementation(Dependency.WEB)
implementation(Dependency.JACKSON)
implementation(Dependency.JPA)
implementation(Dependency.REFLECT)
implementation(Dependency.STDLIB_JDK8)
implementation(Dependency.SPRING_SECURITY)
implementation(Dependency.REDIS)
implementation(Dependency.CLOUD_AWS)
kapt(Dependency.QUERYDSL_PROCESSOR)
implementation(Dependency.QUERYDSL)
runtimeOnly(Dependency.MYSQL)
implementation(Dependency.OPENFEIGN)
implementation(Dependency.JWT)
}
kotlin.sourceSets.main {
kotlin.srcDir("$buildDir/generated/source/kapt/main")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
val ktlint: Configuration by configurations.creating
dependencies {
ktlint(Dependency.KTLINT) {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
}
}
}
val outputDir = "${project.buildDir}/reports/ktlint/"
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("**/*.kt", "**/*.kts")
}
// Formatting all source files
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", "**/*.kt")
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
}
allOpen {
annotation("javax.persistence.Entity")
annotation("javax.persistence.MappedSuperclass")
annotation("javax.persistence.Embeddable")
}
noArg {
annotation("javax.persistence.Entity")
annotation("javax.persistence.MappedSuperclass")
annotation("javax.persistence.Embeddable")
}
tasks.getByName<Jar>("jar") {
enabled = false
}