Customize generated code annotations#280
Merged
Merged
Conversation
This reverts commit 19d98c3
Codecov Report
@@ Coverage Diff @@
## master #280 +/- ##
============================================
- Coverage 76.12% 75.28% -0.84%
+ Complexity 769 760 -9
============================================
Files 322 324 +2
Lines 8494 8555 +61
Branches 549 552 +3
============================================
- Hits 6466 6441 -25
- Misses 1894 1981 +87
+ Partials 134 133 -1 |
Contributor
Author
|
@armiol, PTAL. |
armiol
approved these changes
Jan 7, 2019
armiol
left a comment
Collaborator
There was a problem hiding this comment.
@dmdashenkov LGTM with a tiny comment to address.
|
|
||
| @CheckReturnValue | ||
| @ParametersAreNonnullByDefault | ||
| package io.spine.gradle.compiler; |
Collaborator
There was a problem hiding this comment.
Please document the package purpose. I understand this is a test-source package, but still, let's have at least a couple of words.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code generation annotations
In this PR we enable customization for annotations used for code generation.
If a Protobuf definition uses one of the API options (see
options.proto), the resulting Java code is post-processed by adding respective API annotations.Before this PR, the annotations were hard-coded:
io.spine.annotation.Beta;io.spine.annotation.Experimental;io.spine.annotation.Internal;io.spine.annotation.SPI.Starting from now, the annotation types may be specified with a Gradle extension:
Other significant changes:
(SPI)field option is deleted, since there are no obvious cases for such an option;EnumAnnotatorclass is deleted, since it was never used;annotator-testsis added in order to verify the annotator plugin behaviour in cases when custom annotations are specified.