-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
127 lines (110 loc) · 3.6 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
import org.jsoup.Jsoup
import pl.allegro.tech.build.axion.release.domain.TagNameSerializer
plugins {
id("java")
id("org.jetbrains.intellij") version("1.0")
id("org.asciidoctor.jvm.convert") version("3.3.2")
id("com.github.ben-manes.versions") version("0.39.0")
id("pl.allegro.tech.build.axion-release") version("1.13.2")
}
group 'com.github.bric3'
repositories {
//noinspection JCenterRepository
jcenter() // for jd-core
}
dependencies {
implementation("org.jd:jd-core:1.1.3")
implementation("com.google.guava:guava:30.1.1-jre")
testImplementation("junit:junit:4.13.2")
testImplementation("org.assertj:assertj-core:3.19.0")
}
test {
testLogging {
exceptionFormat = 'full'
}
}
asciidoctor {
// note revnumber is value is taken from project.version
sources {
include 'CHANGELOG.adoc'
include 'description.adoc'
}
outputDir file('build/docs')
}
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
// http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html
version = '2021.1'
plugins = ['com.intellij.java']
pluginName = 'jd-intellij'
// updateSinceUntilBuild = false
// sameSinceUntilBuild = true // eg: since-build="211.6693" until-build="211.6693.*"
}
patchPluginXml {
dependsOn asciidoctor
version = providers.provider({ scmVersion.version })
untilBuild = providers.provider({ null }) // removes until-build in plugin.xml
changeNotes = providers.provider({
Jsoup.parse(file('build/docs/CHANGELOG.html'), 'UTF-8')
.select("#releasenotes")
.get(0)
.nextElementSibling()
.children()
.stream()
.map { e ->
e.html().replaceAll('\\(preview, available from GitHub releases\\)', '')
.replaceAll('#([0-9]+)', '<a href="https://github.com/bric3/jd-intellij/issues/$1">#$1</a>')
// regex for GitHub user names from https://github.com/shinnn/github-username-regex
.replaceAll('(?i)@([a-z\\d](?:[a-z\\d]|-(?=[a-z\\d])){0,38})', '<a href="https://github.com/$1">@$1</a>')
}
.collect()
.join("\n")
})
// pluginDescription "${file('src/main/resources/META-INF/description.html').getText('UTF-8')}"
pluginDescription = providers.provider({
Jsoup.parse(file('build/docs/description.html'), 'UTF-8')
.select("#description")
.get(0)
.nextElementSibling()
.children()
.stream()
.collect()
.join("\n")
})
}
runPluginVerifier {
ideVersions = project.pluginVerifierIdeVersions.tokenize(',')
}
publishPlugin {
token = System.getenv('PUBLISH_TOKEN')
channels = ['eap']
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
tasks.withType(JavaCompile) {
options.release.set(11)
}
scmVersion {
nextVersion {
suffix = 'alpha'
separator = '-'
}
tag {
deserialize = { rules, position, tagName ->
TagNameSerializer.DEFAULT.deserializer.call(
rules,
position,
tagName.matches("v\\d.\\d") ? "$tagName.0" : tagName
)
}
}
versionIncrementer('incrementPatch')
afterEvaluate {
// assign the scm version to the project version once the
// scmVersion plugin is configured
project.version = scmVersion.version
}
}