Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 43 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion build-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<packaging>pom</packaging>
<modules>
<module>common</module>
<module>factory</module>
<module>service</module>
<module>value</module>
<module>factory</module>
</modules>
<distributionManagement>
<repository>
Expand Down
32 changes: 28 additions & 4 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<groupId>com.google.auto</groupId>
<artifactId>auto-common</artifactId>
<version>HEAD-SNAPSHOT</version>
<version>999.0.0-SNAPSHOT</version>
<name>Auto Common Libraries</name>
<description>
Common utilities for creating annotation processors.
Expand All @@ -29,7 +29,6 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<guava.version>33.5.0-jre</guava.version>
<truth.version>1.4.5</truth.version>
</properties>
Expand Down Expand Up @@ -111,17 +110,42 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
<testExcludes combine.children="append" />
</configuration>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<release>9</release>
</configuration>
</execution>
<execution>
<id>base-compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<excludes>
<exclude>module-info.java</exclude>
</excludes>
<release>8</release>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down
27 changes: 27 additions & 0 deletions common/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -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;
}
72 changes: 65 additions & 7 deletions factory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<groupId>com.google.auto.factory</groupId>
<artifactId>auto-factory</artifactId>
<version>HEAD-SNAPSHOT</version>
<version>999.0.0-SNAPSHOT</version>
<name>AutoFactory</name>
<description>
JSR-330-compatible factories.
Expand All @@ -30,9 +30,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<auto-service.version>1.1.1</auto-service.version>
<auto-value.version>1.11.0</auto-value.version>
<java.version>1.8</java.version>
<auto-service.version>999.0.0-SNAPSHOT</auto-service.version>
<auto-value.version>999.0.0-SNAPSHOT</auto-value.version>
<guava.version>33.5.0-jre</guava.version>
<truth.version>1.4.5</truth.version>
</properties>
Expand Down Expand Up @@ -95,7 +94,7 @@
<dependency>
<groupId>com.google.auto</groupId>
<artifactId>auto-common</artifactId>
<version>1.2.2</version>
<version>999.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.auto.value</groupId>
Expand Down Expand Up @@ -180,8 +179,6 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
Expand All @@ -203,6 +200,60 @@
</path>
</annotationProcessorPaths>
</configuration>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<release>9</release>
<annotationProcessorPaths>
<path>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>${auto-service.version}</version>
</path>
<path>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>${auto-value.version}</version>
</path>
<path>
<groupId>net.ltgt.gradle.incap</groupId>
<artifactId>incap-processor</artifactId>
<version>1.0.0</version>
</path>
</annotationProcessorPaths>
</configuration>
</execution>
<execution>
<id>base-compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<excludes>
<exclude>module-info.java</exclude>
</excludes>
<release>8</release>
<annotationProcessorPaths>
<path>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>${auto-service.version}</version>
</path>
<path>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>${auto-value.version}</version>
</path>
<path>
<groupId>net.ltgt.gradle.incap</groupId>
<artifactId>incap-processor</artifactId>
<version>1.0.0</version>
</path>
</annotationProcessorPaths>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down Expand Up @@ -241,6 +292,13 @@
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
Expand Down
33 changes: 33 additions & 0 deletions factory/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -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;
}
12 changes: 1 addition & 11 deletions service/annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
<parent>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service-aggregator</artifactId>
<version>HEAD-SNAPSHOT</version>
<version>999.0.0-SNAPSHOT</version>
</parent>

<groupId>com.google.auto.service</groupId>
<artifactId>auto-service-annotations</artifactId>
<version>HEAD-SNAPSHOT</version>
<name>AutoService</name>
<description>
Provider-configuration files for ServiceLoader.
Expand All @@ -44,21 +43,12 @@
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>com.google.auto.service</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- disable processing because the definition in META-INF/services breaks javac -->
<compilerArgument>-proc:none</compilerArgument>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
Expand Down
22 changes: 22 additions & 0 deletions service/annotations/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -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;
}
Loading
Loading