diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-04-09 18:16:28 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-04-09 18:16:28 +0700 |
commit | a618e29cf3449adc38074a020adb270ca9865138 (patch) | |
tree | cdeb36d7bc888293d2b6dceade267e05d58fbe21 | |
parent | 5e1551b46f734a0ee877119eef1de652edf6f77c (diff) | |
download | aspectj-a618e29cf3449adc38074a020adb270ca9865138.tar.gz aspectj-a618e29cf3449adc38074a020adb270ca9865138.zip |
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 <Alexander@Kriegisch.name>
-rw-r--r-- | pom.xml | 3 | ||||
-rw-r--r-- | weaver/src/test/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBackingTestSupport.java | 7 |
2 files changed, 8 insertions, 2 deletions
@@ -222,7 +222,10 @@ <fileset> <directory>.</directory> <includes> + <!-- AspectJ core dumps --> <include>**/ajcore.*.txt</include> + <!-- Test temp-dirs in 'weaver' module, see AsynchronousFileCacheBackingTestSupport.getCacheDir --> + <include>**/dir-0.*/**</include> </includes> <followSymlinks>false</followSymlinks> </fileset> 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; } |