-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
146 lines (118 loc) · 5.17 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.ExtensionsKt
plugins {
id "java"
// https://plugins.gradle.org/plugin/org.jetbrains.intellij
id "org.jetbrains.intellij" version "1.17.4"
// https://plugins.gradle.org/plugin/org.jetbrains.kotlin.jvm
id "org.jetbrains.kotlin.jvm" version "2.0.21"
// https://plugins.gradle.org/plugin/org.jetbrains.kotlinx.kover
id "org.jetbrains.kotlinx.kover" version "0.8.3"
// https://plugins.gradle.org/plugin/org.jetbrains.changelog
id "org.jetbrains.changelog" version "2.2.1"
}
repositories {
maven { url "https://www.jetbrains.com/intellij-repository/snapshots" }
maven { url "https://www.jetbrains.com/intellij-repository/releases" }
mavenCentral()
}
buildSearchableOptions {
enabled = false
}
def property = { String key -> providers.gradleProperty(key) }
def environment = { String key -> providers.environmentVariable(key) }
def versionRegex = ~/-([^.]*)/
group "org.vyperlang.plugin"
version property("pluginVersion").get()
intellij {
plugins = []
version = "2024.1.4"
}
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
groups.empty()
repositoryUrl = "https://github.com/DanielSchiavini/vyper-plugin"
}
dependencies {
// https://mvnrepository.com/artifact/com.github.docker-java/docker-java
implementation group: "com.github.docker-java", name: "docker-java", version: "3.4.0"
// https://mvnrepository.com/artifact/com.github.docker-java/docker-java-transport-httpclient5
implementation group: "com.github.docker-java", name: "docker-java-transport-httpclient5", version: "3.4.0"
// https://mvnrepository.com/artifact/com.github.kittinunf.fuel/fuel-coroutines
implementation group: "com.github.kittinunf.fuel", name: "fuel-coroutines", version: "2.3.1"
// https://mvnrepository.com/artifact/com.github.kittinunf.fuel/fuel
implementation group: "com.github.kittinunf.fuel", name: "fuel", version: "2.3.1"
// https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation group: "com.google.code.gson", name: "gson", version: "2.11.0"
// https://mvnrepository.com/artifact/junit/junit
testImplementation group: "junit", name: "junit", version: "4.13.2" // v5 not supported by base JetBrains tests
// https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core
testImplementation group: "org.jetbrains.kotlinx", name: "kotlinx-coroutines-core", version: "1.8.1"
// https://mvnrepository.com/artifact/io.mockk/mockk
testImplementation group: "io.mockk", name: "mockk", version: "1.13.13"
}
configurations {
// turn of when test docker without deploying plugin
compile.exclude module: "slf4j-api"
}
kotlin {
jvmToolchain(17)
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
// Include the generated files in the source set
sourceSets.main.java.srcDirs 'src/main/gen'
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
kover {
reports {
total {
xml {
onCheck = true
}
}
}
}
tasks {
patchPluginXml {
version = property("pluginVersion").get()
sinceBuild = "241"
untilBuild = "243.*"
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin"s manifest
pluginDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
def start = "<!-- Plugin description -->"
def end = "<!-- Plugin description end -->"
def lines = it.readLines()
if (!lines.containsAll([start, end])) {
throw new GradleException("Plugin description section not found in README.md:\n$start ... $end")
}
def text = lines.subList(lines.indexOf(start) + 1, lines.indexOf(end)).join("\n")
return ExtensionsKt.markdownToHTML(text, "\n")
}
changeNotes = provider {
//noinspection GroovyAssignabilityCheck
changelog.renderItem(
(changelog.getOrNull(pluginVersion) ?: changelog.getUnreleased())
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML
)
}
}
signPlugin {
certificateChain = environment("CERTIFICATE_CHAIN")
privateKey = environment("PRIVATE_KEY")
password = environment("PRIVATE_KEY_PASSWORD")
}
publishPlugin {
dependsOn("patchChangelog")
token = environment("PUBLISH_TOKEN")
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
channels = property("pluginVersion").map {
[it ==~ versionRegex ? (it =~ versionRegex)[0][1] as String : "default"]
}
}
}