From f8ca1aa43884dce8352d4d29d0b8d31c16f08006 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sun, 3 Jan 2021 22:39:41 -0800 Subject: [PATCH] No longer declare inputs on `SpotlessCheck` and `SpotlessApply` since they don't have any outputs (fixes #741). --- plugin-gradle/CHANGES.md | 7 ++++--- .../java/com/diffplug/gradle/spotless/SpotlessApply.java | 9 +++------ .../java/com/diffplug/gradle/spotless/SpotlessCheck.java | 9 +++------ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index 9f29756fb2..94aba2c343 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -12,9 +12,10 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * Updated default eclipse-wtp from 4.17.0 to 4.18.0. ### Fixed * `ratchetFrom` now works with git-submodule ([#746](https://github.com/diffplug/spotless/issues/746)) -* ktfmt v0.19+ with dropbox-style works again ([#765](https://github.com/diffplug/spotless/pull/765)). -* prettier no longer throws errors on empty files ([#751](https://github.com/diffplug/spotless/pull/751)). -* fixed error when running on root of windows mountpoint ([#760](https://github.com/diffplug/spotless/pull/760)). +* `ktfmt` v0.19+ with dropbox-style works again ([#765](https://github.com/diffplug/spotless/pull/765)). +* `prettier` no longer throws errors on empty files ([#751](https://github.com/diffplug/spotless/pull/751)). +* Fixed error when running on root of windows mountpoint ([#760](https://github.com/diffplug/spotless/pull/760)). +* No longer declare inputs on `SpotlessCheck` and `SpotlessApply` since they don't have any outputs (worker task still does up-to-date and caching) ([#741](https://github.com/diffplug/spotless/issues/741)). ## [5.8.2] - 2020-11-16 ### Fixed diff --git a/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessApply.java b/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessApply.java index a815d5c33c..f96f2b1131 100644 --- a/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessApply.java +++ b/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessApply.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 DiffPlug + * Copyright 2016-2021 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,9 +24,7 @@ import org.gradle.api.file.ConfigurableFileTree; import org.gradle.api.file.FileVisitDetails; import org.gradle.api.file.FileVisitor; -import org.gradle.api.tasks.InputDirectory; -import org.gradle.api.tasks.PathSensitive; -import org.gradle.api.tasks.PathSensitivity; +import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.TaskAction; public class SpotlessApply extends DefaultTask { @@ -40,8 +38,7 @@ void linkSource(SpotlessTask source) { private File spotlessOutDirectory; - @PathSensitive(PathSensitivity.RELATIVE) - @InputDirectory + @Internal public File getSpotlessOutDirectory() { return spotlessOutDirectory; } diff --git a/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessCheck.java b/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessCheck.java index 0be634f603..3fb3e0e8c3 100644 --- a/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessCheck.java +++ b/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessCheck.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 DiffPlug + * Copyright 2016-2021 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,9 +29,7 @@ import org.gradle.api.file.ConfigurableFileTree; import org.gradle.api.file.FileVisitDetails; import org.gradle.api.file.FileVisitor; -import org.gradle.api.tasks.InputDirectory; -import org.gradle.api.tasks.PathSensitive; -import org.gradle.api.tasks.PathSensitivity; +import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.TaskAction; import com.diffplug.spotless.FileSignature; @@ -43,8 +41,7 @@ public class SpotlessCheck extends DefaultTask { SpotlessTask source; private File spotlessOutDirectory; - @PathSensitive(PathSensitivity.RELATIVE) - @InputDirectory + @Internal public File getSpotlessOutDirectory() { return spotlessOutDirectory; }