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

Improve API documentation for PathSensitivity and PathSensitive #6983

Merged

Conversation

JLLeitschuh
Copy link
Contributor

@JLLeitschuh JLLeitschuh commented Oct 1, 2018

This relocates some of the API documentation for PathSensitivity and PathSensitive
which today can only be found in the Gradle Guides into the java docs for these
types.

Context

I dug this information out because of a question someone had in this issue here: detekt/detekt#1178 (comment)

I found the information hard to find and required digging through the various guides to find.
I figured it should also be part of the javadocs.

This documentation comes partially from this comment on the release notes for 4.0.1:

> a cacheable task declares a property without specifying @PathSensitive. In such a case, we default to ABSOLUTE path sensitivity, which will prevent the task's outputs from being shared across different users via a shared cache.
- https://docs.gradle.org/4.0.1/release-notes.html#build-cache-improvements

Other parts of the documentation came from this part of the guide: https://guides.gradle.org/using-build-cache/#relocatability

Contributor Checklist

  • Review Contribution Guidelines
  • Make sure that all commits are signed off to indicate that you agree to the terms of Developer Certificate of Origin.
  • Check "Allow edit from maintainers" option in pull request so that additional changes can be pushed by Gradle team
  • Provide integration tests (under <subproject>/src/integTest) to verify changes from a user perspective
  • Provide unit tests (under <subproject>/src/test) to verify logic
  • Update User Guide, DSL Reference, and Javadoc for public-facing changes
  • Ensure that tests pass locally: ./gradlew <changed-subproject>:check

Gradle Core Team Checklist

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation
  • Recognize contributor in release notes

This relocates some of the API documentation for PathSensitivity and PathSensitive
which today can only be found in the Gradle Guides into the java docs for these
types.

Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@plexxi.com>
@JLLeitschuh
Copy link
Contributor Author

@wolfs Anything more you need from me?

Copy link
Member

@wolfs wolfs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR improving our docs! I added some comments.

@@ -28,6 +28,8 @@
* <p>This annotation should be attached to the getter method in Java or the property in Groovy.
* Annotations on setters or just the field in Java are ignored.</p>
*
* <p>If a {@link CacheableTask} declares a file property without this annotation, the default is {@link PathSensitivity#ABSOLUTE}.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default is ABSOLUTE for all tasks, not only for CacheableTasks.

@@ -26,6 +26,8 @@
public enum PathSensitivity {
/**
* Consider the full path of files and directories.
*
* <p><b>This will prevent the task's outputs from being shared across different users via a shared cache.</b></p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

across different workspaces via the build cache would be better I think.

@@ -39,6 +39,10 @@ public void visitPropertyValue(PropertyValue propertyValue, PropertyVisitor visi
PathSensitive pathSensitive = propertyValue.getAnnotation(PathSensitive.class);
final PathSensitivity pathSensitivity;
if (pathSensitive == null) {
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not use multi-line comments within code. Please use //.

@wolfs wolfs merged commit 028cca5 into gradle:master Oct 11, 2018
eskatos pushed a commit that referenced this pull request Oct 11, 2018
This adds some of the API documentation for PathSensitivity and PathSensitive
which today can only be found in the Gradle Guides into the java docs for these
types.
wolfs pushed a commit that referenced this pull request Oct 11, 2018
This adds some of the API documentation for PathSensitivity and PathSensitive
which today can only be found in the Gradle Guides into the java docs for these
types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants