Repository navigation
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
99 lines (84 loc) · 2.88 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
99 lines (84 loc) · 2.88 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
99
import java.util.Properties
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version "2.4.10"
id("org.jetbrains.intellij.platform") version "2.18.1"
}
group = providers.gradleProperty("pluginGroup").get()
version = providers.gradleProperty("pluginVersion").get()
// Личные настройки машины живут в local.properties и не коммитятся.
val localProperties = Properties().apply {
val file = rootProject.file("local.properties")
if (file.exists()) file.inputStream().use { load(it) }
}
fun setting(name: String): String? =
(localProperties.getProperty(name) ?: providers.gradleProperty(name).orNull)
?.takeIf { it.isNotBlank() }
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
dependencies {
intellijPlatform {
val localIdePath = setting("localIdePath") ?: System.getenv("LOCAL_IDE_PATH")
if (localIdePath.isNullOrBlank()) {
create(
providers.gradleProperty("platformType"),
providers.gradleProperty("platformVersion"),
)
} else {
local(localIdePath)
}
// Database Tools & SQL — оттуда LocalDataSource и всё остальное.
bundledPlugin("com.intellij.database")
testFramework(TestFrameworkType.Platform)
}
testImplementation("junit:junit:4.13.2")
}
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
}
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
intellijPlatform {
pluginConfiguration {
ideaVersion {
sinceBuild.set(providers.gradleProperty("pluginSinceBuild"))
untilBuild.set(provider { null })
}
}
pluginVerification {
ides {
recommended()
}
}
// Подпись сборки перед публикацией. Ключи берутся из окружения,
// в репозиторий они не попадают: см. раздел «Публикация» в README.
signing {
certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
privateKey = providers.environmentVariable("PRIVATE_KEY")
password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
}
publishing {
token = providers.environmentVariable("PUBLISH_TOKEN")
// Для превью-сборок: -PpublishChannel=eap → отдельный канал вместо стабильного.
channels = providers.gradleProperty("publishChannel")
.orElse("default")
.map { listOf(it) }
}
}
tasks {
test {
useJUnit()
testLogging {
events("passed", "skipped", "failed")
}
}
}