diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index aec8a7e9a..f45d2c83e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,4 +4,4 @@ # For syntax help see: # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax -* @googleapis/yoshi-java +* @googleapis/actools-java @googleapis/yoshi-java diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index a48126be3..1db1802ae 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -5,7 +5,6 @@ branchProtectionRules: - pattern: master isAdminEnforced: true requiredStatusCheckContexts: - - 'continuous-integration/travis-ci' - 'codecov/patch' - 'codecov/project' - 'cla/google' diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..1a7605026 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,38 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + env: + # Customize the JVM maximum heap limit + JVM_OPTS: -Xmx3200m + TERM: dumb + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - name: Gradle Assemble + run: ./gradlew assemble + - name: Gradle Test + run: ./gradlew test + - name: Gradle Build + run: ./gradlew build install + - name: coverage + uses: codecov/codecov-action@v1 + with: + name: actions ${{ matrix.java }} + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Java Linter + run: ./gradlew googleJavaFormat diff --git a/.gitignore b/.gitignore index 1204a607d..a09410d53 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ tmp_gh-pages *.iml *.iws *.ipr + +# Vim +*.sw* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2e07a726e..000000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -sudo: false -dist: trusty -language: java -addons: - # https://github.com/travis-ci/travis-ci/issues/5227#issuecomment-165131913 - hosts: - - fake-hostname-to-work-around-travis-bug - hostname: fake-hostname-to-work-around-travis-bug -jdk: - - oraclejdk8 - - openjdk8 -script: - ./gradlew check --info -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f7a8264a..c23d353a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.10.2](https://www.github.com/googleapis/api-common-java/compare/v1.10.1...v1.10.2) (2021-04-19) + + +### Dependencies + +* guava 30.1.1 ([#207](https://www.github.com/googleapis/api-common-java/issues/207)) ([20578a0](https://www.github.com/googleapis/api-common-java/commit/20578a00e5b4ba2f9c4482eccf55ffa37ab12335)) + ### [1.10.1](https://www.github.com/googleapis/api-common-java/compare/v1.10.0...v1.10.1) (2020-10-16) diff --git a/README.md b/README.md index 75f7ee118..51f24b3e9 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ API Common for Java [![Code Coverage](https://img.shields.io/codecov/c/github/googleapis/api-common-java.svg)](https://codecov.io/github/googleapis/api-common-java) -- [Documentation](http://googleapis.github.io/api-common-java/apidocs) +- [Documentation](https://googleapis.dev/java/api-common/latest/index.html) API Common for Java is a library for foundational types relating to Google APIs. It currently contains the following packages: diff --git a/build.gradle b/build.gradle index 917607491..8eb9998e8 100644 --- a/build.gradle +++ b/build.gradle @@ -7,10 +7,9 @@ buildscript { url 'https://plugins.gradle.org/m2/' } mavenCentral() - jcenter() } dependencies { - classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.8", + classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.9", "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.21.2" } } @@ -28,7 +27,7 @@ apply plugin: 'io.codearte.nexus-staging' group = "com.google.api" archivesBaseName = "api-common" -project.version = "1.10.1" // {x-version-update:api-common:current} +project.version = "1.10.2" // {x-version-update:api-common:current} sourceCompatibility = 1.7 targetCompatibility = 1.7 @@ -40,15 +39,15 @@ ext { // Shortcuts for libraries we are using libraries = [ javax_annotations: 'javax.annotation:javax.annotation-api:1.3.2', - auto_value_annotations: 'com.google.auto.value:auto-value-annotations:1.7.4', - auto_value: 'com.google.auto.value:auto-value:1.7.4', - guava: 'com.google.guava:guava:29.0-android', + auto_value: 'com.google.auto.value:auto-value:1.8', + auto_value_annotations: 'com.google.auto.value:auto-value-annotations:1.8', + guava: 'com.google.guava:guava:30.1.1-android', jsr305: 'com.google.code.findbugs:jsr305:3.0.2', - error_prone_annotations: 'com.google.errorprone:error_prone_annotations:2.4.0', + error_prone_annotations: 'com.google.errorprone:error_prone_annotations:2.6.0', // Testing - junit: 'junit:junit:4.13.1', - truth: 'com.google.truth:truth:1.0.1', + junit: 'junit:junit:4.13.2', + truth: 'com.google.truth:truth:1.1.2', ] } diff --git a/src/main/java/com/google/api/core/AbstractApiService.java b/src/main/java/com/google/api/core/AbstractApiService.java index d32f1e410..8b627e659 100644 --- a/src/main/java/com/google/api/core/AbstractApiService.java +++ b/src/main/java/com/google/api/core/AbstractApiService.java @@ -38,11 +38,11 @@ import java.util.concurrent.TimeoutException; /** - * Base class for {@link ApiService}. Similar to Guava's {@code AbstractService} but redeclared to + * Base class for {@link ApiService}. Similar to Guava's {@code AbstractService} but redeclared so * that Guava can be shaded. */ public abstract class AbstractApiService implements ApiService { - private static final ImmutableMap guavaToGaxState = + private static final ImmutableMap GUAVA_TO_API_SERVICE_STATE = ImmutableMap.builder() .put(Service.State.FAILED, ApiService.State.FAILED) .put(Service.State.NEW, ApiService.State.NEW) @@ -66,7 +66,7 @@ public void addListener(final ApiService.Listener listener, Executor executor) { new Service.Listener() { @Override public void failed(Service.State from, Throwable failure) { - listener.failed(guavaToGaxState.get(from), failure); + listener.failed(GUAVA_TO_API_SERVICE_STATE.get(from), failure); } @Override @@ -81,12 +81,12 @@ public void starting() { @Override public void stopping(Service.State from) { - listener.stopping(guavaToGaxState.get(from)); + listener.stopping(GUAVA_TO_API_SERVICE_STATE.get(from)); } @Override public void terminated(Service.State from) { - listener.terminated(guavaToGaxState.get(from)); + listener.terminated(GUAVA_TO_API_SERVICE_STATE.get(from)); } }, executor); @@ -122,7 +122,7 @@ public ApiService startAsync() { } public State state() { - return guavaToGaxState.get(impl.state()); + return GUAVA_TO_API_SERVICE_STATE.get(impl.state()); } public ApiService stopAsync() { diff --git a/src/main/java/com/google/api/core/ApiFutureToListenableFuture.java b/src/main/java/com/google/api/core/ApiFutureToListenableFuture.java index fc8745231..681a0d87d 100644 --- a/src/main/java/com/google/api/core/ApiFutureToListenableFuture.java +++ b/src/main/java/com/google/api/core/ApiFutureToListenableFuture.java @@ -37,7 +37,7 @@ import java.util.concurrent.TimeoutException; /** - * INTERNAL USE ONLY. Adapter from GAX ApiFuture to Guava ListenableFuture. + * INTERNAL USE ONLY. Adapter from ApiFuture to Guava ListenableFuture. */ @InternalApi public class ApiFutureToListenableFuture implements ListenableFuture { diff --git a/src/main/java/com/google/api/core/ApiFutures.java b/src/main/java/com/google/api/core/ApiFutures.java index e25170fea..5e4f9f176 100644 --- a/src/main/java/com/google/api/core/ApiFutures.java +++ b/src/main/java/com/google/api/core/ApiFutures.java @@ -99,7 +99,7 @@ public static ApiFuture catching( Futures.catching( listenableFutureForApiFuture(input), exceptionType, - new GaxFunctionToGuavaFunction(callback), + new ApiFunctionToGuavaFunction(callback), executor); return new ListenableFutureToApiFuture(catchingFuture); } @@ -156,7 +156,7 @@ public static ApiFuture transform( return new ListenableFutureToApiFuture<>( Futures.transform( listenableFutureForApiFuture(input), - new GaxFunctionToGuavaFunction(function), + new ApiFunctionToGuavaFunction(function), executor)); } @@ -226,11 +226,11 @@ private static ListenableFuture listenableFutureForApiFuture(ApiFuture return listenableFuture; } - private static class GaxFunctionToGuavaFunction + private static class ApiFunctionToGuavaFunction implements com.google.common.base.Function { private ApiFunction f; - public GaxFunctionToGuavaFunction(ApiFunction f) { + public ApiFunctionToGuavaFunction(ApiFunction f) { this.f = f; } diff --git a/src/main/java/com/google/api/core/ListenableFutureToApiFuture.java b/src/main/java/com/google/api/core/ListenableFutureToApiFuture.java index 97eddd5ca..d389fedf7 100644 --- a/src/main/java/com/google/api/core/ListenableFutureToApiFuture.java +++ b/src/main/java/com/google/api/core/ListenableFutureToApiFuture.java @@ -34,7 +34,7 @@ import com.google.common.util.concurrent.ListenableFuture; /** - * INTERNAL USE ONLY. Adapter from Guava ListenableFuture to GAX ApiFuture. + * INTERNAL USE ONLY. Adapter from Guava ListenableFuture to ApiFuture. */ @InternalApi public class ListenableFutureToApiFuture extends SimpleForwardingListenableFuture diff --git a/versions.txt b/versions.txt index d70a8693c..25f951e98 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -api-common:1.10.1:1.10.1 \ No newline at end of file +api-common:1.10.2:1.10.2 \ No newline at end of file