-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
131 lines (107 loc) · 3.26 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.3'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.3"
classpath 'com.vdurmont:semver4j:3.1.0'
}
}
plugins {
id 'java'
id 'groovy'
id 'idea'
id 'checkstyle'
id 'codenarc'
id 'me.champeau.gradle.jmh' version '0.5.3'
id 'org.jetbrains.intellij' version '1.9.0'
id 'net.saliman.cobertura' version '4.0.0'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'net.ltgt.errorprone' version '2.0.2'
}
apply plugin: 'kotlin'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'org.sonarqube'
sonarqube {
properties {
property 'sonar.java.source', '11'
}
}
group 'com.github.platan'
repositories {
mavenCentral()
}
ext {
String ideaVersion = project.hasProperty('ideaVersion') ? project.getProperty('ideaVersion') : ideaVersion
}
intellij {
version = ideaVersion
type = 'IC'
plugins = ['Groovy', 'gradle', 'properties', 'junit'] + javaPlugin()
downloadSources = false
updateSinceUntilBuild = false
instrumentCode = false
}
runPluginVerifier {
ideVersions = ["IC-2019.3.5",
"IC-2020.1.4",
"IC-2020.2.4",
"IC-2020.3.1"]
}
publishPlugin {
token = project.hasProperty('publishToken') ? project['publishToken'] : null
channels = project.hasProperty('publishChannels') ? [project['publishChannels']] : ['developer']
}
import com.vdurmont.semver4j.Semver
List<String> javaPlugin() {
def ideaMainVersion = getIdeaMainVersion()
ideaVersion == 'LATEST-EAP-SNAPSHOT' || new Semver(ideaMainVersion, Semver.SemverType.LOOSE).isGreaterThanOrEqualTo('2019.2') ? ['java'] : []
}
private String getIdeaMainVersion() {
String version = ideaVersion
if (version.startsWith('LATEST'))
return 'LATEST'
def versionMatcher
if ((versionMatcher = version =~ /^(?:(?:IU|UC)-)?(\d+\.\d+)\.\d+/)) {
return versionMatcher.group(1)
}
if ((versionMatcher = version =~ /^(?:(?:IU|UC)-)?(\d+\.\d+)/)) {
return versionMatcher.group(1)
}
throw new GradleException('Cannot parse IntelliJ IDEA version: ' + version)
}
dependencies {
compile files("src/main/resources")
compile 'jakarta.xml.bind:jakarta.xml.bind-api:3.0.1'
compile 'com.sun.xml.bind:jaxb-impl:3.0.2'
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
testCompile("org.spockframework:spock-core:2.2-groovy-2.5") {
exclude module: 'groovy-all'
}
errorprone("com.google.errorprone:error_prone_core:2.19.1")
}
configurations {
all*.exclude group: 'org.gmetrics', module: 'GMetrics'
}
idea {
module {
scopes.TEST.plus += [configurations.jmh]
}
}
codenarc {
configFile = file("${project.rootDir}/config/codenarc/rules.groovy")
toolVersion = codenarcToolVersion
}
cobertura.coverageFormats = ['html', 'xml']
checkstyle {
toolVersion = checkstyleToolVersion
configFile = file("${project.rootDir}/config/checkstyle/checks.xml")
}
test {
useJUnitPlatform()
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}