Skip to content

Commit 5c44a8e

Browse files
committed
add doc to pathToExe noting executable path trick
1 parent 6ee9378 commit 5c44a8e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/ProtobufExtension.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,30 @@ public class BufFormatExtension {
6969
addStep(createStep());
7070
}
7171

72+
/**
73+
* When used in conjunction with the <a href=https://github.com/andrewparmet/buf-gradle-plugin>{@code buf-gradle-plugin}</a>,
74+
* the {@code buf} executable can be resolved from its {@code bufTool} configuration:
75+
*
76+
* <pre>
77+
* {@code
78+
* spotless {
79+
* protobuf {
80+
* buf().pathToExe(configurations.getByName(BUF_BINARY_CONFIGURATION_NAME).singleFile.absolutePath)
81+
* }
82+
* }
83+
* }
84+
* </pre>
85+
*
86+
* Be sure to disable the {@code buf-gradle-plugin}'s native support of {@code buf format}:
87+
*
88+
* <pre>
89+
* {@code
90+
* buf {
91+
* enforceFormat = false
92+
* }
93+
* }
94+
* </pre>
95+
*/
7296
public BufFormatExtension pathToExe(String pathToExe) {
7397
step = step.withPathToExe(pathToExe);
7498
replaceStep(createStep());

0 commit comments

Comments
 (0)