File tree Expand file tree Collapse file tree 2 files changed +12
-19
lines changed
src/main/java/org/hypertrace/gradle/code/style Expand file tree Collapse file tree 2 files changed +12
-19
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ plugins {
4
4
`java- gradle- plugin`
5
5
id(" org.hypertrace.repository-plugin" ) version " 0.4.0"
6
6
id(" org.hypertrace.ci-utils-plugin" ) version " 0.3.0"
7
- id(" org.hypertrace.code-style-plugin" ) version " latest.release "
7
+ id(" org.hypertrace.code-style-plugin" ) version " 2.0.1 "
8
8
id(" org.hypertrace.publish-plugin" ) version " 1.0.4"
9
9
id(" org.owasp.dependencycheck" ) version " 8.4.0"
10
10
}
Original file line number Diff line number Diff line change 12
12
import org .gradle .api .Plugin ;
13
13
import org .gradle .api .Project ;
14
14
import org .gradle .api .plugins .PluginContainer ;
15
- import org .gradle .api .provider .Provider ;
16
15
17
16
public class CodeStylePlugin implements Plugin <Project > {
18
17
@@ -50,24 +49,18 @@ private void configureFormatting(Project project) {
50
49
});
51
50
52
51
BufExtension bufExtension = project .getExtensions ().getByType (BufExtension .class );
53
- Provider <File > bufBinaryProvider =
54
- project .provider (
55
- () -> {
56
- File binary =
57
- project
58
- .getConfigurations ()
59
- .getByName (BufSupportKt .BUF_BINARY_CONFIGURATION_NAME )
60
- .getSingleFile ();
61
- if (!binary .canExecute ()) {
62
- binary .setExecutable (true );
63
- }
64
- return binary ;
65
- });
66
52
spotlessExtension .protobuf (
67
- format ->
68
- format
69
- .buf (bufExtension .getToolVersion ())
70
- .pathToExe (bufBinaryProvider .get ().getAbsolutePath ()));
53
+ format -> {
54
+ File bufBinary =
55
+ project
56
+ .getConfigurations ()
57
+ .getByName (BufSupportKt .BUF_BINARY_CONFIGURATION_NAME )
58
+ .getSingleFile ();
59
+ if (!bufBinary .canExecute ()) {
60
+ bufBinary .setExecutable (true );
61
+ }
62
+ format .buf (bufExtension .getToolVersion ()).pathToExe (bufBinary .getAbsolutePath ());
63
+ });
71
64
bufExtension .setEnforceFormat (false );
72
65
73
66
spotlessExtension .format (
You can’t perform that action at this time.
0 commit comments