generated from JetBrains-Research/llm-integration-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
79 lines (64 loc) · 2.16 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
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML
fun properties(key: String) = project.findProperty(key).toString()
dependencies {
implementation("org.junit.jupiter:junit-jupiter:5.8.1")
testImplementation("junit:junit:4.13.2")
testImplementation("org.mongodb:mongodb-driver-sync:4.9.0") // added this line for MongoDB driver
implementation(kotlin("stdlib-jdk8"))
}
plugins {
id("java")
id("org.jetbrains.changelog") version "2.0.0"
id("org.jetbrains.intellij") version "1.12.0"
kotlin("jvm") version "1.8.21"
}
group = properties("pluginGroup")
version = properties("pluginVersion")
repositories {
mavenCentral()
}
kotlin {
jvmToolchain(17)
}
intellij {
pluginName.set(properties("pluginName"))
version.set(properties("platformVersion"))
type.set(properties("platformType"))
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
}
changelog {
groups.set(emptyList())
repositoryUrl.set(properties("pluginRepositoryUrl"))
}
tasks {
wrapper {
gradleVersion = properties("gradleVersion")
}
buildPlugin {
archiveFileName.set("llm-extract-function.zip")
}
patchPluginXml {
version.set(properties("pluginVersion"))
sinceBuild.set(properties("pluginSinceBuild"))
untilBuild.set(properties("pluginUntilBuild"))
pluginDescription.set(
file("README.md").readText().lines().run {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"
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(it) }
)
changeNotes.set(provider {
with(changelog) {
renderItem(
getOrNull(properties("pluginVersion")) ?: getLatest(),
Changelog.OutputType.HTML,
)
}
})
}
}