forked from Lucas3oo/sonarlint-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
128 lines (111 loc) · 3.25 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
import se.solrike.sonarlint.SonarlintListRules
plugins {
id 'eclipse'
id 'groovy'
// Apply the Plugin Publish Plugin to make plugin publication possible
id 'com.gradle.plugin-publish' version '1.2.1'
id 'se.solrike.conventions.java-conventions' version '1.0.0-beta.7'
}
repositories {
mavenCentral()
}
dependencies {
implementation('io.github.furstenheim:copy_down:1.1')
implementation('org.apache.commons:commons-text:1.10.0')
implementation('org.sonarsource.sonarlint.core:sonarlint-core:9.8.0.76914') // 9.6.1.76766 // 9.8.0.76914 //10.4.1.78855
testImplementation('org.mockito:mockito-core:3.7.7')
testImplementation('org.mockito:mockito-junit-jupiter:3.7.7')
testImplementation('org.assertj:assertj-core:3.22.0')
testImplementation('org.junit.jupiter:junit-jupiter')
testImplementation(platform('org.junit:junit-bom:5.8.2'))
}
group = 'se.solrike.sonarlint'
version = '2.1.0'
sourceSets {
main {
java {
srcDirs = [] // don't compile Java code twice
}
groovy {
srcDirs = [
'src/main/groovy',
'src/main/java'
]
}
}
}
javadoc {
enabled = false
}
groovydoc {
enabled = false
}
sonarlintMain {
reports {
html.enabled = true
sarif.enabled = true
}
ignoreFailures = false
}
sonarlintTest {
reports {
sarif.enabled = true
}
ignoreFailures = false
}
spotbugsMain {
ignoreFailures = true
}
spotbugsTest {
enabled = false
}
// publish the plugin like: ./gradlew publishPlugins
gradlePlugin {
plugins {
sonarlintPlugin {
id = group
implementationClass = 'se.solrike.sonarlint.SonarlintPlugin'
displayName = 'Sonarlint plugin'
description = 'Sonarlint static code analysis using stand-alone Sonarlint engine, for ' +
'Java, Kotlin, Scala and Node.js projects. But other languages are also possible to lint like Ruby and Golang.\n' +
'It is possible to include and exclude rules and also list the rules in the Sonarlist plugins you depend on.\n' +
'If the plugin is configured with an incopatible Sonarlint plugin the build will fail.\n' +
'The plugin supports Gradle configuration cache.\n' +
'The plugin can produce Spotbugs compatible XML reports and also SARIF which can be used by Github actions, Jenkins, ' +
'AWS CodeCatalyst and Azure DevOps.\n' +
'Min Gradle version 7.5.'
}
}
}
pluginBundle {
// These settings are set for the whole plugin bundle
website = 'https://github.com/Lucas3oo/sonarlint-gradle-plugin'
vcsUrl = website
pluginTags = [
sonarlintPlugin: [
'code analysis',
'code quality',
'codesmells',
'java',
'kotlin',
'lint',
'node',
'sarif',
'scala',
'software composition analysis',
'sonarlint',
'spotbugs',
'static analysis',
'static code analysis'
]
]
}
// to upgrade the metainfo about which gradle version we shall use. Run ./gradlew wrapper after you have updated the version. The commit the new wrapper files except the gradlew.bat
wrapper {
gradleVersion = '7.5'
}
tasks.register('sonarlintListRules', SonarlintListRules) {
description = 'List sonarlint rules'
group = 'verification'
}
// ./gradlew clean test --tests 'KotlinIntegrationTest.testSonarlintMain'