Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/com/ibm/northstar/CodeAnalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ private static void analyze() throws IOException, ClassHierarchyException, CallG

}
}
// Cleanup library dependencies directory
BuildProject.cleanLibraryDependencies();

// Convert the JavaCompilationUnit to JSON and add to consolidated json object
String symbolTableJSONString = gson.toJson(symbolTable);
Expand Down
17 changes: 16 additions & 1 deletion src/main/java/com/ibm/northstar/utils/BuildProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class BuildProject {

public static Path libDownloadPath;
private static final String LIB_DEPS_DOWNLOAD_DIR = ".library-dependencies";
private static final String LIB_DEPS_DOWNLOAD_DIR = "_library_dependencies";
private static final String MAVEN_CMD = System.getProperty("os.name").toLowerCase().contains("windows") ? "mvn.cmd" : "mvn";
private static final String GRADLE_CMD = System.getProperty("os.name").toLowerCase().contains("windows") ? "gradlew.bat" : "gradlew";

Expand Down Expand Up @@ -153,4 +153,19 @@ public static boolean downloadLibraryDependencies(String projectPath) {
return false;
}
}

public void cleanLibraryDependencies() {
if (libDownloadPath != null) {
Log.info("Cleaning up library dependency directory: " + libDownloadPath);
try {
Files.walk(libDownloadPath)
.filter(Files::isRegularFile)
.map(Path::toFile)
.forEach(File::delete);
Files.delete(libDownloadPath);
} catch (IOException e) {
Log.error("Error deleting library dependency directory: " + e.getMessage());
}
}
}
}