File tree 2 files changed +13
-8
lines changed
plugin-gradle/src/main/java/com/diffplug/gradle/spotless
2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ public Object doCall(TaskExecutionGraph graph) {
321
321
System .err .println ("Argument passed to " + IDE_HOOK_PROPERTY + " must be an absolute path" );
322
322
return ;
323
323
}
324
- if (spotlessTask .getTarget ().contains (file )) {
324
+ if (spotlessTask .getTargetAsFileCollection ().contains (file )) {
325
325
try (Formatter formatter = spotlessTask .buildFormatter ()) {
326
326
PaddedCell .DirtyState dirty = PaddedCell .calculateDirtyState (formatter , file );
327
327
if (dirty .isClean ()) {
Original file line number Diff line number Diff line change @@ -105,19 +105,24 @@ public FormatExceptionPolicy getExceptionPolicy() {
105
105
return exceptionPolicy ;
106
106
}
107
107
108
- protected FileCollection target ;
108
+ @ Internal
109
+ FileCollection getTargetAsFileCollection () {
110
+ if (target instanceof FileCollection ) {
111
+ return (FileCollection ) target ;
112
+ } else {
113
+ return getProject ().files (target );
114
+ }
115
+ }
116
+
117
+ protected Iterable <File > target ;
109
118
110
119
@ Internal
111
- public FileCollection getTarget () {
120
+ public Iterable < File > getTarget () {
112
121
return target ;
113
122
}
114
123
115
124
public void setTarget (Iterable <File > target ) {
116
- if (target instanceof FileCollection ) {
117
- this .target = (FileCollection ) target ;
118
- } else {
119
- this .target = getProject ().files (target );
120
- }
125
+ this .target = target ;
121
126
}
122
127
123
128
/** Internal use only. */
You can’t perform that action at this time.
0 commit comments