-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle.kts
101 lines (90 loc) · 2.84 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
plugins {
java
alias(libs.plugins.eclipse.apt)
alias(libs.plugins.spotless)
alias(libs.plugins.doma.compile)
}
// Retain a reference to rootProject.libs to make the version catalog accessible within allprojects and subprojects.
// See https://github.com/gradle/gradle/issues/16708
val catalog = libs
allprojects {
apply(plugin = "base")
apply(plugin = catalog.plugins.spotless.get().pluginId)
repositories {
mavenCentral()
mavenLocal()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")
}
spotless {
lineEndings = com.diffplug.spotless.LineEnding.UNIX
java {
googleJavaFormat(catalog.google.java.format.get().version)
}
kotlinGradle {
ktlint(catalog.ktlint.get().version)
}
format("misc") {
target("**/*.gitignore", "**/*.md")
targetExclude("**/bin/**", "**/build/**")
leadingTabsToSpaces()
trimTrailingWhitespace()
endWithNewline()
}
}
tasks {
build {
dependsOn(spotlessApply)
}
}
}
subprojects {
apply(plugin = "java")
apply(plugin = catalog.plugins.eclipse.apt.get().pluginId)
apply(plugin = catalog.plugins.spotless.get().pluginId)
apply(plugin = catalog.plugins.doma.compile.get().pluginId)
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
}
withType<Test> {
useJUnitPlatform()
}
}
dependencies {
annotationProcessor(catalog.doma.processor)
implementation(catalog.doma.core)
implementation(catalog.doma.slf4j)
runtimeOnly(catalog.logback.classic)
runtimeOnly(catalog.jdbc.h2)
testImplementation(catalog.junit.jupiter.api)
testRuntimeOnly(catalog.junit.jupiter.engine)
}
eclipse {
classpath {
file {
whenMerged {
val classpath = this as org.gradle.plugins.ide.eclipse.model.Classpath
val folder =
org.gradle.plugins.ide.eclipse.model
.SourceFolder(".apt_generated", "bin/main")
classpath.entries.add(folder)
val dir = file(folder.path)
if (!dir.exists()) {
dir.mkdir()
}
}
}
}
project {
buildCommand("org.eclipse.buildship.core.gradleprojectbuilder")
natures("org.eclipse.buildship.core.gradleprojectnature")
}
// Reset all Eclipse settings when "Refresh Gradle Project" is executed
synchronizationTasks("cleanEclipse", "eclipse")
}
}