File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
plugin-gradle/src/main/java/com/diffplug/gradle/spotless Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 30
30
import java .util .Random ;
31
31
import java .util .TreeMap ;
32
32
import java .util .function .Consumer ;
33
+ import java .util .function .Function ;
33
34
34
35
import javax .annotation .Nullable ;
35
36
import javax .inject .Inject ;
@@ -300,6 +301,13 @@ public void addStep(FormatterStep newStep) {
300
301
steps .add (newStep );
301
302
}
302
303
304
+ /** Adds a new step that requires a Provisioner. */
305
+ public void addStep (Function <Provisioner , FormatterStep > createStepFn ) {
306
+ requireNonNull (createStepFn );
307
+ FormatterStep newStep = createStepFn .apply (provisioner ());
308
+ addStep (newStep );
309
+ }
310
+
303
311
/** Returns the index of the existing step with the given name, or -1 if no such step exists. */
304
312
protected int getExistingStepIdx (String stepName ) {
305
313
for (int i = 0 ; i < steps .size (); ++i ) {
You can’t perform that action at this time.
0 commit comments