forked from JetBrains/ideavim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
164 lines (139 loc) · 3.87 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
import dev.feedforward.markdownto.DownParser
buildscript {
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "com.github.AlexPl292:mark-down-to-slack:1.1.2"
}
}
plugins {
id 'org.jetbrains.intellij' version '0.6.5'
id 'io.gitlab.arturbosch.detekt' version '1.14.1'
id "org.jetbrains.changelog" version "0.6.2"
}
apply plugin: 'java'
apply plugin: 'kotlin'
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
sourceSets {
main {
java.srcDir 'src'
resources.srcDir 'resources'
}
test {
java.srcDir 'test'
}
}
intellij {
version ideaVersion
pluginName 'IdeaVim'
updateSinceUntilBuild false
downloadSources Boolean.valueOf(downloadIdeaSources)
instrumentCode Boolean.valueOf(instrumentPluginCode)
intellijRepo = "https://www.jetbrains.com/intellij-repository"
plugins = ['java']
downloadRobotServerPlugin.version = "0.10.0"
publishPlugin {
channels publishChannels.split(',')
username publishUsername
token publishToken
}
}
runIdeForUiTests {
systemProperty "robot-server.port", "8082"
}
runPluginVerifier {
ideVersions = ["IC-2020.1.4", "IC-2020.2.3"]
downloadDirectory = "${project.buildDir}/pluginVerifier/ides"
teamCityOutputFormat = true
}
repositories {
mavenCentral()
jcenter()
maven { url = "https://jetbrains.bintray.com/intellij-third-party-dependencies" }
}
dependencies {
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
compileOnly "org.jetbrains:annotations:20.1.0"
// https://mvnrepository.com/artifact/com.ensarsarajcic.neovim.java/neovim-api
testImplementation("com.ensarsarajcic.neovim.java:neovim-api:0.1.16")
testImplementation("com.intellij.remoterobot:remote-robot:0.10.0")
testImplementation("com.intellij.remoterobot:remote-fixtures:1.1.18")
}
compileKotlin {
kotlinOptions {
jvmTarget = javaVersion
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = javaVersion
}
}
detekt {
config = files("${rootProject.projectDir}/.detekt/config.yaml")
baseline = file("${rootProject.projectDir}/.detekt/baseline.xml")
input = files("src")
buildUponDefaultConfig = true
reports {
html.enabled = false
xml.enabled = false
txt.enabled = false
}
}
tasks.detekt.jvmTarget = javaVersion
task testWithNeovim(type: Test) {
group = "verification"
systemProperty "ideavim.nvim.test", 'true'
}
changelog {
groups = ["Features:", "Changes:", "Deprecations:", "Fixes:", "Merged PRs:"]
itemPrefix = "*"
path = "${project.projectDir}/CHANGES.md"
unreleasedTerm = "To Be Released"
headerParserRegex = /0\.\d{2}(.\d+)?/
// header = { "${project.version}" }
// version = "0.60"
}
task getUnreleasedChangelog() {
group = "changelog"
doLast {
def log = changelog.getUnreleased().toHTML()
println log
}
}
tasks.register("slackEapNotification") {
doLast {
if (!slackUrl) return
def post = new URL(slackUrl).openConnection()
def changeLog = changelog.getUnreleased().toText()
def slackDown = new DownParser(changeLog, true).toSlack().toString()
def message = """
{
"text": "New version of IdeaVim",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "IdeaVim EAP $version has been released\\n$slackDown"
}
}
]
}
"""
post.setRequestMethod("POST")
post.setDoOutput(true)
post.setRequestProperty("Content-Type", "application/json")
post.getOutputStream().write(message.getBytes("UTF-8"))
def postRC = post.getResponseCode()
println(postRC)
if (postRC == 200) {
println(post.getInputStream().getText())
}
}
}