forked from scanban/findbugs-idea
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathbuild.gradle
143 lines (122 loc) · 4.34 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
132
133
134
135
136
137
138
139
140
141
142
143
#!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/>.
*/
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
plugins {
id "org.jetbrains.intellij.platform" version "2.2.1"
id 'jacoco'
}
apply plugin: 'maven-publish'
apply plugin: 'java'
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenLocal()
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
intellijPlatform {
pluginConfiguration {
name = 'spotbugs-idea'
}
}
jacoco {
toolVersion = "0.8.12"
}
runIde {
systemProperties(["jdk.util.zip.ensureTrailingSlash":false])
}
configurations {
thirdPartyPlugins
fbContribJava6
}
dependencies {
intellijPlatform {
def type = providers.gradleProperty('platformType')
def version = providers.gradleProperty('platformVersion')
create(type, version)
bundledPlugin 'com.intellij.java'
testFramework TestFrameworkType.Platform.INSTANCE
testFramework TestFrameworkType.Plugin.Java.INSTANCE
}
implementation ('com.github.spotbugs:spotbugs:4.9.0') {
exclude group: 'xml-apis', module: 'xml-apis'
exclude group: 'org.apache.logging.log4j', module: 'log4j-api'
exclude group: 'org.apache.logging.log4j', module: 'log4j-core'
exclude group: 'org.slf4j', module: 'slf4j-api'
}
implementation 'net.sf.saxon:Saxon-HE:12.5'
implementation 'org.jsoup:jsoup:1.18.3'
implementation 'info.clearthought:table-layout:4.3.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.assertj:assertj-core:3.27.3'
testImplementation 'org.mockito:mockito-core:5.15.2'
thirdPartyPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.6.9'
thirdPartyPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.13.0'
fbContribJava6 'com.mebigfatguy.fb-contrib:fb-contrib:6.2.1'
}
tasks.register('copyGradleProperties', Copy) {
description = 'Copy gradle.properties to project resources.'
from 'gradle.properties'
into 'build/resources/main/org/jetbrains/plugins/spotbugs/common'
rename { _ -> 'version.properties' }
}
tasks.register('downloadThirdPartyPlugins', 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'
}
tasks.register('copyThirdPartyPlugins', 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'
}
tasks.register('deleteThirdPartyPlugins', 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.required = true
html.required = false
csv.required = false
}
}
wrapper {
gradleVersion = '8.12'
}