Skip to content

Commit 93e3102

Browse files
committed
Fix validatePlugins errors.
1 parent dbad659 commit 93e3102

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void performAction() {
3131
getTaskService().get().registerApplyAlreadyRan(this);
3232
ConfigurableFileTree files = getProject().fileTree(getSpotlessOutDirectory().get());
3333
if (files.isEmpty()) {
34-
getState().setDidWork(getSourceDidWork());
34+
getState().setDidWork(sourceDidWork());
3535
} else {
3636
files.visit(new FileVisitor() {
3737
@Override

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void performAction() throws IOException {
4646
private void performAction(boolean isTest) throws IOException {
4747
ConfigurableFileTree files = getProject().fileTree(getSpotlessOutDirectory().get());
4848
if (files.isEmpty()) {
49-
getState().setDidWork(getSourceDidWork());
49+
getState().setDidWork(sourceDidWork());
5050
} else if (!isTest && applyHasRun()) {
5151
// if our matching apply has already run, then we don't need to do anything
5252
getState().setDidWork(false);

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void registerSourceAlreadyRan(SpotlessTask task) {
5353
}
5454

5555
public void registerApplyAlreadyRan(SpotlessApply task) {
56-
apply.put(task.getSourceTaskPath(), task);
56+
apply.put(task.sourceTaskPath(), task);
5757
}
5858

5959
static String INDEPENDENT_HELPER = "Helper";
@@ -65,7 +65,7 @@ public static abstract class ClientTask extends DefaultTask {
6565
@Internal
6666
abstract Property<SpotlessTaskService> getTaskService();
6767

68-
String getSourceTaskPath() {
68+
String sourceTaskPath() {
6969
String path = getPath();
7070
if (this instanceof SpotlessApply) {
7171
if (path.endsWith(SpotlessExtension.APPLY)) {
@@ -85,21 +85,21 @@ private SpotlessTaskService service() {
8585
return getTaskService().get();
8686
}
8787

88-
public boolean getSourceDidWork() {
89-
SpotlessTask sourceTask = service().source.get(getSourceTaskPath());
88+
protected boolean sourceDidWork() {
89+
SpotlessTask sourceTask = service().source.get(sourceTaskPath());
9090
if (sourceTask != null) {
9191
return sourceTask.getDidWork();
9292
} else {
9393
return false;
9494
}
9595
}
9696

97-
public boolean applyHasRun() {
98-
return service().apply.containsKey(getSourceTaskPath());
97+
protected boolean applyHasRun() {
98+
return service().apply.containsKey(sourceTaskPath());
9999
}
100100

101-
String errorMsgForCheck(List<File> problemFiles, String runToFix) throws IOException {
102-
SpotlessTask task = service().source.get(getSourceTaskPath());
101+
protected String errorMsgForCheck(List<File> problemFiles, String runToFix) throws IOException {
102+
SpotlessTask task = service().source.get(sourceTaskPath());
103103
((SpotlessCheck) this).getSpotlessOutDirectory();
104104
if (task != null) {
105105
try (Formatter formatter = task.buildFormatter()) {
@@ -125,7 +125,7 @@ private String cacheGet(FileSignature key) {
125125
if (cached != null && cached.getKey().equals(key)) {
126126
return cached.getValue();
127127
} else {
128-
throw new IllegalStateException(getPath() + " is running but " + getSourceTaskPath() + " was up-to-date and didn't run");
128+
throw new IllegalStateException(getPath() + " is running but " + sourceTaskPath() + " was up-to-date and didn't run");
129129
}
130130
}
131131
}

0 commit comments

Comments
 (0)