Skip to content

Commit

Permalink
Merge pull request #21 from castor-software/issue_19
Browse files Browse the repository at this point in the history
Fix #19
  • Loading branch information
Deee92 authored Nov 30, 2022
2 parents 3cb443c + 3823478 commit 523f29b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/se/kth/deptrim/util/PomUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ private String createSpecializedPomFromDebloatedPom(Set<TrimmedDependency> oneCo
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document document = documentBuilder.parse(new File(debloatedPomPath));
document.getDocumentElement().normalize();
int numberOfTrimmedDependencies = oneCombinationOfTrimmedDependencies.size();
NodeList dependencies = document.getDocumentElement().getElementsByTagName("dependency");
String debloatedAndSpecializedPom = debloatedPomPath.replace(".xml", "-spl.xml");
for (TrimmedDependency thisDependency : oneCombinationOfTrimmedDependencies) {
Expand All @@ -86,7 +87,10 @@ private String createSpecializedPomFromDebloatedPom(Set<TrimmedDependency> oneCo
}
}
}
debloatedAndSpecializedPom = debloatedAndSpecializedPom.replace(".xml", "-" + combinationNumber + ".xml");
debloatedAndSpecializedPom = debloatedAndSpecializedPom.replace(
".xml",
"-" + combinationNumber + "_" + numberOfTrimmedDependencies + "_" + trimmedDependencies.size() + ".xml"
);
saveUpdatedDomInANewPom(document, debloatedAndSpecializedPom);
return debloatedAndSpecializedPom;
}
Expand Down

0 comments on commit 523f29b

Please sign in to comment.