From d209b0c19a568b5385b968da17f2cd5ef670331a Mon Sep 17 00:00:00 2001 From: Sam Gammon Date: Wed, 6 Mar 2024 10:35:16 -0800 Subject: [PATCH] feat: add jpms definition for `annotations` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - feat: add `module-info` to `annotations` module - feat: ship `annotations` as a `Multi-Release` JAR - feat: support `1.8` through latest JDK for `annotations` module - fix: `HEAD-SNAPSHOT` → `1.0-HEAD-SNAPSHOT`, because of a Maven Compiler Plugin issue precluding use as a module version[0] [0]: https://issues.apache.org/jira/browse/MCOMPILER-579 Signed-off-by: Sam Gammon --- annotation/pom.xml | 2 +- annotations/pom.xml | 36 ++++++++++++++++++++-- annotations/src/main/java/module-info.java | 22 +++++++++++++ check_api/pom.xml | 2 +- core/pom.xml | 2 +- docgen/pom.xml | 2 +- docgen_processor/pom.xml | 2 +- pom.xml | 12 +++++++- refaster/pom.xml | 2 +- test_helpers/pom.xml | 2 +- type_annotations/pom.xml | 2 +- 11 files changed, 74 insertions(+), 12 deletions(-) create mode 100644 annotations/src/main/java/module-info.java diff --git a/annotation/pom.xml b/annotation/pom.xml index 59f69a89d89..fbbba7c5524 100644 --- a/annotation/pom.xml +++ b/annotation/pom.xml @@ -21,7 +21,7 @@ com.google.errorprone error_prone_parent - HEAD-SNAPSHOT + 1.0-HEAD-SNAPSHOT @BugPattern annotation diff --git a/annotations/pom.xml b/annotations/pom.xml index 03c522c0391..39a06275850 100644 --- a/annotations/pom.xml +++ b/annotations/pom.xml @@ -21,7 +21,7 @@ com.google.errorprone error_prone_parent - HEAD-SNAPSHOT + 1.0-HEAD-SNAPSHOT error-prone annotations @@ -49,10 +49,40 @@ org.apache.maven.plugins maven-compiler-plugin - 8 - 8 + + + default-compile + + 1.8 + 1.8 + + module-info.java + + + + + compile-java9 + + 9 + 9 + 9 + true + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + + + diff --git a/annotations/src/main/java/module-info.java b/annotations/src/main/java/module-info.java new file mode 100644 index 00000000000..72215b76776 --- /dev/null +++ b/annotations/src/main/java/module-info.java @@ -0,0 +1,22 @@ +/* + * Copyright 2015 The Error Prone Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +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/check_api/pom.xml b/check_api/pom.xml index 397c42e88c6..1a96ffd6473 100644 --- a/check_api/pom.xml +++ b/check_api/pom.xml @@ -21,7 +21,7 @@ com.google.errorprone error_prone_parent - HEAD-SNAPSHOT + 1.0-HEAD-SNAPSHOT error-prone check api diff --git a/core/pom.xml b/core/pom.xml index 68eae1cd680..1eb5aec8f77 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -21,7 +21,7 @@ com.google.errorprone error_prone_parent - HEAD-SNAPSHOT + 1.0-HEAD-SNAPSHOT error-prone library diff --git a/docgen/pom.xml b/docgen/pom.xml index 784673a1d5d..8ee00587502 100644 --- a/docgen/pom.xml +++ b/docgen/pom.xml @@ -21,7 +21,7 @@ com.google.errorprone error_prone_parent - HEAD-SNAPSHOT + 1.0-HEAD-SNAPSHOT Documentation tool for generating Error Prone bugpattern documentation diff --git a/docgen_processor/pom.xml b/docgen_processor/pom.xml index 351787a725f..7d97a4cb4ca 100644 --- a/docgen_processor/pom.xml +++ b/docgen_processor/pom.xml @@ -21,7 +21,7 @@ com.google.errorprone error_prone_parent - HEAD-SNAPSHOT + 1.0-HEAD-SNAPSHOT JSR-269 annotation processor for @BugPattern annotation diff --git a/pom.xml b/pom.xml index 09b4a4b3f88..f7cad3c75bd 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ Error Prone parent POM com.google.errorprone error_prone_parent - HEAD-SNAPSHOT + 1.0-HEAD-SNAPSHOT pom Error Prone is a static analysis tool for Java that catches common programming mistakes at compile-time. @@ -204,6 +204,16 @@ **/testdata/** + + + default-compile + + + -Xlint:-options + + + + org.apache.maven.plugins diff --git a/refaster/pom.xml b/refaster/pom.xml index d7951f0e492..968b0c2bae4 100644 --- a/refaster/pom.xml +++ b/refaster/pom.xml @@ -19,7 +19,7 @@ error_prone_parent com.google.errorprone - HEAD-SNAPSHOT + 1.0-HEAD-SNAPSHOT 4.0.0 diff --git a/test_helpers/pom.xml b/test_helpers/pom.xml index cf4af121a75..76fbfaf30d9 100644 --- a/test_helpers/pom.xml +++ b/test_helpers/pom.xml @@ -21,7 +21,7 @@ com.google.errorprone error_prone_parent - HEAD-SNAPSHOT + 1.0-HEAD-SNAPSHOT error-prone test helpers diff --git a/type_annotations/pom.xml b/type_annotations/pom.xml index b2495a2167f..365123af188 100644 --- a/type_annotations/pom.xml +++ b/type_annotations/pom.xml @@ -21,7 +21,7 @@ com.google.errorprone error_prone_parent - HEAD-SNAPSHOT + 1.0-HEAD-SNAPSHOT error-prone type annotations