forked from JetBrains/spotbugs-intellij-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
128 lines (109 loc) · 3.69 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
#!groovy
/*
* Copyright 2020 SpotBugs plugin contributors
*
* This file is part of IntelliJ SpotBugs plugin.
*
* IntelliJ SpotBugs plugin is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* IntelliJ SpotBugs plugin is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with IntelliJ SpotBugs plugin.
* If not, see <http://www.gnu.org/licenses/>.
*/
plugins {
id "org.jetbrains.intellij" version "0.4.21"
id 'jacoco'
}
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'maven-publish'
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
intellij {
version ijVersion
pluginName 'spotbugs-idea'
updateSinceUntilBuild false
type 'IC'
plugins 'git4idea'
plugins 'java'
}
jacoco {
toolVersion = "0.8.5"
}
runIde {
systemProperties(["jdk.util.zip.ensureTrailingSlash":false])
}
configurations {
thirdPartyPlugins
fbContribJava6
}
dependencies {
implementation ('com.github.spotbugs:spotbugs:4.4.2') {
exclude group: 'xml-apis', module: 'xml-apis'
}
implementation 'net.sf.saxon:Saxon-HE:9.9.1-2'
implementation 'org.jsoup:jsoup:1.8.3'
implementation 'info.clearthought:table-layout:4.3.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.assertj:assertj-core:3.21.0'
testImplementation 'org.mockito:mockito-core:4.0.0'
thirdPartyPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.7'
thirdPartyPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.11.0'
fbContribJava6 'com.mebigfatguy.fb-contrib:fb-contrib:6.2.1'
}
task copyGradleProperties(type: Copy) {
description 'Copy gradle.properties to project resources.'
from 'gradle.properties'
into 'build/resources/main/org/jetbrains/plugins/spotbugs/common'
rename { _ -> 'version.properties' }
}
task downloadThirdPartyPlugins(type: Copy) {
description 'Downloads third-party plugins Find Security Bugs and FB-Contrib.'
from configurations.thirdPartyPlugins
from configurations.fbContribJava6
into 'build/resources/main/org/jetbrains/plugins/spotbugs/plugins'
}
task copyThirdPartyPlugins(type: Copy) {
dependsOn(downloadThirdPartyPlugins, prepareSandbox)
description 'Copy plugins into sandbox.'
from 'build/resources/main/org/jetbrains/plugins/spotbugs/plugins'
into 'build/idea-sandbox/plugins/spotbugs-idea/customPlugins'
}
task deleteThirdPartyPlugins(type: Delete) {
delete 'build/resources/main/org/jetbrains/plugins/spotbugs/plugins'
}
tasks.compileJava.dependsOn(downloadThirdPartyPlugins, copyGradleProperties)
tasks.buildPlugin.dependsOn(copyThirdPartyPlugins)
tasks.jacocoTestReport.dependsOn(deleteThirdPartyPlugins)
tasks.jacocoTestCoverageVerification.dependsOn(deleteThirdPartyPlugins)
test {
def ideaHomePath = System.getenv().get('IDEA_HOME_PATH') ?: project.findProperty('idea.home.path')
if (ideaHomePath == null) {
throw new RuntimeException("Please set the 'idea.home.path' property at gradle.properties")
}
systemProperty "idea.home.path", ideaHomePath
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled true
html.enabled false
csv.enabled false
}
}
wrapper {
gradleVersion = '6.3'
}