-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
77 lines (66 loc) · 1.88 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
plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.spotless)
}
tasks.register("installGitHooks") {
doLast {
val gitHooksDir = File(rootDir, ".git/hooks")
val preCommitFile = File(gitHooksDir, "pre-commit")
val preCommitScript = File(rootDir, "scripts/pre-commit-script.sh")
if (!gitHooksDir.exists()) {
throw GradleException(".git/hooks directory does not exist. Are you in the right directory?")
}
if (!preCommitScript.exists()) {
throw GradleException("scripts/pre-commit-script.sh does not exist. Are you in the right directory?")
}
preCommitScript.copyTo(preCommitFile, true)
preCommitFile.setExecutable(true)
}
}
allprojects {
configurations.configureEach {
exclude(group = "com.jetbrains.rd")
exclude(group = "com.github.jetbrains", module = "jetCheck")
exclude(group = "com.jetbrains.infra")
exclude(group = "com.jetbrains.intellij.platform", module = "wsl-impl")
exclude(group = "org.roaringbitmap")
exclude(group = "ai.grazie.spell")
exclude(group = "ai.grazie.model")
exclude(group = "ai.grazie.utils")
exclude(group = "ai.grazie.nlp")
}
repositories {
mavenCentral()
}
}
subprojects {
apply {
plugin("org.jetbrains.kotlin.jvm")
}
}
val ktlintEditorConfigOverride = mapOf(
"indent_size" to 2,
"ktlint_standard_discouraged-comment-location" to "disabled",
)
spotless {
kotlin {
target("**/*.kt")
targetExclude("**/build/**/*.*")
ktlint()
.editorConfigOverride(ktlintEditorConfigOverride)
trimTrailingWhitespace()
endWithNewline()
}
kotlinGradle {
target("**/*.gradle.kts")
ktlint()
.editorConfigOverride(ktlintEditorConfigOverride)
trimTrailingWhitespace()
endWithNewline()
}
format("misc") {
target("**/test/fixtures_*/**/*.*", "**/*.sqm", "**/*.sq")
trimTrailingWhitespace()
endWithNewline()
}
}