-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Clarify description for parameter "append" #1827
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
base: master
Are you sure you want to change the base?
Conversation
State that by default execution data files are always written to in append mode. This closes jacoco#1676
/** | ||
* If set to true and the execution data file already exists, coverage data | ||
* is appended to the existing file. If set to false, an existing execution | ||
* data file will be replaced. | ||
* data file will be replaced. The default behaviour is that execution data | ||
* files are never cleared but coverage is always appended to an existing | ||
* file. | ||
*/ | ||
@Parameter(property = "jacoco.append") | ||
Boolean append; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO rather than repeating
appended to the existing file
might be better to just simply explicitly specify default value:
index 06f798a6..a65a1ebe 100644
--- i/jacoco-maven-plugin/src/org/jacoco/maven/AbstractAgentMojo.java
+++ w/jacoco-maven-plugin/src/org/jacoco/maven/AbstractAgentMojo.java
@@ -55,11 +55,9 @@ public abstract class AbstractAgentMojo extends AbstractJacocoMojo {
/**
* If set to true and the execution data file already exists, coverage data
* is appended to the existing file. If set to false, an existing execution
- * data file will be replaced. The default behaviour is that execution data
- * files are never cleared but coverage is always appended to an existing
- * file.
+ * data file will be replaced.
*/
- @Parameter(property = "jacoco.append")
+ @Parameter(property = "jacoco.append", defaultValue = "true")
Boolean append;
which will be rendered in documentation as following
with a link to
and in execution of
mvn org.jacoco:jacoco-maven-plugin:0.8.13-SNAPSHOT:help -Dgoal=prepare-agent -Ddetail
as
append (Default: true)
If set to true and the execution data file already exists, coverage data
is appended to the existing file. If set to false, an existing execution
data file will be replaced.
User property: jacoco.append
this also might be helpful for other tools that process this metadata - for example IntelliJ IDEA will be showing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Godin I would also prefer the formal specification of the defaultValue
.
This holds true also for all other properties. The only issue is that we currently have default values in AgentOptions
defined. So we should use those constants. Then all the != null
checks in createAgentOptions()
can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that default values should be defined in one place: Either on the Plugin/tool level or on the AgentOptions level. The former has the disadvantage that you need to define it for all tools (like Ant, CLI, ...) separately. Not sure how to even modify that for Gradle: https://docs.gradle.org/current/userguide/jacoco_plugin.html
State that by default execution data files are always written to in append mode.
This closes #1676