-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
122 lines (99 loc) · 3.05 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
116
117
118
119
120
121
122
import org.jetbrains.changelog.Changelog
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.models.ProductRelease
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.jetbrains.kotlin.jvm") version "2.0.21"
id("org.jetbrains.intellij.platform") version "2.1.0"
id("org.jetbrains.changelog") version "2.2.0"
}
var isRust = true
val suf = if (isRust) "RR" else "IU"
group = "shop.itbug"
version = "2.2.0.$suf"
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
releases()
marketplace()
jetbrainsRuntime()
}
}
fun getChangelogVersion(): String {
val v = project.version as String
return v.removeSuffix(".$suf")
}
dependencies {
intellijPlatform {
if (isRust) {
rustRover("2024.3")
bundledPlugins("JavaScript", "com.jetbrains.rust", "org.toml.lang", "com.intellij.modules.json")
plugins("com.intellij.database:243.15521.0")
} else {
local("/Applications/IntelliJ IDEA Ultimate.app")
plugins("com.jetbrains.rust:243.21565.245")
bundledPlugins("org.toml.lang", "JavaScript", "com.intellij.modules.json", "com.intellij.database")
}
zipSigner()
instrumentationTools()
pluginVerifier()
jetbrainsRuntime()
}
}
val pushToken: String? = System.getenv("PUBLISH_TOKEN")
tasks {
withType<KotlinCompile> {
compilerOptions {
languageVersion.set(KotlinVersion.KOTLIN_2_1)
}
}
val myChangeLog = provider {
changelog.renderItem(
changelog
.getOrNull(project.version as String) ?: changelog.getUnreleased()
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML
)
}
val descText = projectDir.resolve("DESCRIPTION.md").readText()
patchPluginXml {
sinceBuild.set("243")
untilBuild.set("243.*")
changeNotes.set(myChangeLog)
pluginDescription.set(descText)
}
signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}
publishPlugin {
if (pushToken != null) {
token.set(pushToken)
}
}
runIde {
autoReload = true
jvmArgs = listOf("-XX:+AllowEnhancedClassRedefinition")
}
verifyPlugin {
failureLevel = VerifyPluginTask.FailureLevel.ALL
}
printProductsReleases {
channels = listOf(ProductRelease.Channel.RELEASE)
types = listOf(IntelliJPlatformType.RustRover)
}
buildSearchableOptions {
enabled = false
}
}
println(getChangelogVersion())
changelog {
version = getChangelogVersion()
path = file("CHANGELOG.md").canonicalPath
groups.empty()
}