File tree Expand file tree Collapse file tree 4 files changed +66
-0
lines changed
build-logic/src/main/groovy
testlib/src/main/java/com/diffplug/spotless/tag Expand file tree Collapse file tree 4 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 6
6
7
7
plugins {
8
8
id ' buildlogic.java-application-conventions'
9
+ id ' buildlogic.java-special-tests-conventions'
9
10
}
10
11
11
12
dependencies {
Original file line number Diff line number Diff line change
1
+ plugins {
2
+ id ' java'
3
+ id ' com.adarshr.test-logger'
4
+ }
5
+
6
+ // See com.diffplug.spotless.tag package for available JUnit 5 @Tag annotations
7
+ def special = [
8
+ ' cliProcess' ,
9
+ ' cliProcessNpm' ,
10
+ ' cliNative' ,
11
+ ' cliNativeNpm'
12
+ ]
13
+
14
+ tasks. named(' test' ). configure {
15
+ useJUnitPlatform {
16
+ excludeTags special as String []
17
+ }
18
+ }
19
+
20
+ special. forEach { tag ->
21
+ tasks. register(" test${ tag.capitalize()} " , Test ) {
22
+ useJUnitPlatform { includeTags tag }
23
+ }
24
+ }
25
+
26
+ tasks. register(' testAll' ) {
27
+ dependsOn tasks. matching { it. name. startsWith(' test' ) && it. name != ' testAll' }
28
+ }
29
+
30
+ tasks. withType(Test ). configureEach {
31
+ testLogging. showStandardStreams = true
32
+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ plugins {
25
25
26
26
// https://github.com/diffplug/spotless-changelog/blob/main/README.md
27
27
id ' com.diffplug.spotless-changelog' version ' 3.1.2' apply false
28
+
29
+ // https://github.com/radarsh/gradle-test-logger-plugin/blob/develop/CHANGELOG.md
30
+ id ' com.adarshr.test-logger' version ' 4.0.0' apply false
28
31
}
29
32
30
33
rootProject. name = ' spotless-cli'
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2021-2024 DiffPlug
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package com .diffplug .spotless .tag ;
17
+
18
+ import java .lang .annotation .Retention ;
19
+ import java .lang .annotation .Target ;
20
+
21
+ import org .junit .jupiter .api .Tag ;
22
+
23
+ import static java .lang .annotation .ElementType .METHOD ;
24
+ import static java .lang .annotation .ElementType .TYPE ;
25
+ import static java .lang .annotation .RetentionPolicy .RUNTIME ;
26
+
27
+ @ Target ({TYPE , METHOD })
28
+ @ Retention (RUNTIME )
29
+ @ Tag ("npm" )
30
+ public @interface NpmTest {}
You can’t perform that action at this time.
0 commit comments