generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 21
/
build.gradle.kts
116 lines (105 loc) · 3.75 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
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.date
import org.jetbrains.changelog.markdownToHTML
plugins {
id("java")
id("org.jetbrains.changelog") version "2.2.1"
id("org.jetbrains.intellij.platform") version "2.0.1"
}
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
dependencies {
implementation("org.json:json:20240303")
implementation("com.google.code.gson:gson:2.11.0")
implementation("org.apache.xmlgraphics:batik-all:1.17") {
exclude("xml-apis", "xml-apis")
}
implementation("com.twelvemonkeys.imageio:imageio-webp:3.10.1")
implementation("com.twelvemonkeys.imageio:imageio-batik:3.10.1")
implementation("net.coobird:thumbnailator:0.4.20")
implementation("com.squareup.okhttp3:mockwebserver:4.12.0")
implementation("com.tinify:tinify:1.8.3")
implementation("org.freemarker:freemarker:2.3.33")
intellijPlatform {
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion"))
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
instrumentationTools()
pluginVerifier()
zipSigner()
}
}
changelog {
version.set(providers.gradleProperty("pluginVersion"))
path.set(file("CHANGELOG.md").canonicalPath)
header.set(provider { "[${version.get()}] - ${date()}" })
headerParserRegex.set("""(\d+\.\d+\.\d+)""".toRegex())
itemPrefix.set("-")
keepUnreleasedSection.set(true)
unreleasedTerm.set("[未完待续]")
groups.set(listOf(""))
}
intellijPlatform {
pluginConfiguration {
version = providers.gradleProperty("pluginVersion")
description = providers.fileContents(layout.projectDirectory.file("PLUGIN_DESC.md")).asText.map {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"
with(it.lines()) {
if (!containsAll(listOf(start, end))) {
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
}
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
}
}
ideaVersion {
sinceBuild = providers.gradleProperty("pluginSinceBuild")
untilBuild = provider { null }
}
val changelog = project.changelog
changeNotes = providers.gradleProperty("pluginVersion").map { pluginVersion ->
with(changelog) {
renderItem(
(getOrNull(pluginVersion) ?: getUnreleased())
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML,
)
}
}
}
signing {
certificateChainFile.set(project.file("profiles/chain.crt"))
privateKeyFile.set(project.file("profiles/private.pem"))
password.set(providers.environmentVariable("PRIVATE_KEY_PASSWORD"))
}
publishing {
token = providers.environmentVariable("PUBLISH_TOKEN")
channels = providers.gradleProperty("pluginVersion")
.map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
}
pluginVerification {
ides {
recommended()
}
}
}
intellijPlatformTesting {
runIde {
register("runOnAndroidStudio") {
localPath = file(providers.gradleProperty("asPath"))
}
}
}
tasks {
wrapper {
gradleVersion = providers.gradleProperty("gradleVersion").get()
}
publishPlugin {
dependsOn(patchChangelog)
}
}