Skip to content

Commit

Permalink
Merge pull request gousiosg#6 from bitslab/alekh
Browse files Browse the repository at this point in the history
Modified coverage folder generation w/ unique datetime
  • Loading branch information
ameka4 authored Feb 25, 2022
2 parents 8a7d540 + 6c82f49 commit 6934a7a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/gr/gousiosg/javacg/stat/support/RepoTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class RepoTool {

Expand Down Expand Up @@ -145,10 +147,14 @@ private void moveJars() throws IOException{
}

private void moveJacoco(String property, long timeElapsed) throws IOException{
String timeStamp = String.valueOf(java.time.LocalDateTime.now());
String directoryPath = System.getProperty("user.dir") + "/artifacts/results/"+ this.name + timeStamp;
String jacocoPath = System.getProperty("user.dir") + "/" + this.name + "/target/site/jacoco/jacoco.xml";
String jacocoTargetPath = System.getProperty("user.dir") + "/artifacts/results/"+ this.name + "/" + property + ".xml";
String jacocoTargetPath = directoryPath + "/" + property + ".xml";
String statisticsPath = System.getProperty("user.dir") + "/" + this.name + "/target/site/jacoco/index.html";
String statisticsTargetPath = System.getProperty("user.dir") + "/artifacts/results/"+ this.name + "/" + property + ".html";
String statisticsTargetPath = directoryPath + "/" + property + ".html";
File directory = new File(directoryPath);
directory.mkdir();
Path jacoco = Files.move(
Paths.get(jacocoPath),
Paths.get(jacocoTargetPath),
Expand Down

0 comments on commit 6934a7a

Please sign in to comment.