feat: add new configuration necessary to support auto-value #136
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.
Normally we would want to include auto-value in
java-shared-dependencies, however auto-value includes a compiler
extension and requires build configuration.
Dependencies
This change adds a dependencyManagement section with contains
auto-value-annotations to manage which version of
auto-value-annotations is used by projects and included in the
dependency tree.
Profiles
Two new profiles have been added with the necessary
configuration to include auto-value in the annotationProcessorPath
when compiling.
Auto value does not support java7 across all its artifacts
consistently and requires us to have build configuration for java7
and java8+ to deal with this fact. When we drop support for java7 the
autovalue-java7 profile can be deleted, and the jdk based activation
of autovalue-java8 can be removed.
Activation
Activation of each of the profiles is accomplished using a combination
of jdk version and file-exists rules. Not all modules underneath this
shared config use auto-value and thus we don't want to modify the
annotationProcessorPath for everything. This allows the use of
auto-value to be opt-in per module.
To use either autovalue-java* profile, create an empty file in the
module root named
EnableAutoValue.txt. When the maven config isloaded it will look for this file, and if present activate the
respective profile based on which version of java is running.
Related to: googleapis/java-shared-dependencies#37