-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
98 lines (89 loc) · 3.85 KB
/
build.gradle.kts
File metadata and controls
98 lines (89 loc) · 3.85 KB
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
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformDependenciesExtension
import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform
import org.jetbrains.intellij.platform.gradle.plugins.project.IntelliJPlatformBasePlugin
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kover) apply false
alias(libs.plugins.jetbrains.compose) apply false
alias(libs.plugins.jetbrains.changelog) apply false
alias(libs.plugins.jetbrains.intellij) apply false
alias(libs.plugins.jetbrains.intellij.module) apply false
alias(libs.plugins.buildconfig) apply false
alias(libs.plugins.shadow) apply false
alias(libs.plugins.spotless) apply false
}
allprojects {
plugins.withType<IntelliJPlatformBasePlugin>().configureEach {
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html#configuration.repositories
repositories {
google {
mavenContent {
includeGroupAndSubgroups("androidx")
includeGroupAndSubgroups("com.android")
includeGroupAndSubgroups("com.google")
}
}
mavenCentral()
maven("https://www.jetbrains.com/intellij-repository/releases")
maven("https://www.jetbrains.com/intellij-repository/snapshots")
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
intellijPlatform {
defaultRepositories()
}
}
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html#setting-up-intellij-platform
dependencies {
extensions.configure<IntelliJPlatformDependenciesExtension> {
// https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
intellijIdea("2025.3")
bundledPlugin("org.jetbrains.kotlin")
// https://github.com/JetBrains/intellij-platform-compose-plugin-template
composeUI()
}
}
}
plugins.apply(rootProject.libs.plugins.spotless.get().pluginId)
extensions.configure<SpotlessExtension> {
kotlin {
target("src/**/*.kt")
targetExclude("src/test/resources/**")
ktlint(libs.ktlint.get().version)
.editorConfigOverride(
mapOf(
"ktlint_compose_lambda-param-event-trailing" to "disabled",
"compose_treat_as_lambda" to false,
"compose_disallow_material2" to true,
"compose_allowed_from_m2" to "icons",
"compose_preview_naming_enabled" to true,
"compose_preview_naming_strategy" to "suffix",
),
)
.customRuleSets(
listOf(
libs.composeRules.get().toString(),
),
)
}
kotlinGradle {
ktlint(libs.ktlint.get().version)
}
}
tasks.withType<JavaCompile>().configureEach {
options.release = libs.versions.jdkRelease.get().toInt()
}
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget = JvmTarget.fromTarget(libs.versions.jdkRelease.get())
freeCompilerArgs.add("-Xjdk-release=${libs.versions.jdkRelease.get()}")
}
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
}