Only extract overlays if they aren't extracted yet
@@ -115,7 +115,9 @@ public class WarOverlayPlugin implements Plugin<Project> {
if (overlay.isEnableCompilation()) {
+ if (!destinationDir.exists() || isEmpty(destinationDir)) {
project.sync(extractOverlay);
+ }
project.getTasks().getByName(CLEAN_TASK_NAME).finalizedBy(extractOverlayTask);
@@ -133,6 +135,11 @@ public class WarOverlayPlugin implements Plugin<Project> {
}
}
+ private boolean isEmpty(File destinationDir) {
+ String[] list = destinationDir.list();
+ return list == null || list.length == 0;
+ }
+
private void configureOverlay(WarOverlay overlay, Project otherProject) {
project.evaluationDependsOn(otherProject.getPath());
