Skip to content

Commit

Permalink
feat: add jpms definition for annotations
Browse files Browse the repository at this point in the history
- 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 <sam@elide.ventures>
  • Loading branch information
sgammon committed Mar 8, 2024
1 parent 9da2d55 commit d209b0c
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 12 deletions.
2 changes: 1 addition & 1 deletion annotation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_parent</artifactId>
<version>HEAD-SNAPSHOT</version>
<version>1.0-HEAD-SNAPSHOT</version>
</parent>

<name>@BugPattern annotation</name>
Expand Down
36 changes: 33 additions & 3 deletions annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_parent</artifactId>
<version>HEAD-SNAPSHOT</version>
<version>1.0-HEAD-SNAPSHOT</version>
</parent>

<name>error-prone annotations</name>
Expand Down Expand Up @@ -49,10 +49,40 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
<compilerArgs combine.self="override" />
</configuration>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<source>1.8</source>
<target>1.8</target>
<excludes>
<exclude>module-info.java</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>compile-java9</id>
<configuration>
<source>9</source>
<target>9</target>
<release>9</release>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
22 changes: 22 additions & 0 deletions annotations/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -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;
}
2 changes: 1 addition & 1 deletion check_api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_parent</artifactId>
<version>HEAD-SNAPSHOT</version>
<version>1.0-HEAD-SNAPSHOT</version>
</parent>

<name>error-prone check api</name>
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_parent</artifactId>
<version>HEAD-SNAPSHOT</version>
<version>1.0-HEAD-SNAPSHOT</version>
</parent>

<name>error-prone library</name>
Expand Down
2 changes: 1 addition & 1 deletion docgen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_parent</artifactId>
<version>HEAD-SNAPSHOT</version>
<version>1.0-HEAD-SNAPSHOT</version>
</parent>

<name>Documentation tool for generating Error Prone bugpattern documentation</name>
Expand Down
2 changes: 1 addition & 1 deletion docgen_processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_parent</artifactId>
<version>HEAD-SNAPSHOT</version>
<version>1.0-HEAD-SNAPSHOT</version>
</parent>

<name>JSR-269 annotation processor for @BugPattern annotation</name>
Expand Down
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<name>Error Prone parent POM</name>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_parent</artifactId>
<version>HEAD-SNAPSHOT</version>
<version>1.0-HEAD-SNAPSHOT</version>
<packaging>pom</packaging>

<description>Error Prone is a static analysis tool for Java that catches common programming mistakes at compile-time.</description>
Expand Down Expand Up @@ -204,6 +204,16 @@
<exclude>**/testdata/**</exclude>
</testExcludes>
</configuration>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<compilerArgs combine.children="append">
<arg>-Xlint:-options</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
2 changes: 1 addition & 1 deletion refaster/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<artifactId>error_prone_parent</artifactId>
<groupId>com.google.errorprone</groupId>
<version>HEAD-SNAPSHOT</version>
<version>1.0-HEAD-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion test_helpers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_parent</artifactId>
<version>HEAD-SNAPSHOT</version>
<version>1.0-HEAD-SNAPSHOT</version>
</parent>

<name>error-prone test helpers</name>
Expand Down
2 changes: 1 addition & 1 deletion type_annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_parent</artifactId>
<version>HEAD-SNAPSHOT</version>
<version>1.0-HEAD-SNAPSHOT</version>
</parent>

<name>error-prone type annotations</name>
Expand Down

0 comments on commit d209b0c

Please sign in to comment.