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

Switch to provided jsr305 and nullability improvements #69

Merged
merged 1 commit into from
May 13, 2017
Merged

Conversation

ZacSweers
Copy link
Collaborator

@ZacSweers ZacSweers commented May 12, 2017

This takes inspiration from Square's recent blog post and brings back the jsr305 dependency as a provided dependency. Benefits are static analysis and kotlin code still can leverage this.

Main functional differences are annotating a package-info with @ParametersAreNonnullByDefault annotation and switching to javax' @Nullable annotation instead of RxJava's.

Thank you for contributing to AutoDispose. Before pressing the "Create Pull Request" button, please consider the following points:

Prior reading:

This takes a feather out of Square's recent blog post and brings back the jsr305 dependency as a provided dependency. Benefits are static analysis and kotlin code still can leverage this.

Main functional differences are annotating a `package-info` with `@ParametersAreNonnullByDefault` annotation and switching to javax' `@Nullable` annotation instead of RxJava's.
@ZacSweers ZacSweers self-assigned this May 12, 2017
Copy link

@kageiit kageiit left a comment

Choose a reason for hiding this comment

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

left a minor nit

@@ -45,7 +45,8 @@ def kotlin = [
]

def misc = [
errorProneAnnotations: "com.google.errorprone:error_prone_annotations:${versions.errorProne}"
errorProneAnnotations: "com.google.errorprone:error_prone_annotations:${versions.errorProne}",
jsr305: 'com.google.code.findbugs:jsr305:3.0.2'
Copy link

Choose a reason for hiding this comment

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

formatting

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can you be more specific?

Copy link

Choose a reason for hiding this comment

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

Add spaces after the jsr305 to match the width till the : on the previous line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This project doesn't follow that pattern since it often damages git history

Copy link

Choose a reason for hiding this comment

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

alright ignore that then :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍

@ZacSweers ZacSweers merged commit a463e85 into master May 13, 2017
@ZacSweers ZacSweers deleted the z/jsr305 branch May 13, 2017 00:05
ZacSweers added a commit that referenced this pull request May 14, 2017
This is a followup to #69, and improves it in two main ways:
- This adds it to subpackages as well, which I missed in the first pass.
- Switches to a custom `PackageNonNull` annotation instead, which expands the checks to also include return types, fields, local vars, etc. It's pretty broad right now but we could reduce scope if need be. This is pulled into a separate artifact for re-use, but still only applied as compileOnly.
ZacSweers added a commit that referenced this pull request May 16, 2017
* More nullability annotation work

This is a followup to #69, and improves it in two main ways:
- This adds it to subpackages as well, which I missed in the first pass.
- Switches to a custom `PackageNonNull` annotation instead, which expands the checks to also include return types, fields, local vars, etc. It's pretty broad right now but we could reduce scope if need be. This is pulled into a separate artifact for re-use, but still only applied as compileOnly.

* Clean up qualifiers

* Tweak name

* Don't export artifact

Not necessary, we'll make this a separate project later

* CLASS retention instead of runtime
@ZacSweers ZacSweers modified the milestone: 0.3.0 Sep 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants