Browse Source

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>
tags/V1_9_7_M2
Alexander Kriegisch 3 years ago
parent
commit
a618e29cf3

+ 3
- 0
pom.xml View File

@@ -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>

+ 5
- 2
weaver/src/test/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBackingTestSupport.java View File

@@ -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;
}

Loading…
Cancel
Save