Skip to content

Commit 8fad1ad

Browse files
author
alekh
committed
Fixed automation issue w/ Jacoco, Modified coverage folder generation w/ unique datetime
1 parent 698d851 commit 8fad1ad

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/main/java/gr/gousiosg/javacg/stat/support/BuildArguments.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ private File getJarFile(String jarPath) {
132132

133133
// Return a (path, file) pair
134134
private Pair<String, File> pathAndJarFile(String jarPath) {
135+
jarPath = System.getProperty("user.dir") + jarPath;
135136
validateJarSuffix(jarPath);
136137
File file = getJarFile(jarPath);
137138
return new Pair<>(jarPath, file);

src/main/java/gr/gousiosg/javacg/stat/support/RepoTool.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,14 @@ private void moveJars() throws IOException{
147147
}
148148

149149
private void moveJacoco(String property, long timeElapsed) throws IOException{
150+
String timeStamp = String.valueOf(java.time.LocalDateTime.now());
151+
String directoryPath = System.getProperty("user.dir") + "/artifacts/results/"+ this.name + timeStamp;
150152
String jacocoPath = System.getProperty("user.dir") + "/" + this.name + "/target/site/jacoco/jacoco.xml";
151-
String jacocoTargetPath = System.getProperty("user.dir") + "/artifacts/results/"+ this.name + java.time.LocalDateTime.now() + "/" + property + ".xml";
153+
String jacocoTargetPath = directoryPath + "/" + property + ".xml";
152154
String statisticsPath = System.getProperty("user.dir") + "/" + this.name + "/target/site/jacoco/index.html";
153-
String statisticsTargetPath = System.getProperty("user.dir") + "/artifacts/results/"+ this.name + java.time.LocalDateTime.now() + "/" + property + ".html";
155+
String statisticsTargetPath = directoryPath + "/" + property + ".html";
156+
File directory = new File(directoryPath);
157+
directory.mkdir();
154158
Path jacoco = Files.move(
155159
Paths.get(jacocoPath),
156160
Paths.get(jacocoTargetPath),

0 commit comments

Comments
 (0)