diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38d6911ae0..b885a12f34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,11 +9,8 @@ on: - main jobs: - test: - name: "JDK ${{ matrix.java }}" - strategy: - matrix: - java: [ 8, 11, 17 ] + build: + name: "Build with JDK 11" runs-on: ubuntu-latest steps: # Cancel any previous runs for the same branch that are still running. @@ -30,21 +27,56 @@ jobs: key: maven-${{ hashFiles('**/pom.xml') }} restore-keys: | maven- + - name: 'Set up JDK 11' + uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 + with: + java-version: 11 + distribution: 'zulu' + - name: 'Build Multi-Release JAR' + shell: bash + run: mvn -B process-test-classes -U -f build-pom.xml + - name: 'Upload build artifacts' + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + with: + name: build-artifacts + path: | + **/target/classes/ + **/target/*.jar + retention-days: 1 + + test: + name: "Test on JDK ${{ matrix.java }}" + strategy: + matrix: + java: [ 8, 11, 17 ] + runs-on: ubuntu-latest + needs: build + steps: + - name: 'Check out repository' + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 + - name: 'Cache local Maven repository' + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 + with: + path: ~/.m2/repository + key: maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + maven- + - name: 'Download build artifacts' + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 + with: + name: build-artifacts - name: 'Set up JDK ${{ matrix.java }}' uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 with: java-version: ${{ matrix.java }} distribution: 'zulu' - - name: 'Install' - shell: bash - run: mvn -B dependency:go-offline test clean -U --quiet --fail-never -DskipTests=true -f build-pom.xml - name: 'Test' shell: bash - run: mvn -B verify -U --fail-at-end -Dsource.skip=true -Dmaven.javadoc.skip=true -f build-pom.xml + run: mvn -B test -U --fail-at-end -f build-pom.xml publish_snapshot: name: 'Publish snapshot' - needs: test + needs: [build, test] if: github.event_name == 'push' && github.repository == 'google/auto' runs-on: ubuntu-latest steps: @@ -75,7 +107,7 @@ jobs: permissions: contents: write name: 'Generate latest docs' - needs: test + needs: [build, test] if: github.event_name == 'push' && github.repository == 'google/auto' runs-on: ubuntu-latest steps: diff --git a/build-pom.xml b/build-pom.xml index 45a3113354..1bad41fe0a 100644 --- a/build-pom.xml +++ b/build-pom.xml @@ -7,9 +7,9 @@ pom common - factory service value + factory diff --git a/common/pom.xml b/common/pom.xml index 860d3a2499..358232fbfc 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -20,7 +20,7 @@ com.google.auto auto-common - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT Auto Common Libraries Common utilities for creating annotation processors. @@ -29,7 +29,6 @@ UTF-8 - 1.8 33.5.0-jre 1.4.5 @@ -111,17 +110,42 @@ maven-compiler-plugin 3.14.1 - ${java.version} - ${java.version} -Xlint:all true true + + + default-compile + + 9 + + + + base-compile + + compile + + + + module-info.java + + 8 + + + maven-jar-plugin 3.4.2 + + + + true + + + maven-javadoc-plugin diff --git a/common/src/main/java/module-info.java b/common/src/main/java/module-info.java new file mode 100644 index 0000000000..f4ff40ec8b --- /dev/null +++ b/common/src/main/java/module-info.java @@ -0,0 +1,27 @@ +/* + * Copyright 2024 Google LLC + * + * 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. + */ + +/** + * Common utilities for creating annotation processors. + */ +module com.google.auto.common { + requires transitive com.google.common; + requires transitive org.jspecify; + requires transitive java.compiler; + requires static com.squareup.javapoet; + + exports com.google.auto.common; +} \ No newline at end of file diff --git a/factory/pom.xml b/factory/pom.xml index f6337b39f0..fb7f465aaa 100644 --- a/factory/pom.xml +++ b/factory/pom.xml @@ -21,7 +21,7 @@ com.google.auto.factory auto-factory - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT AutoFactory JSR-330-compatible factories. @@ -30,9 +30,8 @@ UTF-8 - 1.1.1 - 1.11.0 - 1.8 + 999.0.0-SNAPSHOT + 999.0.0-SNAPSHOT 33.5.0-jre 1.4.5 @@ -95,7 +94,7 @@ com.google.auto auto-common - 1.2.2 + 999.0.0-SNAPSHOT com.google.auto.value @@ -180,8 +179,6 @@ maven-compiler-plugin 3.14.1 - ${java.version} - ${java.version} -Xlint:all true true @@ -203,6 +200,60 @@ + + + default-compile + + 9 + + + com.google.auto.service + auto-service + ${auto-service.version} + + + com.google.auto.value + auto-value + ${auto-value.version} + + + net.ltgt.gradle.incap + incap-processor + 1.0.0 + + + + + + base-compile + + compile + + + + module-info.java + + 8 + + + com.google.auto.service + auto-service + ${auto-service.version} + + + com.google.auto.value + auto-value + ${auto-value.version} + + + net.ltgt.gradle.incap + incap-processor + 1.0.0 + + + + + maven-javadoc-plugin @@ -241,6 +292,13 @@ maven-jar-plugin 3.4.2 + + + + true + + + maven-invoker-plugin diff --git a/factory/src/main/java/module-info.java b/factory/src/main/java/module-info.java new file mode 100644 index 0000000000..c5ab7bb785 --- /dev/null +++ b/factory/src/main/java/module-info.java @@ -0,0 +1,33 @@ +/* + * Copyright 2024 Google LLC + * + * 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. + */ + +/** + * JSR-330-compatible factories. + */ +module com.google.auto.factory { + requires com.google.auto.common; + requires com.google.auto.service; + requires com.google.auto.value.annotations; + requires incap; + requires com.squareup.javapoet; + requires java.compiler; + + exports com.google.auto.factory; + exports com.google.auto.factory.processor; + + provides javax.annotation.processing.Processor + with com.google.auto.factory.processor.AutoFactoryProcessor; +} \ No newline at end of file diff --git a/service/annotations/pom.xml b/service/annotations/pom.xml index f3c45baf54..493ed87211 100644 --- a/service/annotations/pom.xml +++ b/service/annotations/pom.xml @@ -21,12 +21,11 @@ com.google.auto.service auto-service-aggregator - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT com.google.auto.service auto-service-annotations - HEAD-SNAPSHOT AutoService Provider-configuration files for ServiceLoader. @@ -44,21 +43,12 @@ maven-jar-plugin - - - - com.google.auto.service - - - maven-compiler-plugin -proc:none - 1.8 - 1.8 diff --git a/service/annotations/src/main/java/module-info.java b/service/annotations/src/main/java/module-info.java new file mode 100644 index 0000000000..4932b01a9e --- /dev/null +++ b/service/annotations/src/main/java/module-info.java @@ -0,0 +1,22 @@ +/* + * Copyright 2024 Google LLC + * + * 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. + */ + +/** + * Provider-configuration files for ServiceLoader. + */ +module com.google.auto.service { + exports com.google.auto.service; +} \ No newline at end of file diff --git a/service/pom.xml b/service/pom.xml index e264622b03..8fe15600c5 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -20,7 +20,7 @@ com.google.auto.service auto-service-aggregator - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT AutoService Aggregator Aggregator POM for @AutoService @@ -30,7 +30,6 @@ UTF-8 - 1.8 33.5.0-jre 1.4.5 @@ -106,16 +105,41 @@ maven-compiler-plugin 3.14.1 - ${java.version} - ${java.version} -Xlint:all true true + + + default-compile + + 9 + + + + base-compile + + compile + + + + module-info.java + + 8 + + + maven-jar-plugin 3.4.2 + + + + true + + + diff --git a/service/processor/pom.xml b/service/processor/pom.xml index e8045096e2..319e84901e 100644 --- a/service/processor/pom.xml +++ b/service/processor/pom.xml @@ -21,12 +21,11 @@ com.google.auto.service auto-service-aggregator - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT com.google.auto.service auto-service - HEAD-SNAPSHOT AutoService Processor Provider-configuration files for ServiceLoader. @@ -49,7 +48,7 @@ com.google.auto auto-common - 1.2.2 + 999.0.0-SNAPSHOT com.google.guava diff --git a/service/processor/src/main/java/module-info.java b/service/processor/src/main/java/module-info.java new file mode 100644 index 0000000000..8410614bbf --- /dev/null +++ b/service/processor/src/main/java/module-info.java @@ -0,0 +1,29 @@ +/* + * Copyright 2024 Google LLC + * + * 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. + */ + +/** + * Annotation processor for AutoService. + */ +module com.google.auto.service.processor { + requires com.google.auto.service; + requires com.google.auto.common; + requires java.compiler; + + exports com.google.auto.service.processor; + + provides javax.annotation.processing.Processor + with com.google.auto.service.processor.AutoServiceProcessor; +} \ No newline at end of file diff --git a/value/annotations/pom.xml b/value/annotations/pom.xml index f6867453eb..888c7d0694 100644 --- a/value/annotations/pom.xml +++ b/value/annotations/pom.xml @@ -21,23 +21,19 @@ com.google.auto.value auto-value-parent - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT + ../pom.xml auto-value-annotations - HEAD-SNAPSHOT AutoValue Annotations Immutable value-type code generation for Java 8+. https://github.com/google/auto/tree/main/value - - 1.8 - - - http://github.com/google/auto + https://github.com/google/auto scm:git:git://github.com/google/auto.git scm:git:ssh://git@github.com/google/auto.git HEAD diff --git a/value/annotations/src/main/java/module-info.java b/value/annotations/src/main/java/module-info.java new file mode 100644 index 0000000000..92ee3476fa --- /dev/null +++ b/value/annotations/src/main/java/module-info.java @@ -0,0 +1,25 @@ +/* + * Copyright 2024 Google LLC + * + * 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. + */ + +/** + * Immutable value-type code generation for Java 8+. + */ +module com.google.auto.value.annotations { + exports com.google.auto.value; + exports com.google.auto.value.extension.memoized; + exports com.google.auto.value.extension.serializable; + exports com.google.auto.value.extension.toprettystring; +} \ No newline at end of file diff --git a/value/pom.xml b/value/pom.xml index 789191d0b6..fbb666d07a 100644 --- a/value/pom.xml +++ b/value/pom.xml @@ -20,7 +20,7 @@ com.google.auto.value auto-value-parent - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT AutoValue Parent Immutable value-type code generation for Java 8+. @@ -30,7 +30,6 @@ UTF-8 - 1.8 33.5.0-jre @@ -76,7 +75,6 @@ annotations processor - src/it/functional @@ -171,13 +169,29 @@ maven-compiler-plugin 3.14.1 - ${java.version} - ${java.version} -Xlint:all true true + + default-compile + + 9 + + + + base-compile + + compile + + + + module-info.java + + 8 + + default-testCompile test-compile @@ -195,6 +209,13 @@ maven-jar-plugin 3.4.2 + + + + true + + + maven-invoker-plugin @@ -232,9 +253,6 @@ [11,) - - src/it/gwtserializer - before-java-17 diff --git a/value/processor/pom.xml b/value/processor/pom.xml index 1bf4890816..3cc1250aa1 100644 --- a/value/processor/pom.xml +++ b/value/processor/pom.xml @@ -21,11 +21,11 @@ com.google.auto.value auto-value-parent - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT + ../pom.xml auto-value - HEAD-SNAPSHOT AutoValue Processor Immutable value-type code generation for Java 8+. @@ -48,7 +48,7 @@ com.google.auto auto-common - 1.2.2 + 999.0.0-SNAPSHOT com.google.auto.service diff --git a/value/processor/src/main/java/module-info.java b/value/processor/src/main/java/module-info.java new file mode 100644 index 0000000000..643a6e490e --- /dev/null +++ b/value/processor/src/main/java/module-info.java @@ -0,0 +1,39 @@ +/* + * Copyright 2024 Google LLC + * + * 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. + */ + +/** + * Annotation processors for AutoValue. + */ +module com.google.auto.value.processor { + requires com.google.auto.common; + requires com.google.auto.service; + requires com.google.errorprone.annotations; + requires com.google.escapevelocity; + requires net.ltgt.gradle.incap; + requires com.squareup.javapoet; + requires org.objectweb.asm; + requires java.compiler; + + exports com.google.auto.value.processor; + exports com.google.auto.value.extension.memoized.processor; + exports com.google.auto.value.extension.serializable.processor; + exports com.google.auto.value.extension.toprettystring.processor; + + provides javax.annotation.processing.Processor + with com.google.auto.value.processor.AutoValueProcessor, + com.google.auto.value.processor.AutoAnnotationProcessor, + com.google.auto.value.processor.AutoBuilderProcessor; +} \ No newline at end of file diff --git a/value/src/it/functional/pom.xml b/value/src/it/functional/pom.xml index 0d8963a603..5e3459c4d9 100644 --- a/value/src/it/functional/pom.xml +++ b/value/src/it/functional/pom.xml @@ -22,14 +22,13 @@ com.google.auto.value auto-value-parent - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT ../../../pom.xml https://github.com/google/auto/tree/main/value com.google.auto.value.it.functional functional - HEAD-SNAPSHOT Auto-Value Functional Integration Test 2.2.20 diff --git a/value/src/it/gwtserializer/pom.xml b/value/src/it/gwtserializer/pom.xml index 4f9671567f..790fdd0c37 100644 --- a/value/src/it/gwtserializer/pom.xml +++ b/value/src/it/gwtserializer/pom.xml @@ -22,14 +22,13 @@ com.google.auto.value auto-value-parent - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT ../../../pom.xml https://github.com/google/auto/tree/main/value com.google.auto.value.it.gwtserializer gwtserializer - HEAD-SNAPSHOT Auto-Value GWT-RPC Serialization Integration Test