-
Notifications
You must be signed in to change notification settings - Fork 744
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
Add OSGi runtime metadata to error-prone's MANIFEST.MF files #3903
Closed
Conversation
This file contains 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
This was referenced May 10, 2023
copybara-service bot
pushed a commit
to google/guice
that referenced
this pull request
May 12, 2023
Annotations with retention policy are ignored if they cannot be loaded at runtime (at least according to [Stack-Overvflow](https://stackoverflow.com/questions/3567413/why-doesnt-a-missing-annotation-cause-a-classnotfoundexception-at-runtime)). Make the dependency optional to not enforce the presence of error_prone_annotations in a java runtime even if those annotations are not used at all. This is especially useful for OSGi-runtimes where you cannot exclude error_prone_annotations because the corresponding package is specified as mandatory requirement in the MANIFEST.MF. Marking the Maven dependency as optional will also result in the error-prone package requirement being marked as optional. At the moment error_prone_annotations does not come with a OSGi compliant Manifest, which makes it harder to include it in OSGi applications like Eclipse. I already created a PR at error-prone to include the required OSGi headers (see google/error-prone#3903), but not requiring the annotations at all would make it even simpler to use guice within OSGi. Alternatively the dependency could be marked as optional in the OSGi metadata. Fixes #1739 COPYBARA_INTEGRATE_REVIEW=#1739 from HannesWell:optionalErrorproneAnnotations 86f9de0 PiperOrigin-RevId: 531531783
cushon
approved these changes
May 12, 2023
cushon
approved these changes
May 13, 2023
copybara-service bot
pushed a commit
that referenced
this pull request
May 13, 2023
As suggested in #2967 (comment) this PR aims to add OSGi runtime metadata to the error-prone jars. It achieves this by employing the [bnd-maven-plugin:bnd-process](https://github.com/bndtools/bnd/tree/master/maven-plugins/bnd-maven-plugin#bnd-process-goal) goal to generate the OSGi metadata, like the values of the Manifest headers `Bundle-SymbolicName`, `Import-Package` and `Export-Package`. The schema used for `Bundle-SymbolicName` headers is based on the schema used for the `Automatic-Module-Name` in the error-prone-annotations artifact. With this change additionally all other error-prone artifacts get a `Automatic-Module-Name` too. @cushon can you please review this PR? If you have any question, I would be happy to answer them. Fixes #2967 Fixes #3903 FUTURE_COPYBARA_INTEGRATE_REVIEW=#3903 from HannesWell:osgiMetadata f1ee0a4 PiperOrigin-RevId: 531653111
copybara-service bot
pushed a commit
that referenced
this pull request
May 13, 2023
As suggested in #2967 (comment) this PR aims to add OSGi runtime metadata to the error-prone jars. It achieves this by employing the [bnd-maven-plugin:bnd-process](https://github.com/bndtools/bnd/tree/master/maven-plugins/bnd-maven-plugin#bnd-process-goal) goal to generate the OSGi metadata, like the values of the Manifest headers `Bundle-SymbolicName`, `Import-Package` and `Export-Package`. The schema used for `Bundle-SymbolicName` headers is based on the schema used for the `Automatic-Module-Name` in the error-prone-annotations artifact. With this change additionally all other error-prone artifacts get a `Automatic-Module-Name` too. @cushon can you please review this PR? If you have any question, I would be happy to answer them. Fixes #2967 Fixes #3903 FUTURE_COPYBARA_INTEGRATE_REVIEW=#3903 from HannesWell:osgiMetadata f1ee0a4 PiperOrigin-RevId: 531653111
Thank you for your review. |
benkard
pushed a commit
to benkard/jgvariant
that referenced
this pull request
Jun 18, 2023
This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [com.google.errorprone:error_prone_core](https://errorprone.info) ([source](https://github.com/google/error-prone)) | | minor | `2.19.1` -> `2.20.0` | | [com.google.errorprone:error_prone_annotations](https://errorprone.info) ([source](https://github.com/google/error-prone)) | compile | minor | `2.19.1` -> `2.20.0` | --- ### Release Notes <details> <summary>google/error-prone</summary> ### [`v2.20.0`](https://github.com/google/error-prone/releases/tag/v2.20.0): Error Prone 2.20.0 [Compare Source](google/error-prone@v2.19.1...v2.20.0) Changes: - This release is compatible with early-access builds of JDK 21. New Checkers: - [`InlineTrivialConstant`](https://errorprone.info/bugpattern/InlineTrivialConstant) - [`UnnecessaryStringBuilder`](https://errorprone.info/bugpattern/UnnecessaryStringBuilder) - [`BanClassLoader`](https://errorprone.info/bugpattern/BanClassLoader) - [`DereferenceWithNullBranch`](https://errorprone.info/bugpattern/DereferenceWithNullBranch) - [`DoNotUseRuleChain`](https://errorprone.info/bugpattern/DoNotUseRuleChain) - [`LockOnNonEnclosingClassLiteral`](https://errorprone.info/bugpattern/LockOnNonEnclosingClassLiteral) - [`MissingRefasterAnnotation`](https://errorprone.info/bugpattern/MissingRefasterAnnotation) - [`NamedLikeContextualKeyword`](https://errorprone.info/bugpattern/NamedLikeContextualKeyword) - [`NonApiType`](https://errorprone.info/bugpattern/NonApiType) Fixes issues: [#​2232](google/error-prone#2232), [#​2243](google/error-prone#2243), [#​2997](google/error-prone#2997), [#​3301](google/error-prone#3301), [#​3843](google/error-prone#3843), [#​3903](google/error-prone#3903), [#​3918](google/error-prone#3918), [#​3923](google/error-prone#3923), [#​3931](google/error-prone#3931), [#​3945](google/error-prone#3945), [#​3946](google/error-prone#3946) **Full Changelog**: google/error-prone@v2.19.1...v2.20.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
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.
As suggested in #2967 (comment) this PR aims to add OSGi runtime metadata to the error-prone jars.
It achieves this by employing the bnd-maven-plugin:bnd-process goal to generate the OSGi metadata, like the values of the Manifest headers
Bundle-SymbolicName
,Import-Package
andExport-Package
.The schema used for
Bundle-SymbolicName
headers is based on the schema used for theAutomatic-Module-Name
in the error-prone-annotations artifact.With this change additionally all other error-prone artifacts get a
Automatic-Module-Name
too.@cushon can you please review this PR? If you have any question, I would be happy to answer them.
Fixes #2967