-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.gradle
117 lines (94 loc) · 3.16 KB
/
build.gradle
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
import java.text.SimpleDateFormat
import java.util.stream.Collectors
def properties(String key) {
return project.findProperty(key).toString()
}
plugins {
id "java"
id "org.jetbrains.kotlin.jvm" version "1.8.20"
id "org.jetbrains.intellij" version "1.13.3"
id "org.jetbrains.changelog" version "2.0.0"
id "org.jlleitschuh.gradle.ktlint" version "11.3.2"
id "org.kordamp.gradle.markdown" version "2.2.0"
}
apply plugin: "org.jetbrains.changelog"
group pluginGroup
// Value will be set in pipeline
// if not pick it up from the properties.
def resolvedPluginVersion = System.getenv().getOrDefault("VERSION", getProperty("pluginVersion"))
version resolvedPluginVersion
sourceCompatibility = 1.8
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation "commons-io:commons-io:2.11.0"
implementation 'io.sentry:sentry:6.18.1'
testImplementation "junit:junit:4.13.2"
testImplementation "org.jetbrains.kotlin:kotlin-test:1.8.20"
testImplementation "org.mockito:mockito-core:5.+"
testImplementation "org.assertj:assertj-core:3.24.2"
testImplementation "io.mockk:mockk:1.13.5"
}
configurations {
// sentry brings in a slf4j that breaks when
// with the platform slf4j
implementation.exclude group: "org.slf4j"
}
intellij {
pluginName.set(properties("pluginName"))
version.set(properties("platformVersion"))
type.set(properties("platformType"))
downloadSources.set(properties("platformDownloadSources").toBoolean())
updateSinceUntilBuild.set(true)
plugins.set(Collections.singletonList("io.unthrottled.amii:${amiiVersion}"))
println "Building for IntelliJ version: ${version}"
}
// Configure gradle-changelog-plugin plugin.
// Read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
version = resolvedPluginVersion
header = "[$resolvedPluginVersion] - ${new SimpleDateFormat("yyyy-MM-dd").format(new Date())}"
groups = []
}
markdownToHtml {
sourceDir file("${project.projectDir}/docs")
outputDir file("${project.buildDir}/html")
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
tasks.runPluginVerifier {
ideVersions.set(
pluginVerifierIdeVersions.split(',').stream()
.map(String::trim)
.filter(version -> !version.isEmpty())
.collect(Collectors.toList())
)
}
tasks.runIde {
idePath = properties("idePath")
if (!idePath.isEmpty()) {
ideDir.set(file(idePath))
}
}
tasks.publishPlugin {
token.set(System.getenv().getOrDefault("PUBLISH_TOKEN", ""))
channels.set(Collections.singletonList(System.getenv().getOrDefault("PUBLISH_CHANNEL", "")))
}
tasks.patchPluginXml {
sinceBuild.set(sinceBuildVersion)
untilBuild.set(untilBuildVersion)
changeNotes.set(changelog.getUnreleased().toHTML())
def description = "${project.buildDir}/html/plugin.html"
if (file(description).exists()) {
pluginDescription.set(file(description).text)
println "Successfully patched plugin description."
}
}
tasks.publishPlugin.dependsOn("patchChangelog")
tasks.patchPluginXml.dependsOn("markdownToHtml")