-
Notifications
You must be signed in to change notification settings - Fork 160
/
build.gradle
114 lines (90 loc) · 3.83 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
plugins {
id 'java'
id 'jacoco'
id 'idea'
id 'org.jetbrains.intellij' version '1.17.2'
id 'com.dorongold.task-tree' version '2.1.1'
id 'org.infernus.idea.checkstyle.build'
}
repositories {
mavenCentral()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Project Metadata
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
version = '5.91.0'
intellij {
version = 'IC-2023.1.5'
pluginName = 'CheckStyle-IDEA'
updateSinceUntilBuild = false
instrumentCode = false
plugins = ['java']
}
verifyPlugin {
dependsOn(copyClassesToSandbox)
dependsOn(copyCheckstyleArtifactsToSandbox)
}
publishPlugin {
token.set(System.getenv("JETBRAINS_PLUGIN_REPO_TOKEN"))
}
// workaround for Checkstyle#14123
configurations.configureEach {
resolutionStrategy.capabilitiesResolution.withCapability("com.google.collections:google-collections") {
select("com.google.guava:guava:0")
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Compilation
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:deprecation'
options.release.set(17)
if (it.name == 'compileCsaccessJava' || it.name == 'compileCsaccessTestJava') {
options.compilerArgs << '-Xlint:unchecked'
}
}
test {
forkEvery = 1
}
tasks.named("classpathIndexCleanup") {
dependsOn(tasks.named("processCsaccessResources"))
dependsOn(tasks.named("processCsaccessTestResources"))
dependsOn(tasks.named("compileCsaccessJava"))
dependsOn(tasks.named("compileCsaccessTestJava"))
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Dependencies
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
dependencies {
implementation group: 'commons-io', name: 'commons-io', version: '2.15.1'
implementation group: 'commons-codec', name: 'commons-codec', version: '1.16.0'
csaccessCompileOnly ("com.puppycrawl.tools:checkstyle:${supportedCsVersions.getBaseVersion()}") {
exclude group: 'commons-logging', module: 'commons-logging'
}
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.2'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.5.0'
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// IntelliJ IDEA Config
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
idea.module {
downloadJavadoc = true
downloadSources = true
excludeDirs += file('.idea')
excludeDirs += file('_support')
// TODO We should also tell IntelliJ automatically that csaccessTest contains test code.
// The following lines should really do it, but currently don't, which seems like a Gradle bug to me:
//def SourceSet catSourceSet = sourceSets.getByName(CustomSourceSetCreator.CSACCESSTEST_SOURCESET_NAME);
//testSourceDirs += catSourceSet.getJava().getSrcDirs();
//testSourceDirs += catSourceSet.getResources().getSrcDirs();
//scopes.TEST.plus += [configurations.getByName(catSourceSet.getRuntimeConfigurationName())];
}