Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config property for reusing jacoco data files #19707

Merged
merged 1 commit into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ void transformerBuildItem(BuildProducer<BytecodeTransformerBuildItem> transforme
+ config.dataFile;
System.setProperty("jacoco-agent.destfile",
dataFile);
Files.deleteIfExists(Paths.get(dataFile));
if (!config.reuseDataFile) {
Files.deleteIfExists(Paths.get(dataFile));
}

Instrumenter instrumenter = new Instrumenter(new OfflineInstrumentationAccessGenerator());
Set<String> seen = new HashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ public class JacocoConfig {
@ConfigItem(defaultValue = "jacoco-quarkus.exec")
public String dataFile;

/**
* Whether to reuse ({@code true}) or delete ({@code false}) the jacoco
* data file on each run.
*/
@ConfigItem(defaultValue = "false")
public boolean reuseDataFile;

/**
* If Quarkus should generate the Jacoco report
*/
Expand Down