From: Alexander Kriegisch Date: Fri, 9 Apr 2021 11:16:28 +0000 (+0700) Subject: Make sure to clean up temp-dirs in 'weaver' module X-Git-Tag: V1_9_7_M2~21^2~29 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a618e29cf3449adc38074a020adb270ca9865138;p=aspectj.git Make sure to clean up temp-dirs in 'weaver' module Maven Clean now deletes '' directories if it finds any. Furthermore, AsynchronousFileCacheBackingTestSupport now not just deletes directory contents but also removes the empty corresponding directories afterwards. Signed-off-by: Alexander Kriegisch --- diff --git a/pom.xml b/pom.xml index 48fd94060..5b3104d98 100644 --- a/pom.xml +++ b/pom.xml @@ -222,7 +222,10 @@ . + **/ajcore.*.txt + + **/dir-0.*/** false diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBackingTestSupport.java b/weaver/src/test/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBackingTestSupport.java index a6445057b..e8b0b4ecd 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBackingTestSupport.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBackingTestSupport.java @@ -59,14 +59,17 @@ public abstract class AsynchronousFileCacheBackingTestSupport protected void cleanupCache() { if (indexFile != null) { if (FileUtil.deleteContents(indexFile) > 0) { - System.out.println("Deleted " + indexFile); + System.out.println("Deleted index file: " + indexFile); } indexFile = null; } if (cacheDir != null) { if (FileUtil.deleteContents(cacheDir) > 0) { - System.out.println("Deleted " + cacheDir); + System.out.println("Deleted cache directory content: " + cacheDir); + } + if (cacheDir.delete()) { + System.out.println("Deleted cache directory: " + cacheDir); } cacheDir = null; }