Skip to content

Commit 4b5dda9

Browse files
authored
Merge pull request #35 from IBM/rename-lib-deps-folder
Rename the .library-depenedencies to _library_dependencies
2 parents 4f0849b + e0c2724 commit 4b5dda9

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/main/java/com/ibm/northstar/CodeAnalyzer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ private static void analyze() throws IOException, ClassHierarchyException, CallG
136136

137137
}
138138
}
139+
// Cleanup library dependencies directory
140+
BuildProject.cleanLibraryDependencies();
139141

140142
// Convert the JavaCompilationUnit to JSON and add to consolidated json object
141143
String symbolTableJSONString = gson.toJson(symbolTable);

src/main/java/com/ibm/northstar/utils/BuildProject.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public class BuildProject {
1515

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

@@ -153,4 +153,19 @@ public static boolean downloadLibraryDependencies(String projectPath) {
153153
return false;
154154
}
155155
}
156+
157+
public void cleanLibraryDependencies() {
158+
if (libDownloadPath != null) {
159+
Log.info("Cleaning up library dependency directory: " + libDownloadPath);
160+
try {
161+
Files.walk(libDownloadPath)
162+
.filter(Files::isRegularFile)
163+
.map(Path::toFile)
164+
.forEach(File::delete);
165+
Files.delete(libDownloadPath);
166+
} catch (IOException e) {
167+
Log.error("Error deleting library dependency directory: " + e.getMessage());
168+
}
169+
}
170+
}
156171
}

0 commit comments

Comments
 (0)