Skip to content

Commit 7e753c6

Browse files
authored
Make gradle plugin configuration cache friendly (#1874)
1 parent 0afa8ea commit 7e753c6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/ByteBuddySimpleTask.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ protected Iterable<File> discoverySet() {
173173
*/
174174
@TaskAction
175175
public void apply() throws IOException {
176-
if (!getSource().equals(getTarget()) && deleteRecursively(getProject().fileTree(getTarget()).getFiles())) {
177-
getLogger().debug("Deleted all target files in {}", getTarget());
176+
File source = getSource();
177+
File target = getTarget();
178+
if (!source.equals(target) && deleteRecursively(target)) {
179+
getLogger().debug("Deleted all target files in {}", target);
178180
}
179-
doApply(new Plugin.Engine.Source.ForFolder(getSource()), new Plugin.Engine.Target.ForFolder(getTarget()));
181+
doApply(new Plugin.Engine.Source.ForFolder(source), new Plugin.Engine.Target.ForFolder(target));
180182
}
181183
}

0 commit comments

Comments
 (0)