-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle.kts
76 lines (63 loc) · 2.15 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
/**
* Provides a property for a key
*/
fun properties(key: String): Provider<String> {
return providers.gradleProperty(key)
}
/**
* Provides an environment variable
*/
fun environment(key: String) = providers.environmentVariable(key)
// its sadly not possible to put these values in a properties file
plugins {
id("java")
// https://github.com/JetBrains/kotlin/releases
// https://kotlinlang.org/docs/gradle-configure-project.html#kotlin-gradle-plugin-data-in-a-project
kotlin("jvm") version "1.9.21"
// https://github.com/JetBrains/intellij-platform-gradle-plugin/releases?page=2
id("org.jetbrains.intellij") version "1.17.4"
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
}
group = properties("pluginGroup").get()
repositories {
mavenCentral()
}
dependencies {
// JSON parsing
implementation("com.google.code.gson:gson:2.10.1")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.2")
}
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
pluginName.set(properties("pluginName").get())
version.set(properties("platformVersion").get())
// PythonCore: https://plugins.jetbrains.com/plugin/7322-python-community-edition/versions
// Pythonid: https://plugins.jetbrains.com/plugin/631-python/versions
plugins.set(listOf("Git4Idea", "PythonCore:241.14494.240", "maven", "gradle"))
}
tasks {
patchPluginXml {
sinceBuild.set(properties("pluginSinceBuild").get())
// Orion Plugin version. Needs to be incremented for every new release!
version.set(
environment("PLUGIN_VERSION").getOrElse("0.0.0")
)
val cn = environment("CHANGELOG").getOrElse("")
if (cn.isNotBlank()) {
changeNotes.set(cn)
} else {
changeNotes.set("No changelog provided.")
}
}
publishPlugin {
dependsOn("patchPluginXml")
token = environment("PUBLISH_TOKEN")
}
}