-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.gradle.kts
105 lines (86 loc) · 2.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
// See https://docs.gradle.org/current/kotlin-dsl/gradle/org.gradle.api/-project/find-property.html
fun properties(key: String) = project.findProperty(key).toString()
buildscript {
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(module("com.overzealous:remark:1.1.0")).using(module("com.wavefront:remark:2023-07.07"))
.because("not available on maven central anymore")
}
}
}
plugins {
id("java")
id("org.jetbrains.intellij.platform") version "2.0.0"
id("org.kordamp.gradle.markdown") version "2.2.0"
}
group = "io.github.frykher"
// Version is set by CI, GitHub Actions
version = System.getenv().getOrDefault("VERSION", "")
val markdownPath = File("$projectDir/build/markdown")
if (!markdownPath.exists()) {
markdownPath.mkdirs()
}
val htmlPath = File("$projectDir/build/html")
if (!htmlPath.exists()) {
htmlPath.mkdirs()
}
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
dependencies {
intellijPlatform {
create("IC", properties("platformVersion"))
bundledPlugin("com.intellij.java")
pluginVerifier()
zipSigner()
instrumentationTools()
}
}
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
tasks {
// Set the JVM compatibility versions
register<Copy>("copyREADME") {
from("$projectDir/README.md")
into(markdownPath)
}
register("createChangeNotes") {
doLast {
val mdChangeNotes = System.getenv().getOrDefault("CHANGE_NOTES", "None")
file("$markdownPath/CHANGE_NOTES.md").writeText(mdChangeNotes)
}
}
markdownToHtml {
dependsOn("copyREADME")
dependsOn("createChangeNotes")
sourceDir = markdownPath
outputDir = htmlPath
}
withType<JavaCompile> {
sourceCompatibility = "17"
targetCompatibility = "17"
}
patchPluginXml {
dependsOn("markdownToHtml")
// See https://github.com/catppuccin/jetbrains/blob/27949117de78e8f33f1d5bbeaec975ac9a7c15fe/build.gradle.kts
// for this rationale
sinceBuild.set(properties("pluginSinceBuild"))
untilBuild.set(properties("pluginUntilBuild"))
pluginDescription.set(provider {
file("$htmlPath/README.html").readText()
})
changeNotes.set(provider {
file("$htmlPath/CHANGE_NOTES.html").readText()
})
}
signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}
publishPlugin {
token.set(System.getenv("PUBLISH_TOKEN"))
}
}