forked from spotbugs/spotbugs-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
72 lines (61 loc) · 2.16 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
plugins{
id 'groovy'
id 'java-gradle-plugin'
id "com.gradle.plugin-publish" version "0.10.1"
id 'org.sonarqube' version '2.8'
id 'com.diffplug.gradle.spotless' version '3.25.0'
}
apply from: "$rootDir/gradle/checkstyle.gradle"
apply from: "$rootDir/gradle/jacoco.gradle"
apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/sonar.gradle"
apply from: "$rootDir/gradle/deploy.gradle"
apply from: "$rootDir/gradle/spotless.gradle"
version = '2.0.2-SNAPSHOT'
group = "com.github.spotbugs"
def spotBugsVersion = '3.1.12'
def slf4jVersion = '1.8.0-beta4'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
}
dependencies {
implementation gradleApi()
implementation localGroovy()
compileOnly "com.github.spotbugs:spotbugs:${spotBugsVersion}"
testImplementation gradleTestKit()
testImplementation 'junit:junit:4.12'//, 'org.spockframework:spock-core:1.0-groovy-2.4'
}
test {
// show test output
testLogging.showStandardStreams = true
}
// The configuration example below shows the minimum required properties
// configured to publish your plugin to the plugin portal
pluginBundle {
website = 'https://spotbugs.github.io/'
vcsUrl = 'https://github.com/spotbugs/spotbugs-gradle-plugin'
description = "Performs quality checks on your project's Java source files using SpotBugs and generates reports from these checks"
tags = ['spotbugs', 'findbugs', 'code quality']
plugins {
spotbugsPlugin {
id = 'com.github.spotbugs'
displayName = 'SpotBugs Gradle plugin'
}
}
}
task processVersionFile(type: WriteProperties) {
outputFile file('src/main/resources/spotbugs-gradle-plugin.properties')
property 'spotbugs-version', spotBugsVersion
property 'slf4j-version', slf4jVersion
}
tasks.processResources.dependsOn processVersionFile
tasks.publishPlugins.doFirst {
if (version.endsWith('-SNAPSHOT')) {
throw new StopExecutionException("Skip publishing Gradle plugin because its version is not stable: ${version}")
}
if (spotBugsVersion.endsWith('-SNAPSHOT')) {
throw new StopExecutionException("Skip publishing Gradle plugin because SpotBugs version is not stable: ${spotBugsVersion}")
}
}