File tree Expand file tree Collapse file tree 3 files changed +64
-7
lines changed Expand file tree Collapse file tree 3 files changed +64
-7
lines changed Original file line number Diff line number Diff line change 31
31
env :
32
32
MODIFIED_FILES : ${{ steps.file_changes.outputs.files}}
33
33
- name : Run PMD Quality Check
34
- run : ./gradlew pmdMain -i
34
+ run : ./gradlew pmdCI -i
35
+ env :
36
+ MODIFIED_FILES : ${{ steps.file_changes.outputs.files}}
35
37
- name : Run Spotbugs Quality Check
36
- run : ./gradlew spotbugsMain -i
38
+ run : ./gradlew spotbugsCI -i
37
39
38
40
build-windows :
39
41
59
61
TARGET_BRANCH : ${{ github.base_ref }}
60
62
WORKING_BRANCH : ${{ github.head_ref }}
61
63
- name : Run PMD Quality Check
62
- run : ./gradlew pmdMain -i
64
+ run : ./gradlew pmdCI -i
65
+ env :
66
+ MODIFIED_FILES : ${{ steps.file_changes.outputs.files}}
63
67
- name : Run Spotbugs Quality Check
64
- run : ./gradlew spotbugsMain -i
68
+ run : ./gradlew spotbugsCI -i
65
69
66
70
build-macos :
67
71
89
93
TARGET_BRANCH : ${{ github.base_ref }}
90
94
WORKING_BRANCH : ${{ github.head_ref }}
91
95
- name : Run PMD Quality Check
92
- run : ./gradlew pmdMain -i
96
+ run : ./gradlew pmdCI -i
97
+ env :
98
+ MODIFIED_FILES : ${{ steps.file_changes.outputs.files}}
93
99
- name : Run Spotbugs Quality Check
94
- run : ./gradlew spotbugsMain -i
100
+ run : ./gradlew spotbugsCI -i
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ plugins {
10
10
id " com.github.spotbugs" version " 3.0.0"
11
11
}
12
12
13
+ ext {
14
+ SpotBugsTask = com.github.spotbugs.SpotBugsTask
15
+ }
16
+
13
17
repositories {
14
18
mavenCentral()
15
19
}
Original file line number Diff line number Diff line change @@ -57,6 +57,53 @@ task checkstyleCI(type: Checkstyle) {
57
57
include changedFiles
58
58
}
59
59
60
+ tasks. withType(Pmd ) {
61
+ // Specify all files that should be checked
62
+ classpath = files()
63
+ source " ${ project.rootDir} "
64
+
65
+ reports {
66
+ xml. enabled false
67
+ html. enabled true
68
+ }
69
+ }
70
+
71
+ // Execute Checkstyle on all files
72
+ task pmd (type : Pmd ) {
73
+ }
74
+
75
+ // Execute Checkstyle on all modified files
76
+ task pmdCI (type : Pmd ) {
77
+ def changedFiles = getChangedFiles()
78
+ include changedFiles
79
+ }
80
+
81
+ tasks. withType(SpotBugsTask ) {
82
+ // Specify all files that should be checked
83
+ classpath = files()
84
+ source " ${ project.rootDir} "
85
+
86
+ reports {
87
+ xml. enabled false
88
+ html. enabled true
89
+ }
90
+ }
91
+
92
+ task compileJava (overwrite : true ) {
93
+ dependsOn ' compileDebugJavaWithJavac'
94
+ group = " build"
95
+ }
96
+
97
+ // Execute SpotBugsTask on all files
98
+ task spotbugs (type : SpotBugsTask ) {
99
+ }
100
+
101
+ // Execute Checkstyle on all modified files
102
+ task spotbugsCI (type : SpotBugsTask ) {
103
+ def changedFiles = getChangedFiles()
104
+ include changedFiles
105
+ }
106
+
60
107
/**
61
108
* Get all files that are changed but not deleted nor renamed.
62
109
* Compares to master or the specified target branch.
@@ -66,7 +113,7 @@ task checkstyleCI(type: Checkstyle) {
66
113
def getChangedFiles () {
67
114
def modifiedFilesJson = System . getenv(" MODIFIED_FILES" )
68
115
List<String > files = new ArrayList<> ()
69
-
116
+
70
117
if (modifiedFilesJson == null ) {
71
118
return files
72
119
}
You can’t perform that action at this time.
0 commit comments