Add the 'compile' goal for 'compile-java9'#4314
Add the 'compile' goal for 'compile-java9'#4314cushon wants to merge 4 commits intogoogle:masterfrom
Conversation
and update to a newer version of bnd for multi-release jar support, see bndtools/bnd#2227.
|
Hmm, the version of bnd that supports mr-jars requires JDK 17: |
|
@cushon Whoops! I can't believe that wasn't running. I thought I verified the JAR output. I'll check locally with this change applied and verify it with Guava downstream. Re/BND, the MRJAR is assembled by the JAR step, and BND tools isn't aware of it. I don't think it needs to be aware of it. There are BND directives for generating As far as BND loading MRJARs, I know that support is lacking there too, but the classes under |
|
@cushon Adding this directive to the BND tools fixes the build issue with classes in the MRJAR root: The final block in root <bnd><![CDATA[
Bundle-SymbolicName: com.google.$<replacestring;$<replacestring;${project.artifactId};^error_prone;errorprone>;_;.>
Automatic-Module-Name: $<Bundle-SymbolicName>
-exportcontents: com.google.errorprone*
-noextraheaders: true
-removeheaders: Private-Package
-fixupmessages: ^Classes found in the wrong directory: .*
]]></bnd>I'm just starting my day, so I'll be around. If you want me to push a PR to fix this let me know |
|
@cushon While you're at it, please remove |
|
@cushon A quick patch, I've verified it includes the classes and only the diff --git a/annotations/pom.xml b/annotations/pom.xml
index 39a0627585..e68d412cbc 100644
--- a/annotations/pom.xml
+++ b/annotations/pom.xml
@@ -64,6 +64,9 @@
</execution>
<execution>
<id>compile-java9</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
<configuration>
<source>9</source>
<target>9</target>
@@ -82,6 +85,9 @@
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
+ <excludes>
+ <exclude>/META-INF/versions/9/com/**/*.class</exclude>
+ </excludes>
</configuration>
</plugin>
</plugins>
diff --git a/pom.xml b/pom.xml
index f7cad3c75b..7c0fc99120 100644
--- a/pom.xml
+++ b/pom.xml
@@ -153,6 +153,7 @@
-exportcontents: com.google.errorprone*
-noextraheaders: true
-removeheaders: Private-Package
+ -fixupmessages: ^Classes found in the wrong directory: .*
]]></bnd>
</configuration>
</execution> |
|
@anthonyvdotbe I was under the impression that all Java modules had to depend on |
|
I'm seeing the JDK 11 failure @cushon. I think I have a fix for that too. |
|
Okay. Thank you @anthonyvdotbe, I learned something today. The This patch
diff --git a/annotations/pom.xml b/annotations/pom.xml
index 39a0627585..e68d412cbc 100644
--- a/annotations/pom.xml
+++ b/annotations/pom.xml
@@ -64,6 +64,9 @@
</execution>
<execution>
<id>compile-java9</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
<configuration>
<source>9</source>
<target>9</target>
@@ -82,6 +85,9 @@
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
+ <excludes>
+ <exclude>/META-INF/versions/9/com/**/*.class</exclude>
+ </excludes>
</configuration>
</plugin>
</plugins>
diff --git a/annotations/src/main/java/module-info.java b/annotations/src/main/java/module-info.java
index 72215b7677..4c9077dd52 100644
--- a/annotations/src/main/java/module-info.java
+++ b/annotations/src/main/java/module-info.java
@@ -15,7 +15,6 @@
*/
open module com.google.errorprone.annotation {
- requires java.base;
requires java.compiler;
exports com.google.errorprone.annotations;
exports com.google.errorprone.annotations.concurrent;
diff --git a/pom.xml b/pom.xml
index f7cad3c75b..3dc704b4f8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -150,9 +150,10 @@
<bnd><![CDATA[
Bundle-SymbolicName: com.google.$<replacestring;$<replacestring;${project.artifactId};^error_prone;errorprone>;_;.>
Automatic-Module-Name: $<Bundle-SymbolicName>
- -exportcontents: com.google.errorprone*
+ -exportcontents: com.google.errorprone*,!META-INF.*
-noextraheaders: true
-removeheaders: Private-Package
+ -fixupmessages: ^Classes found in the wrong directory: .*
]]></bnd>
</configuration>
</execution>cc / @cushon |
google#4314 (comment) * Remove unnecessary `requires java.base;` * Excludes META-INF from BND (see !META-INF...)
|
Thanks @sgammon! I pushed another commit that includes the additional changes. |
#4314 (comment) Fixes #4314 FUTURE_COPYBARA_INTEGRATE_REVIEW=#4314 from cushon:module 604430d PiperOrigin-RevId: 614272829
#4314 (comment) Fixes #4314 FUTURE_COPYBARA_INTEGRATE_REVIEW=#4314 from cushon:module 604430d PiperOrigin-RevId: 614272829
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.25.0` -> `2.26.1` | | [com.google.errorprone:error_prone_annotations](https://errorprone.info) ([source](https://github.com/google/error-prone)) | compile | minor | `2.25.0` -> `2.26.1` | --- ### Release Notes <details> <summary>google/error-prone</summary> ### [`v2.26.1`](https://github.com/google/error-prone/releases/tag/v2.26.1): Error Prone 2.26.1 [Compare Source](google/error-prone@v2.26.0...v2.26.1) Changes: - Fix the module name of the annotations artifact: `com.google.errorprone.annotations` (google/error-prone@9d99ee7) Full Changelog: google/error-prone@v2.26.0...v2.26.1 ### [`v2.26.0`](https://github.com/google/error-prone/releases/tag/v2.26.0): Error Prone 2.26.0 [Compare Source](google/error-prone@v2.25.0...v2.26.0) Changes: - The 'annotations' artifact now includes a `module-info.java` for Java Platform Module System support, thanks to [@​sgammon](https://github.com/sgammon) in [#​4311](google/error-prone#4311). - Disabled checks passed to `-XepPatchChecks` are now ignored, instead of causing a crash. Thanks to [@​oxkitsune](https://github.com/oxkitsune) in [#​4028](google/error-prone#4028). New checks: - [`SystemConsoleNull`](https://errorprone.info/bugpattern/SystemConsoleNull): Null-checking `System.console()` is not a reliable way to detect if the console is connected to a terminal. - [`EnumOrdinal`](https://errorprone.info/bugpattern/EnumOrdinal): Discourage uses of `Enum.ordinal()` Closed issues: [#​2649](google/error-prone#2649), [#​3908](google/error-prone#3908), [#​4028](google/error-prone#4028), [#​4311](google/error-prone#4311), [#​4314](google/error-prone#4314) Full Changelog: google/error-prone@v2.25.0...v2.26.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-->
and update to a newer version of bnd for multi-release jar support, see bndtools/bnd#2227.