Skip to content

Commit 6934a7a

Browse files
authored
Merge pull request gousiosg#6 from bitslab/alekh
Modified coverage folder generation w/ unique datetime
2 parents 8a7d540 + 6c82f49 commit 6934a7a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import java.util.List;
1717
import java.util.Map;
1818
import java.util.Optional;
19+
import java.time.LocalDateTime;
20+
import java.time.format.DateTimeFormatter;
1921

2022
public class RepoTool {
2123

@@ -145,10 +147,14 @@ private void moveJars() throws IOException{
145147
}
146148

147149
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;
148152
String jacocoPath = System.getProperty("user.dir") + "/" + this.name + "/target/site/jacoco/jacoco.xml";
149-
String jacocoTargetPath = System.getProperty("user.dir") + "/artifacts/results/"+ this.name + "/" + property + ".xml";
153+
String jacocoTargetPath = directoryPath + "/" + property + ".xml";
150154
String statisticsPath = System.getProperty("user.dir") + "/" + this.name + "/target/site/jacoco/index.html";
151-
String statisticsTargetPath = System.getProperty("user.dir") + "/artifacts/results/"+ this.name + "/" + property + ".html";
155+
String statisticsTargetPath = directoryPath + "/" + property + ".html";
156+
File directory = new File(directoryPath);
157+
directory.mkdir();
152158
Path jacoco = Files.move(
153159
Paths.get(jacocoPath),
154160
Paths.get(jacocoTargetPath),

0 commit comments

Comments
 (0)