diff --git a/.github/release-please.yml b/.github/release-please.yml index 8275c4f37..8b034773a 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -18,3 +18,7 @@ branches: bumpMinorPreMajor: true handleGHRelease: true branch: 2.1.x + - releaseType: java-backport + bumpMinorPreMajor: true + handleGHRelease: true + branch: 2.2.x diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 0689f05cb..a1587888c 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -5,8 +5,10 @@ branchProtectionRules: - pattern: main isAdminEnforced: true requiredStatusCheckContexts: - - units - - format + - units (8) + - units (11) + - units (17) + - lint - cla/google requiredApprovingReviewCount: 1 requiresCodeOwnerReviews: true @@ -14,8 +16,10 @@ branchProtectionRules: - pattern: 1.10.1-sp isAdminEnforced: true requiredStatusCheckContexts: - - units - - format + - units (8) + - units (11) + - units (17) + - lint - cla/google requiredApprovingReviewCount: 1 requiresCodeOwnerReviews: true @@ -23,8 +27,10 @@ branchProtectionRules: - pattern: java7 isAdminEnforced: true requiredStatusCheckContexts: - - units - - format + - units (8) + - units (11) + - units (17) + - lint - cla/google requiredApprovingReviewCount: 1 requiresCodeOwnerReviews: true @@ -32,8 +38,10 @@ branchProtectionRules: - pattern: 2.0.x isAdminEnforced: true requiredStatusCheckContexts: - - units - - format + - units (8) + - units (11) + - units (17) + - lint - cla/google requiredApprovingReviewCount: 1 requiresCodeOwnerReviews: true @@ -41,8 +49,21 @@ branchProtectionRules: - pattern: 2.1.x isAdminEnforced: true requiredStatusCheckContexts: - - units - - format + - units (8) + - units (11) + - units (17) + - lint + - cla/google + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: true + - pattern: 2.2.x + isAdminEnforced: true + requiredStatusCheckContexts: + - units (8) + - units (11) + - units (17) + - lint - cla/google requiredApprovingReviewCount: 1 requiresCodeOwnerReviews: true diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 89788f258..663e62aaf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,30 +5,92 @@ on: pull_request: name: ci jobs: + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 8 + - run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 11 + - run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr + units-8: + name: units (8) + runs-on: ubuntu-latest + steps: + - name: Get current week within the year + id: date + run: echo "::set-output name=week_of_year::$(date +'%W' --utc)" + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: 8 + distribution: temurin + - run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV + - uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: temurin + - run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV + - uses: actions/cache@v3 + id: mvn-cache + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }} + - run: .kokoro/build.sh + env: + JOB_TYPE: test + JOB_NAME: units-8 units: runs-on: ubuntu-latest - env: - # Customize the JVM maximum heap limit - JVM_OPTS: -Xmx3200m - TERM: dumb + strategy: + fail-fast: false + matrix: + java: [ 11, 17 ] 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 publishToMavenLocal - format: + - name: Get current week within the year + id: date + run: echo "::set-output name=week_of_year::$(date +'%W' --utc)" + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: ${{matrix.java}} + - run: java -version + - uses: actions/cache@v3 + id: mvn-cache + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }} + - run: .kokoro/build.sh + env: + JOB_TYPE: test + JOB_NAME: units-${{matrix.java}} + lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: 8 - - name: Java Linter - run: ./gradlew googleJavaFormat + - name: Get current week within the year + id: date + run: echo "::set-output name=week_of_year::$(date +'%W' --utc)" + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 11 + - run: java -version + - uses: actions/cache@v3 + id: mvn-cache + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }} + - run: java -version + - run: mvn -B -ntp com.coveo:fmt-maven-plugin:check + - run: mvn -B -ntp checkstyle:check@checkstyle diff --git a/.github/workflows/downstream.yaml b/.github/workflows/downstream.yaml index a61ff8d7a..250194a16 100644 --- a/.github/workflows/downstream.yaml +++ b/.github/workflows/downstream.yaml @@ -136,7 +136,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-java@v3 with: - distribution: zulu + distribution: temurin java-version: ${{matrix.java}} - run: java -version - run: sudo apt-get update -y diff --git a/.gitignore b/.gitignore index a09410d53..517384895 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ tmp_gh-pages # Vim *.sw* + +target/ diff --git a/.kokoro/build.bat b/.kokoro/build.bat deleted file mode 100644 index 05826ad93..000000000 --- a/.kokoro/build.bat +++ /dev/null @@ -1,3 +0,0 @@ -:: See documentation in type-shell-output.bat - -"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh index fbf2695f4..38ab4128a 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -15,11 +15,55 @@ set -eo pipefail -cd github/api-common-java/ +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. -# Print out Java +# include common functions +source ${scriptDir}/common.sh + +function setJava() { + export JAVA_HOME=$1 + export PATH=${JAVA_HOME}/bin:$PATH +} + +# This project requires compiling the classes in JDK 11 or higher for GraalVM +# classes. Compiling this project with Java 8 or earlier would fail with "class +# file has wrong version 55.0, should be 53.0" and "unrecognized --release 8 +# option" (set in build.gradle). +if [ ! -z "${JAVA11_HOME}" ]; then + setJava "${JAVA11_HOME}" +fi + +echo "Compiling using Java:" java -version -echo $JOB_TYPE +mvn clean install -B -ntp -DskipTests + +# We ensure the generated class files are compatible with Java 8 +if [ ! -z "${JAVA8_HOME}" ]; then + setJava "${JAVA8_HOME}" +fi + +RETURN_CODE=0 + +case ${JOB_TYPE} in + test) + retry_with_backoff 3 10 \ + mvn -B -ntp \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dcheckstyle.skip=true \ + -Dmaven.wagon.http.retryHandler.count=5 \ + test + RETURN_CODE=$? + ;; + clirr) + mvn -B -ntp clirr:check + RETURN_CODE=$? + ;; + *) ;; +esac -./gradlew assemble -./gradlew build install +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh index 5cf7ba49e..7b153733d 100755 --- a/.kokoro/coerce_logs.sh +++ b/.kokoro/coerce_logs.sh @@ -23,7 +23,11 @@ scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) ## cd to the parent directory, i.e. the root of the git repo cd ${scriptDir}/.. -job=$(basename ${KOKORO_JOB_NAME}) +if [ -z "${KOKORO_JOB_NAME}" ]; then + job="${JOB_NAME}" +else + job=$(basename ${KOKORO_JOB_NAME}) +fi echo "coercing sponge logs..." for xml in `find . -name *-sponge_log.xml` diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg deleted file mode 100644 index c690aeb8a..000000000 --- a/.kokoro/continuous/common.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "api-common-java/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/api-common-java/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} diff --git a/.kokoro/continuous/java11.cfg b/.kokoro/continuous/java11.cfg deleted file mode 100644 index 709f2b4c7..000000000 --- a/.kokoro/continuous/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} diff --git a/.kokoro/continuous/java7.cfg b/.kokoro/continuous/java7.cfg deleted file mode 100644 index cb24f44ee..000000000 --- a/.kokoro/continuous/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg deleted file mode 100644 index 495cc7bac..000000000 --- a/.kokoro/continuous/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh deleted file mode 100755 index 59d2aafc7..000000000 --- a/.kokoro/dependencies.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -# Copyright 2019 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. - -set -eo pipefail - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Java -java -version -echo $JOB_TYPE - -export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" - -# this should run maven enforcer -retry_with_backoff 3 10 \ - mvn install -B -V -ntp \ - -DskipTests=true \ - -Dmaven.javadoc.skip=true \ - -Dclirr.skip=true - -mvn -B dependency:analyze -DfailOnWarning=true - -echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" -## Run dependency list completeness check -function completenessCheck() { - # Output dep list with compile scope generated using the original pom - # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. - # This is stripped from the output as it is not present in the flattened pom. - # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. - msg "Generating dependency list using original pom..." - mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt - - # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) - msg "Generating dependency list using flattened pom..." - mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt - - # Compare two dependency lists - msg "Comparing dependency lists..." - diff .org-list.txt .new-list.txt >.diff.txt - if [[ $? == 0 ]] - then - msg "Success. No diff!" - else - msg "Diff found. See below: " - msg "You can also check .diff.txt file located in $1." - cat .diff.txt - return 1 - fi -} - -# Allow failures to continue running the script -set +e - -error_count=0 -for path in $(find -name ".flattened-pom.xml") -do - # Check flattened pom in each dir that contains it for completeness - dir=$(dirname "$path") - pushd "$dir" - completenessCheck "$dir" - error_count=$(($error_count + $?)) - popd -done - -if [[ $error_count == 0 ]] -then - msg "All checks passed." - exit 0 -else - msg "Errors found. See log statements above." - exit 1 -fi diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg deleted file mode 100644 index c690aeb8a..000000000 --- a/.kokoro/nightly/common.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "api-common-java/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/api-common-java/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg deleted file mode 100644 index 0048c8ece..000000000 --- a/.kokoro/nightly/integration.cfg +++ /dev/null @@ -1,37 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "integration" -} -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "ENABLE_BUILD_COP" - value: "true" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg deleted file mode 100644 index 709f2b4c7..000000000 --- a/.kokoro/nightly/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} diff --git a/.kokoro/nightly/java7.cfg b/.kokoro/nightly/java7.cfg deleted file mode 100644 index cb24f44ee..000000000 --- a/.kokoro/nightly/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/.kokoro/nightly/java8-osx.cfg b/.kokoro/nightly/java8-osx.cfg deleted file mode 100644 index affd3b901..000000000 --- a/.kokoro/nightly/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "api-common-java/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg deleted file mode 100644 index 590450c23..000000000 --- a/.kokoro/nightly/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "api-common-java/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg deleted file mode 100644 index 495cc7bac..000000000 --- a/.kokoro/nightly/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg deleted file mode 100644 index f25429314..000000000 --- a/.kokoro/nightly/samples.cfg +++ /dev/null @@ -1,38 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-docs-samples-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-docs-samples-service-account" -} - -env_vars: { - key: "ENABLE_BUILD_COP" - value: "true" -} diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg deleted file mode 100644 index ec572442e..000000000 --- a/.kokoro/presubmit/clirr.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "clirr" -} \ No newline at end of file diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg deleted file mode 100644 index 3958711ba..000000000 --- a/.kokoro/presubmit/common.cfg +++ /dev/null @@ -1,26 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "api-common-java/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/api-common-java/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} - diff --git a/.kokoro/presubmit/dependencies.cfg b/.kokoro/presubmit/dependencies.cfg deleted file mode 100644 index 701ec13bd..000000000 --- a/.kokoro/presubmit/dependencies.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/api-common-java/.kokoro/dependencies.sh" -} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg deleted file mode 100644 index dded67a9d..000000000 --- a/.kokoro/presubmit/integration.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "integration" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg deleted file mode 100644 index 709f2b4c7..000000000 --- a/.kokoro/presubmit/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg deleted file mode 100644 index cb24f44ee..000000000 --- a/.kokoro/presubmit/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg deleted file mode 100644 index affd3b901..000000000 --- a/.kokoro/presubmit/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "api-common-java/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg deleted file mode 100644 index 590450c23..000000000 --- a/.kokoro/presubmit/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "api-common-java/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg deleted file mode 100644 index 495cc7bac..000000000 --- a/.kokoro/presubmit/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg deleted file mode 100644 index edd98254e..000000000 --- a/.kokoro/presubmit/linkage-monitor.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/api-common-java/.kokoro/linkage-monitor.sh" -} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg deleted file mode 100644 index 6d323c8ae..000000000 --- a/.kokoro/presubmit/lint.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "lint" -} \ No newline at end of file diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg deleted file mode 100644 index 01e096004..000000000 --- a/.kokoro/presubmit/samples.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-docs-samples-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-docs-samples-service-account" -} \ No newline at end of file diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg deleted file mode 100644 index 4d600c86c..000000000 --- a/.kokoro/release/bump_snapshot.cfg +++ /dev/null @@ -1,53 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "api-common-java/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/api-common-java/.kokoro/release/bump_snapshot.sh" -} - -# tokens used by release-please to keep an up-to-date release PR. -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-key-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-token-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-url-release-please" - } - } -} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh index 92716fa0b..e96a6f968 100755 --- a/.kokoro/release/common.sh +++ b/.kokoro/release/common.sh @@ -28,12 +28,25 @@ setup_environment_secrets() { export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') } -create_gradle_properties_file() { +create_settings_xml_file() { echo " -signing.gnupg.executable=gpg -signing.gnupg.homeDir=${GPG_HOMEDIR} -signing.gnupg.keyName=${GPG_KEY_ID} -signing.gnupg.passphrase=${GPG_PASSPHRASE} -ossrhUsername=${SONATYPE_USERNAME} -ossrhPassword=${SONATYPE_PASSWORD}" > $1 + + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 } diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg deleted file mode 100644 index 456a07816..000000000 --- a/.kokoro/release/drop.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/api-common-java/.kokoro/release/drop.sh" -} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh deleted file mode 100755 index ce6ae7543..000000000 --- a/.kokoro/release/drop.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google Inc. -# -# 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. - -set -eo pipefail - -echo "This dropping a staged repo does not appear supported by the gradle-nexus-staging-plugin" -exit 1 diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg deleted file mode 100644 index 418890c65..000000000 --- a/.kokoro/release/promote.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/api-common-java/.kokoro/release/promote.sh" -} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh deleted file mode 100755 index 2dcfd256d..000000000 --- a/.kokoro/release/promote.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google Inc. -# -# 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. - -set -eo pipefail - -# STAGING_REPOSITORY_ID must be set -#if [ -z "${STAGING_REPOSITORY_ID}" ]; then -# echo "Missing STAGING_REPOSITORY_ID environment variable" -# exit 1 -#fi - -source $(dirname "$0")/common.sh -pushd $(dirname "$0")/../../ - -setup_environment_secrets -mkdir -p ${HOME}/.gradle -create_gradle_properties_file "${HOME}/.gradle/gradle.properties" - -./gradlew closeAndReleaseRepository diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg deleted file mode 100644 index d635fca80..000000000 --- a/.kokoro/release/publish_javadoc.cfg +++ /dev/null @@ -1,23 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" - -env_vars: { - key: "STAGING_BUCKET" - value: "docs-staging" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/api-common-java/.kokoro/release/publish_javadoc.sh" -} - - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh deleted file mode 100755 index 09e830704..000000000 --- a/.kokoro/release/publish_javadoc.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google Inc. -# -# 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. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET}" ]]; then - echo "Need to set STAGING_BUCKET environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install gcp-docuploader - -NAME=api-common -VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# build the docs -./gradlew javadocCombined - -pushd tmp_docs - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --language java - -# upload docs -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET} - -popd diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh index 1e8bb68a9..73b61d254 100755 --- a/.kokoro/release/publish_javadoc11.sh +++ b/.kokoro/release/publish_javadoc11.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2019 Google Inc. +# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,21 +28,28 @@ fi pushd $(dirname "$0")/../../ # install docuploader package -python3 -m pip install gcp-docuploader +python3 -m pip install --require-hashes -r .kokoro/requirements.txt NAME=api-common VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) # build the docs -./gradlew javadocCombinedV3 +mvn -B -ntp \ + -P docFX \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dcheckstyle.skip=true \ + -Dflatten.skip=true \ + -Danimal.sniffer.skip=true \ + javadoc:aggregate -# copy README to tmp_docs dir and rename index.md -cp README.md tmp_docs/docfx-yml/index.md +# copy README to docfx-yml dir and rename index.md +cp README.md target/docfx-yml/index.md # copy CHANGELOG to docfx-yml dir and rename history.md -cp CHANGELOG.md tmp_docs/docfx-yml/history.md +cp CHANGELOG.md target/docfx-yml/history.md -pushd tmp_docs/docfx-yml/ +pushd target/docfx-yml/ # create metadata python3 -m docuploader create-metadata \ @@ -56,4 +63,4 @@ python3 -m docuploader upload . \ --staging-bucket ${STAGING_BUCKET_V2} \ --destination-prefix docfx -popd +popd \ No newline at end of file diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg deleted file mode 100644 index a1fb5ce3c..000000000 --- a/.kokoro/release/snapshot.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/api-common-java/.kokoro/release/snapshot.sh" -} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh deleted file mode 100755 index 53a904a1c..000000000 --- a/.kokoro/release/snapshot.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# Copyright 2019 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. - -set -eo pipefail - -source $(dirname "$0")/common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -# ensure we're trying to push a snapshot (no-result returns non-zero exit code) -grep SNAPSHOT versions.txt - -setup_environment_secrets -mkdir -p ${HOME}/.gradle -create_gradle_properties_file "${HOME}/.gradle/gradle.properties" - -./gradlew assemble publish diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh index ab598b823..ba1cf7e20 100755 --- a/.kokoro/release/stage.sh +++ b/.kokoro/release/stage.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2019 Google Inc. +# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +27,24 @@ MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml pushd $(dirname "$0")/../../ setup_environment_secrets -mkdir -p ${HOME}/.gradle -create_gradle_properties_file "${HOME}/.gradle/gradle.properties" +create_settings_xml_file "settings.xml" -./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository +mvn clean deploy -B \ + -DskipTests=true \ + -Dclirr.skip=true \ + --settings ${MAVEN_SETTINGS_FILE} \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} \ + -P release + +# The job triggered by Release Please (release-trigger) has this AUTORELEASE_PR +# environment variable. Fusion also lets us to specify this variable. +if [[ -n "${AUTORELEASE_PR}" ]] +then + mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=${MAVEN_SETTINGS_FILE} +else + echo "AUTORELEASE_PR is not set. Not releasing." +fi \ No newline at end of file diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in new file mode 100644 index 000000000..924f94ae6 --- /dev/null +++ b/.kokoro/requirements.in @@ -0,0 +1,34 @@ +gcp-docuploader==0.6.3 +google-crc32c==1.3.0 +googleapis-common-protos==1.56.3 +gcp-releasetool==1.9.1 +cryptography==38.0.3 +cachetools==4.2.4 +cffi==1.15.1 +jeepney==0.7.1 +jinja2==3.0.3 +markupsafe==2.0.1 +keyring==23.4.1 +packaging==21.3 +protobuf==3.19.5 +pyjwt==2.4.0 +pyparsing==3.0.9 +pycparser==2.21 +pyperclip==1.8.2 +python-dateutil==2.8.2 +requests==2.27.1 +certifi==2022.9.24 +importlib-metadata==4.8.3 +zipp==3.6.0 +google_api_core==2.8.2 +google-cloud-storage==2.0.0 +google-resumable-media==2.3.3 +google-cloud-core==2.3.1 +typing-extensions==4.1.1 +urllib3==1.26.12 +zipp==3.6.0 +rsa==4.9 +six==1.16.0 +attrs==22.1.0 +google-auth==2.14.1 +idna==3.4 \ No newline at end of file diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt new file mode 100644 index 000000000..1271b9224 --- /dev/null +++ b/.kokoro/requirements.txt @@ -0,0 +1,455 @@ +# +# This file is autogenerated by pip-compile with python 3.10 +# To update, run: +# +# pip-compile --generate-hashes requirements.in +# +attrs==22.1.0 \ + --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ + --hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c + # via + # -r requirements.in + # gcp-releasetool +cachetools==4.2.4 \ + --hash=sha256:89ea6f1b638d5a73a4f9226be57ac5e4f399d22770b92355f92dcb0f7f001693 \ + --hash=sha256:92971d3cb7d2a97efff7c7bb1657f21a8f5fb309a37530537c71b1774189f2d1 + # via + # -r requirements.in + # google-auth +certifi==2022.9.24 \ + --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 \ + --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 + # via + # -r requirements.in + # requests +cffi==1.15.1 \ + --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ + --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ + --hash=sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104 \ + --hash=sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426 \ + --hash=sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405 \ + --hash=sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375 \ + --hash=sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a \ + --hash=sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e \ + --hash=sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc \ + --hash=sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf \ + --hash=sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185 \ + --hash=sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497 \ + --hash=sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3 \ + --hash=sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35 \ + --hash=sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c \ + --hash=sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83 \ + --hash=sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21 \ + --hash=sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca \ + --hash=sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984 \ + --hash=sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac \ + --hash=sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd \ + --hash=sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee \ + --hash=sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a \ + --hash=sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2 \ + --hash=sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192 \ + --hash=sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7 \ + --hash=sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585 \ + --hash=sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f \ + --hash=sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e \ + --hash=sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27 \ + --hash=sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b \ + --hash=sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e \ + --hash=sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e \ + --hash=sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d \ + --hash=sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c \ + --hash=sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415 \ + --hash=sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82 \ + --hash=sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02 \ + --hash=sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314 \ + --hash=sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325 \ + --hash=sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c \ + --hash=sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3 \ + --hash=sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914 \ + --hash=sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045 \ + --hash=sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d \ + --hash=sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9 \ + --hash=sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5 \ + --hash=sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2 \ + --hash=sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c \ + --hash=sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3 \ + --hash=sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2 \ + --hash=sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8 \ + --hash=sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d \ + --hash=sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d \ + --hash=sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9 \ + --hash=sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162 \ + --hash=sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76 \ + --hash=sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4 \ + --hash=sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e \ + --hash=sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9 \ + --hash=sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6 \ + --hash=sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b \ + --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ + --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 + # via + # -r requirements.in + # cryptography +charset-normalizer==2.0.12 \ + --hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \ + --hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df + # via requests +click==8.0.4 \ + --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ + --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb + # via + # gcp-docuploader + # gcp-releasetool +colorlog==6.7.0 \ + --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ + --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 + # via gcp-docuploader +cryptography==38.0.3 \ + --hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \ + --hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \ + --hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \ + --hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \ + --hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \ + --hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \ + --hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \ + --hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \ + --hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \ + --hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \ + --hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \ + --hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \ + --hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \ + --hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \ + --hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \ + --hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \ + --hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \ + --hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \ + --hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \ + --hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \ + --hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \ + --hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \ + --hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \ + --hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \ + --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ + --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 + # via + # -r requirements.in + # gcp-releasetool + # secretstorage +gcp-docuploader==0.6.3 \ + --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ + --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b + # via -r requirements.in +gcp-releasetool==1.9.1 \ + --hash=sha256:952f4055d5d986b070ae2a71c4410b250000f9cc5a1e26398fcd55a5bbc5a15f \ + --hash=sha256:d0d3c814a97c1a237517e837d8cfa668ced8df4b882452578ecef4a4e79c583b + # via -r requirements.in +google-api-core==2.8.2 \ + --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ + --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 + # via + # -r requirements.in + # google-cloud-core + # google-cloud-storage +google-auth==2.14.1 \ + --hash=sha256:f5d8701633bebc12e0deea4df8abd8aff31c28b355360597f7f2ee60f2e4d016 + # via + # -r requirements.in + # gcp-releasetool + # google-api-core + # google-cloud-core + # google-cloud-storage +google-cloud-core==2.3.1 \ + --hash=sha256:113ba4f492467d5bd442c8d724c1a25ad7384045c3178369038840ecdd19346c \ + --hash=sha256:34334359cb04187bdc80ddcf613e462dfd7a3aabbc3fe4d118517ab4b9303d53 + # via + # -r requirements.in + # google-cloud-storage +google-cloud-storage==2.0.0 \ + --hash=sha256:a57a15aead0f9dfbd4381f1bfdbe8bf89818a4bd75bab846cafcefb2db846c47 \ + --hash=sha256:ec4be60bb223a3a960f0d01697d849b86d91cad815a84915a32ed3635e93a5e7 + # via + # -r requirements.in + # gcp-docuploader +google-crc32c==1.3.0 \ + --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ + --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ + --hash=sha256:12674a4c3b56b706153a358eaa1018c4137a5a04635b92b4652440d3d7386206 \ + --hash=sha256:127f9cc3ac41b6a859bd9dc4321097b1a4f6aa7fdf71b4f9227b9e3ebffb4422 \ + --hash=sha256:13af315c3a0eec8bb8b8d80b8b128cb3fcd17d7e4edafc39647846345a3f003a \ + --hash=sha256:1926fd8de0acb9d15ee757175ce7242e235482a783cd4ec711cc999fc103c24e \ + --hash=sha256:226f2f9b8e128a6ca6a9af9b9e8384f7b53a801907425c9a292553a3a7218ce0 \ + --hash=sha256:276de6273eb074a35bc598f8efbc00c7869c5cf2e29c90748fccc8c898c244df \ + --hash=sha256:318f73f5484b5671f0c7f5f63741ab020a599504ed81d209b5c7129ee4667407 \ + --hash=sha256:3bbce1be3687bbfebe29abdb7631b83e6b25da3f4e1856a1611eb21854b689ea \ + --hash=sha256:42ae4781333e331a1743445931b08ebdad73e188fd554259e772556fc4937c48 \ + --hash=sha256:58be56ae0529c664cc04a9c76e68bb92b091e0194d6e3c50bea7e0f266f73713 \ + --hash=sha256:5da2c81575cc3ccf05d9830f9e8d3c70954819ca9a63828210498c0774fda1a3 \ + --hash=sha256:6311853aa2bba4064d0c28ca54e7b50c4d48e3de04f6770f6c60ebda1e975267 \ + --hash=sha256:650e2917660e696041ab3dcd7abac160b4121cd9a484c08406f24c5964099829 \ + --hash=sha256:6a4db36f9721fdf391646685ecffa404eb986cbe007a3289499020daf72e88a2 \ + --hash=sha256:779cbf1ce375b96111db98fca913c1f5ec11b1d870e529b1dc7354b2681a8c3a \ + --hash=sha256:7f6fe42536d9dcd3e2ffb9d3053f5d05221ae3bbcefbe472bdf2c71c793e3183 \ + --hash=sha256:891f712ce54e0d631370e1f4997b3f182f3368179198efc30d477c75d1f44942 \ + --hash=sha256:95c68a4b9b7828ba0428f8f7e3109c5d476ca44996ed9a5f8aac6269296e2d59 \ + --hash=sha256:96a8918a78d5d64e07c8ea4ed2bc44354e3f93f46a4866a40e8db934e4c0d74b \ + --hash=sha256:9c3cf890c3c0ecfe1510a452a165431b5831e24160c5fcf2071f0f85ca5a47cd \ + --hash=sha256:9f58099ad7affc0754ae42e6d87443299f15d739b0ce03c76f515153a5cda06c \ + --hash=sha256:a0b9e622c3b2b8d0ce32f77eba617ab0d6768b82836391e4f8f9e2074582bf02 \ + --hash=sha256:a7f9cbea4245ee36190f85fe1814e2d7b1e5f2186381b082f5d59f99b7f11328 \ + --hash=sha256:bab4aebd525218bab4ee615786c4581952eadc16b1ff031813a2fd51f0cc7b08 \ + --hash=sha256:c124b8c8779bf2d35d9b721e52d4adb41c9bfbde45e6a3f25f0820caa9aba73f \ + --hash=sha256:c9da0a39b53d2fab3e5467329ed50e951eb91386e9d0d5b12daf593973c3b168 \ + --hash=sha256:ca60076c388728d3b6ac3846842474f4250c91efbfe5afa872d3ffd69dd4b318 \ + --hash=sha256:cb6994fff247987c66a8a4e550ef374671c2b82e3c0d2115e689d21e511a652d \ + --hash=sha256:d1c1d6236feab51200272d79b3d3e0f12cf2cbb12b208c835b175a21efdb0a73 \ + --hash=sha256:dd7760a88a8d3d705ff562aa93f8445ead54f58fd482e4f9e2bafb7e177375d4 \ + --hash=sha256:dda4d8a3bb0b50f540f6ff4b6033f3a74e8bf0bd5320b70fab2c03e512a62812 \ + --hash=sha256:e0f1ff55dde0ebcfbef027edc21f71c205845585fffe30d4ec4979416613e9b3 \ + --hash=sha256:e7a539b9be7b9c00f11ef16b55486141bc2cdb0c54762f84e3c6fc091917436d \ + --hash=sha256:eb0b14523758e37802f27b7f8cd973f5f3d33be7613952c0df904b68c4842f0e \ + --hash=sha256:ed447680ff21c14aaceb6a9f99a5f639f583ccfe4ce1a5e1d48eb41c3d6b3217 \ + --hash=sha256:f52a4ad2568314ee713715b1e2d79ab55fab11e8b304fd1462ff5cccf4264b3e \ + --hash=sha256:fbd60c6aaa07c31d7754edbc2334aef50601b7f1ada67a96eb1eb57c7c72378f \ + --hash=sha256:fc28e0db232c62ca0c3600884933178f0825c99be4474cdd645e378a10588125 \ + --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ + --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ + --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 + # via + # -r requirements.in + # google-resumable-media +google-resumable-media==2.3.3 \ + --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ + --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 + # via + # -r requirements.in + # google-cloud-storage +googleapis-common-protos==1.56.3 \ + --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ + --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 + # via + # -r requirements.in + # google-api-core +idna==3.4 \ + --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ + --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 + # via + # -r requirements.in + # requests +importlib-metadata==4.8.3 \ + --hash=sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e \ + --hash=sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668 + # via + # -r requirements.in + # keyring +jeepney==0.7.1 \ + --hash=sha256:1b5a0ea5c0e7b166b2f5895b91a08c14de8915afda4407fb5022a195224958ac \ + --hash=sha256:fa9e232dfa0c498bd0b8a3a73b8d8a31978304dcef0515adc859d4e096f96f4f + # via + # -r requirements.in + # keyring + # secretstorage +jinja2==3.0.3 \ + --hash=sha256:077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8 \ + --hash=sha256:611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7 + # via + # -r requirements.in + # gcp-releasetool +keyring==23.4.1 \ + --hash=sha256:17e49fb0d6883c2b4445359434dba95aad84aabb29bbff044ad0ed7100232eca \ + --hash=sha256:89cbd74d4683ed164c8082fb38619341097741323b3786905c6dac04d6915a55 + # via + # -r requirements.in + # gcp-releasetool +markupsafe==2.0.1 \ + --hash=sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298 \ + --hash=sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64 \ + --hash=sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b \ + --hash=sha256:04635854b943835a6ea959e948d19dcd311762c5c0c6e1f0e16ee57022669194 \ + --hash=sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567 \ + --hash=sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff \ + --hash=sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724 \ + --hash=sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74 \ + --hash=sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646 \ + --hash=sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35 \ + --hash=sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6 \ + --hash=sha256:20dca64a3ef2d6e4d5d615a3fd418ad3bde77a47ec8a23d984a12b5b4c74491a \ + --hash=sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6 \ + --hash=sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad \ + --hash=sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26 \ + --hash=sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38 \ + --hash=sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac \ + --hash=sha256:3c112550557578c26af18a1ccc9e090bfe03832ae994343cfdacd287db6a6ae7 \ + --hash=sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6 \ + --hash=sha256:4296f2b1ce8c86a6aea78613c34bb1a672ea0e3de9c6ba08a960efe0b0a09047 \ + --hash=sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75 \ + --hash=sha256:49e3ceeabbfb9d66c3aef5af3a60cc43b85c33df25ce03d0031a608b0a8b2e3f \ + --hash=sha256:4dc8f9fb58f7364b63fd9f85013b780ef83c11857ae79f2feda41e270468dd9b \ + --hash=sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135 \ + --hash=sha256:53edb4da6925ad13c07b6d26c2a852bd81e364f95301c66e930ab2aef5b5ddd8 \ + --hash=sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a \ + --hash=sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a \ + --hash=sha256:5b6d930f030f8ed98e3e6c98ffa0652bdb82601e7a016ec2ab5d7ff23baa78d1 \ + --hash=sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9 \ + --hash=sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864 \ + --hash=sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914 \ + --hash=sha256:6300b8454aa6930a24b9618fbb54b5a68135092bc666f7b06901f897fa5c2fee \ + --hash=sha256:63f3268ba69ace99cab4e3e3b5840b03340efed0948ab8f78d2fd87ee5442a4f \ + --hash=sha256:6557b31b5e2c9ddf0de32a691f2312a32f77cd7681d8af66c2692efdbef84c18 \ + --hash=sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8 \ + --hash=sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2 \ + --hash=sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d \ + --hash=sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b \ + --hash=sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b \ + --hash=sha256:89c687013cb1cd489a0f0ac24febe8c7a666e6e221b783e53ac50ebf68e45d86 \ + --hash=sha256:8d206346619592c6200148b01a2142798c989edcb9c896f9ac9722a99d4e77e6 \ + --hash=sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f \ + --hash=sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb \ + --hash=sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833 \ + --hash=sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28 \ + --hash=sha256:9f02365d4e99430a12647f09b6cc8bab61a6564363f313126f775eb4f6ef798e \ + --hash=sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415 \ + --hash=sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902 \ + --hash=sha256:aca6377c0cb8a8253e493c6b451565ac77e98c2951c45f913e0b52facdcff83f \ + --hash=sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d \ + --hash=sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9 \ + --hash=sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d \ + --hash=sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145 \ + --hash=sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066 \ + --hash=sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c \ + --hash=sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1 \ + --hash=sha256:cdfba22ea2f0029c9261a4bd07e830a8da012291fbe44dc794e488b6c9bb353a \ + --hash=sha256:d6c7ebd4e944c85e2c3421e612a7057a2f48d478d79e61800d81468a8d842207 \ + --hash=sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f \ + --hash=sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53 \ + --hash=sha256:deb993cacb280823246a026e3b2d81c493c53de6acfd5e6bfe31ab3402bb37dd \ + --hash=sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134 \ + --hash=sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85 \ + --hash=sha256:f0567c4dc99f264f49fe27da5f735f414c4e7e7dd850cfd8e69f0862d7c74ea9 \ + --hash=sha256:f5653a225f31e113b152e56f154ccbe59eeb1c7487b39b9d9f9cdb58e6c79dc5 \ + --hash=sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94 \ + --hash=sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509 \ + --hash=sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51 \ + --hash=sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872 + # via + # -r requirements.in + # jinja2 +packaging==21.3 \ + --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ + --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 + # via + # -r requirements.in + # gcp-releasetool +protobuf==3.19.5 \ + --hash=sha256:1867f93b06a183f87696871bb8d1e99ee71dbb69d468ce1f0cc8bf3d30f982f3 \ + --hash=sha256:3c4160b601220627f7e91154e572baf5e161a9c3f445a8242d536ee3d0b7b17c \ + --hash=sha256:4ee2af7051d3b10c8a4fe6fd1a2c69f201fea36aeee7086cf202a692e1b99ee1 \ + --hash=sha256:5266c36cc0af3bb3dbf44f199d225b33da66a9a5c3bdc2b14865ad10eddf0e37 \ + --hash=sha256:5470f892961af464ae6eaf0f3099e2c1190ae8c7f36f174b89491281341f79ca \ + --hash=sha256:66d14b5b90090353efe75c9fb1bf65ef7267383034688d255b500822e37d5c2f \ + --hash=sha256:67efb5d20618020aa9596e17bfc37ca068c28ec0c1507d9507f73c93d46c9855 \ + --hash=sha256:696e6cfab94cc15a14946f2bf72719dced087d437adbd994fff34f38986628bc \ + --hash=sha256:6a02172b9650f819d01fb8e224fc69b0706458fc1ab4f1c669281243c71c1a5e \ + --hash=sha256:950abd6c00e7b51f87ae8b18a0ce4d69fea217f62f171426e77de5061f6d9850 \ + --hash=sha256:9e1d74032f56ff25f417cfe84c8147047732e5059137ca42efad20cbbd25f5e0 \ + --hash=sha256:9e42b1cf2ecd8a1bd161239e693f22035ba99905ae6d7efeac8a0546c7ec1a27 \ + --hash=sha256:9f957ef53e872d58a0afd3bf6d80d48535d28c99b40e75e6634cbc33ea42fd54 \ + --hash=sha256:a89aa0c042e61e11ade320b802d6db4ee5391d8d973e46d3a48172c1597789f8 \ + --hash=sha256:c0f80876a8ff0ae7064084ed094eb86497bd5a3812e6fc96a05318b92301674e \ + --hash=sha256:c44e3282cff74ad18c7e8a0375f407f69ee50c2116364b44492a196293e08b21 \ + --hash=sha256:d249519ba5ecf5dd6b18150c9b6bcde510b273714b696f3923ff8308fc11ae49 \ + --hash=sha256:d3973a2d58aefc7d1230725c2447ce7f86a71cbc094b86a77c6ee1505ac7cdb1 \ + --hash=sha256:dca2284378a5f2a86ffed35c6ac147d14c48b525eefcd1083e5a9ce28dfa8657 \ + --hash=sha256:e63b0b3c42e51c94add62b010366cd4979cb6d5f06158bcae8faac4c294f91e1 \ + --hash=sha256:f2b599a21c9a32e171ec29a2ac54e03297736c578698e11b099d031f79da114b \ + --hash=sha256:f2bde37667b18c2b5280df83bc799204394a5d2d774e4deaf9de0eb741df6833 \ + --hash=sha256:f4f909f4dde413dec435a44b0894956d55bb928ded7d6e3c726556ca4c796e84 \ + --hash=sha256:f976234e20ab2785f54224bcdafa027674e23663b132fa3ca0caa291a6cfbde7 \ + --hash=sha256:f9cebda093c2f6bfed88f1c17cdade09d4d96096421b344026feee236532d4de + # via + # -r requirements.in + # gcp-docuploader + # gcp-releasetool + # google-api-core + # google-cloud-storage + # googleapis-common-protos +pyasn1==0.4.8 \ + --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ + --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba + # via + # pyasn1-modules + # rsa +pyasn1-modules==0.2.8 \ + --hash=sha256:905f84c712230b2c592c19470d3ca8d552de726050d1d1716282a1f6146be65e \ + --hash=sha256:a50b808ffeb97cb3601dd25981f6b016cbb3d31fbf57a8b8a87428e6158d0c74 + # via google-auth +pycparser==2.21 \ + --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ + --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 + # via + # -r requirements.in + # cffi +pyjwt==2.4.0 \ + --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ + --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba + # via + # -r requirements.in + # gcp-releasetool +pyparsing==3.0.9 \ + --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ + --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc + # via + # -r requirements.in + # packaging +pyperclip==1.8.2 \ + --hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57 + # via + # -r requirements.in + # gcp-releasetool +python-dateutil==2.8.2 \ + --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ + --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 + # via + # -r requirements.in + # gcp-releasetool +requests==2.27.1 \ + --hash=sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61 \ + --hash=sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d + # via + # -r requirements.in + # gcp-releasetool + # google-api-core + # google-cloud-storage +rsa==4.9 \ + --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ + --hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 + # via + # -r requirements.in + # google-auth +secretstorage==3.3.3 \ + --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ + --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 + # via keyring +six==1.16.0 \ + --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ + --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 + # via + # -r requirements.in + # gcp-docuploader + # google-auth + # python-dateutil +typing-extensions==4.1.1 \ + --hash=sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42 \ + --hash=sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2 + # via -r requirements.in +urllib3==1.26.12 \ + --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ + --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 + # via + # -r requirements.in + # requests +zipp==3.6.0 \ + --hash=sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832 \ + --hash=sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc + # via + # -r requirements.in + # importlib-metadata \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fe7e350e..01cbea78b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [2.3.0](https://github.com/googleapis/api-common-java/compare/v2.2.2...v2.3.0) (2022-12-05) + + +### Features + +* Next release from main branch is 2.3.0 ([#371](https://github.com/googleapis/api-common-java/issues/371)) ([9f6f62d](https://github.com/googleapis/api-common-java/commit/9f6f62d1a32ee0b9c02065fe3752c2cd9d711038)) + + +### Dependencies + +* Update auto-value.version to v1.10.1 ([#378](https://github.com/googleapis/api-common-java/issues/378)) ([d44ba0b](https://github.com/googleapis/api-common-java/commit/d44ba0b7b15ef910ad7caba607d0d84edac2611b)) +* Update dependency com.google.auto.value:auto-value to v1.10.1 ([#380](https://github.com/googleapis/api-common-java/issues/380)) ([96eb7d6](https://github.com/googleapis/api-common-java/commit/96eb7d67c06fcd2e43dc6a2d332e9ad8e5fec7eb)) +* Update dependency com.google.auto.value:auto-value-annotations to v1.10.1 ([#381](https://github.com/googleapis/api-common-java/issues/381)) ([fb33ae8](https://github.com/googleapis/api-common-java/commit/fb33ae8ab0810dde5e33400309b4e632e04f4e0b)) +* Update dependency com.google.errorprone:error_prone_annotations to v2.16 ([#382](https://github.com/googleapis/api-common-java/issues/382)) ([da19378](https://github.com/googleapis/api-common-java/commit/da1937834bcfa9edfe2fa642211478fed54e5e61)) +* Update dependency gradle to v6.9.3 ([#379](https://github.com/googleapis/api-common-java/issues/379)) ([3cbb296](https://github.com/googleapis/api-common-java/commit/3cbb296485c5f6a5483aa15573c563e97436e13a)) + ## [2.2.2](https://github.com/googleapis/api-common-java/compare/v2.2.1...v2.2.2) (2022-08-04) diff --git a/build.gradle b/build.gradle index bed03198f..320b6d77f 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'io.github.gradle-nexus.publish-plugin' group = "com.google.api" archivesBaseName = "api-common" -project.version = "2.2.2" // {x-version-update:api-common:current} +project.version = "2.3.0" // {x-version-update:api-common:current} sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -42,11 +42,11 @@ ext { // Shortcuts for libraries we are using libraries = [ javax_annotations: 'javax.annotation:javax.annotation-api:1.3.2', - auto_value: 'com.google.auto.value:auto-value:1.9', + auto_value: 'com.google.auto.value:auto-value:1.10.1', auto_value_annotations: 'com.google.auto.value:auto-value-annotations:1.9', guava: 'com.google.guava:guava:31.1-jre', jsr305: 'com.google.code.findbugs:jsr305:3.0.2', - error_prone_annotations: 'com.google.errorprone:error_prone_annotations:2.15.0', + error_prone_annotations: 'com.google.errorprone:error_prone_annotations:2.16', // Testing junit: 'junit:junit:4.13.2', diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ec991f9aa..d355f4c4f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/java.header b/java.header index 3a9b503aa..7e518c100 100644 --- a/java.header +++ b/java.header @@ -1,15 +1,29 @@ ^/\*$ -^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \* Copyright 20\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ ^ \*$ -^ \* 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$ +^ \* Redistribution and use in source and binary forms, with or without$ +^ \* modification, are permitted provided that the following conditions are$ +^ \* met:$ ^ \*$ -^ \*[ ]+https?://www.apache.org/licenses/LICENSE-2\.0$ +^ \* \* Redistributions of source code must retain the above copyright$ +^ \* notice, this list of conditions and the following disclaimer.$ +^ \* \* Redistributions in binary form must reproduce the above$ +^ \* copyright notice, this list of conditions and the following disclaimer$ +^ \* in the documentation and/or other materials provided with the$ +^ \* distribution.$ +^ \* \* Neither the name of Google (Inc\.|LLC) nor the names of its$ +^ \* contributors may be used to endorse or promote products derived from$ +^ \* this software without specific prior written permission.$ ^ \*$ -^ \* 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\.$ -^ \*/$ +^ \* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS$ +^ \* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT$ +^ \* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR$ +^ \* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT$ +^ \* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,$ +^ \* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES \(INCLUDING, BUT NOT$ +^ \* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,$ +^ \* DATA, OR PROFITS; OR BUSINESS INTERRUPTION\) HOWEVER CAUSED AND ON ANY$ +^ \* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT$ +^ \* \(INCLUDING NEGLIGENCE OR OTHERWISE\) ARISING IN ANY WAY OUT OF THE USE$ +^ \* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.$ +^ \*/$ \ No newline at end of file diff --git a/license-checks.xml b/license-checks.xml index 6597fced8..a800d524d 100644 --- a/license-checks.xml +++ b/license-checks.xml @@ -5,6 +5,6 @@ - + diff --git a/pom.xml b/pom.xml new file mode 100644 index 000000000..162b0c134 --- /dev/null +++ b/pom.xml @@ -0,0 +1,140 @@ + + + 4.0.0 + com.google.api + api-common + jar + 2.3.0 + API Common + https://github.com/googleapis/api-common-java + Common utilities for Google APIs in Java + + + com.google.cloud + google-cloud-shared-config + 1.5.4 + + + + + GoogleAPIs + GoogleAPIs + googleapis@googlegroups.com + Google LLC + https://www.google.com + + + + + scm:git:https://github.com/googleapis/api-common-java.git + https://github.com/googleapis/api-common-java + + + + + BSD + https://github.com/googleapis/api-common-java/blob/main/LICENSE + + + + + UTF-8 + 1.8 + 1.8 + 1.10.1 + + + + + com.google.guava + guava + 31.1-jre + + + com.google.auto.value + auto-value-annotations + ${auto-value.version} + + + com.google.auto.value + auto-value + ${auto-value.version} + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + javax.annotation + javax.annotation-api + 1.3.2 + + + com.google.errorprone + error_prone_annotations + 2.16 + compile + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + maven-compiler-plugin + + + + com.google.auto.value + auto-value + ${auto-value.version} + + + 8 + + -Xlint:unchecked + -Xlint:deprecation + + + + + com.coveo + fmt-maven-plugin + + + + check + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + false + + com.google.api.apicommon + + + + + + + \ No newline at end of file diff --git a/renovate.json b/renovate.json index e820d7bbd..0e82ced57 100644 --- a/renovate.json +++ b/renovate.json @@ -10,6 +10,7 @@ ":maintainLockFilesDisabled", ":autodetectPinVersions" ], + "ignorePaths": [".kokoro/requirements.txt"], "packageRules": [ { "packagePatterns": [ diff --git a/src/main/java/com/google/api/core/AbstractApiFuture.java b/src/main/java/com/google/api/core/AbstractApiFuture.java index 64196a1f1..04d17bb01 100644 --- a/src/main/java/com/google/api/core/AbstractApiFuture.java +++ b/src/main/java/com/google/api/core/AbstractApiFuture.java @@ -37,9 +37,7 @@ import java.util.concurrent.TimeoutException; import javax.annotation.Nullable; -/** - * Abstract implementation of ApiFuture that mirrors {@code AbstractFuture} in Guava. - */ +/** Abstract implementation of ApiFuture that mirrors {@code AbstractFuture} in Guava. */ public abstract class AbstractApiFuture implements ApiFuture { private final InternalSettableFuture impl = new InternalSettableFuture(); diff --git a/src/main/java/com/google/api/core/ApiAsyncFunction.java b/src/main/java/com/google/api/core/ApiAsyncFunction.java index 54554c5be..deb8d48e3 100644 --- a/src/main/java/com/google/api/core/ApiAsyncFunction.java +++ b/src/main/java/com/google/api/core/ApiAsyncFunction.java @@ -32,16 +32,14 @@ /** * Transforms a value, possibly asynchronously. * - *

- * It is similar to Guava's {@code AsyncFunction}, redeclared so that Guava can be shaded. + *

It is similar to Guava's {@code AsyncFunction}, redeclared so that Guava can be shaded. */ public interface ApiAsyncFunction { /** * Returns an output Future to use in place of the given input. The output Future need not be * done, making AsyncFunction suitable for asynchronous derivations. * - *

- * Throwing an exception from this method is equivalent to returning a failing Future. + *

Throwing an exception from this method is equivalent to returning a failing Future. */ ApiFuture apply(I input) throws Exception; } diff --git a/src/main/java/com/google/api/core/ApiClock.java b/src/main/java/com/google/api/core/ApiClock.java index 0c3893ad9..c90e80332 100644 --- a/src/main/java/com/google/api/core/ApiClock.java +++ b/src/main/java/com/google/api/core/ApiClock.java @@ -32,20 +32,16 @@ /** * An interface for getting the current value of a high-resolution time source, in nanoseconds. * - * Clocks other than {@link NanoClock} are typically used only for testing. + *

Clocks other than {@link NanoClock} are typically used only for testing. * - * This interface is required in addition to Java 8's Clock, because nanoTime is required to compare - * values with io.grpc.CallOptions.getDeadlineNanoTime(). + *

This interface is required in addition to Java 8's Clock, because nanoTime is required to + * compare values with io.grpc.CallOptions.getDeadlineNanoTime(). */ public interface ApiClock { - /** - * Returns the current value of this clock's high-resolution time source, in nanoseconds. - */ + /** Returns the current value of this clock's high-resolution time source, in nanoseconds. */ long nanoTime(); - /** - * Returns the current value of this clock's high-resolution time source, in milliseconds. - */ + /** Returns the current value of this clock's high-resolution time source, in milliseconds. */ long millisTime(); } diff --git a/src/main/java/com/google/api/core/ApiFunction.java b/src/main/java/com/google/api/core/ApiFunction.java index 749b534a2..d03d93493 100644 --- a/src/main/java/com/google/api/core/ApiFunction.java +++ b/src/main/java/com/google/api/core/ApiFunction.java @@ -32,8 +32,7 @@ /** * Legacy version of Function. * - *

- * It is similar to Guava's {@code Function}, redeclared so that Guava can be shaded. + *

It is similar to Guava's {@code Function}, redeclared so that Guava can be shaded. */ public interface ApiFunction { T apply(F input); diff --git a/src/main/java/com/google/api/core/ApiFuture.java b/src/main/java/com/google/api/core/ApiFuture.java index de16aceb6..523747585 100644 --- a/src/main/java/com/google/api/core/ApiFuture.java +++ b/src/main/java/com/google/api/core/ApiFuture.java @@ -35,7 +35,7 @@ /** * A Future that can have a listener added. * - * Similar to Guava's {@code ListenableFuture}, but redeclared so that Guava could be shaded. + *

Similar to Guava's {@code ListenableFuture}, but redeclared so that Guava could be shaded. */ public interface ApiFuture extends Future { void addListener(Runnable listener, Executor executor); diff --git a/src/main/java/com/google/api/core/ApiFutureCallback.java b/src/main/java/com/google/api/core/ApiFutureCallback.java index 4c0fdd002..78c0defe8 100644 --- a/src/main/java/com/google/api/core/ApiFutureCallback.java +++ b/src/main/java/com/google/api/core/ApiFutureCallback.java @@ -32,8 +32,7 @@ /** * A callback for accepting the results of an {@link ApiFuture}. * - *

- * It is similar to Guava's {@code FutureCallback}, redeclared so that Guava can be shaded. + *

It is similar to Guava's {@code FutureCallback}, redeclared so that Guava can be shaded. */ public interface ApiFutureCallback { void onFailure(Throwable t); diff --git a/src/main/java/com/google/api/core/ApiFutureToListenableFuture.java b/src/main/java/com/google/api/core/ApiFutureToListenableFuture.java index 2903877bd..e7c6e9f78 100644 --- a/src/main/java/com/google/api/core/ApiFutureToListenableFuture.java +++ b/src/main/java/com/google/api/core/ApiFutureToListenableFuture.java @@ -35,9 +35,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -/** - * INTERNAL USE ONLY. Adapter from ApiFuture to Guava ListenableFuture. - */ +/** INTERNAL USE ONLY. Adapter from ApiFuture to Guava ListenableFuture. */ @InternalApi public class ApiFutureToListenableFuture implements ListenableFuture { private final ApiFuture apiFuture; diff --git a/src/main/java/com/google/api/core/ApiService.java b/src/main/java/com/google/api/core/ApiService.java index 713c244f6..ee49e78f3 100644 --- a/src/main/java/com/google/api/core/ApiService.java +++ b/src/main/java/com/google/api/core/ApiService.java @@ -34,35 +34,32 @@ import java.util.concurrent.TimeoutException; /** - * An object with an operational state, plus asynchronous {@link #startAsync()} and - * {@link #stopAsync()} lifecycle methods to transition between states. Example services include + * An object with an operational state, plus asynchronous {@link #startAsync()} and {@link + * #stopAsync()} lifecycle methods to transition between states. Example services include * webservers, RPC servers and timers. * - *

- * The normal lifecycle of a service is: + *

The normal lifecycle of a service is: * *

* - *

- * There are deviations from this if there are failures or if {@link ApiService#stopAsync} is called - * before the {@link ApiService} reaches the {@linkplain State#RUNNING RUNNING} state. The set of - * legal transitions form a DAG, - * therefore every method of the listener will be called at most once. N.B. The {@link State#FAILED} - * and {@link State#TERMINATED} states are terminal states, once a service enters either of these - * states it cannot ever leave them. + *

There are deviations from this if there are failures or if {@link ApiService#stopAsync} is + * called before the {@link ApiService} reaches the {@linkplain State#RUNNING RUNNING} state. The + * set of legal transitions form a DAG, therefore every method of the + * listener will be called at most once. N.B. The {@link State#FAILED} and {@link State#TERMINATED} + * states are terminal states, once a service enters either of these states it cannot ever leave + * them. * - *

- * Implementors of this interface are strongly encouraged to extend {@link AbstractApiService} which - * implement this interface and make the threading and state management easier. + *

Implementors of this interface are strongly encouraged to extend {@link AbstractApiService} + * which implement this interface and make the threading and state management easier. * - *

- * Similar to Guava's {@code Service}, but redeclared so that Guava could be shaded. + *

Similar to Guava's {@code Service}, but redeclared so that Guava could be shaded. */ public interface ApiService { /** @@ -71,17 +68,15 @@ public interface ApiService { * service changes state. The listener will not have previous state changes replayed, so it is * suggested that listeners are added before the service starts. * - *

- * {@code addListener} guarantees execution ordering across calls to a given listener but not + *

{@code addListener} guarantees execution ordering across calls to a given listener but not * across calls to multiple listeners. Specifically, a given listener will have its callbacks * invoked in the same order as the underlying service enters those states. Additionally, at most * one of the listener's callbacks will execute at once. However, multiple listeners' callbacks * may execute concurrently, and listeners may execute in an order different from the one in which * they were registered. * - *

- * RuntimeExceptions thrown by a listener will be caught and logged. Any exception thrown during - * {@code Executor.execute} (e.g., a {@code RejectedExecutionException}) will be caught and + *

RuntimeExceptions thrown by a listener will be caught and logged. Any exception thrown + * during {@code Executor.execute} (e.g., a {@code RejectedExecutionException}) will be caught and * logged. * * @param listener the listener to run when the service changes state is complete @@ -93,8 +88,8 @@ public interface ApiService { * Waits for the {@link ApiService} to reach the {@linkplain State#RUNNING running state}. * * @throws IllegalStateException if the service reaches a state from which it is not possible to - * enter the {@link State#RUNNING} state. e.g. if the {@code state} is {@code State#TERMINATED} - * when this method is called then this will throw an IllegalStateException. + * enter the {@link State#RUNNING} state. e.g. if the {@code state} is {@code + * State#TERMINATED} when this method is called then this will throw an IllegalStateException. */ void awaitRunning(); @@ -106,9 +101,8 @@ public interface ApiService { * @param unit the time unit of the timeout argument * @throws TimeoutException if the service has not reached the given state within the deadline * @throws IllegalStateException if the service reaches a state from which it is not possible to - * enter the {@link State#RUNNING RUNNING} state. e.g. if the {@code state} is - * {@code State#TERMINATED} when this method is called then this will throw an - * IllegalStateException. + * enter the {@link State#RUNNING RUNNING} state. e.g. if the {@code state} is {@code + * State#TERMINATED} when this method is called then this will throw an IllegalStateException. */ void awaitRunning(long timeout, TimeUnit unit) throws TimeoutException; @@ -154,10 +148,10 @@ public interface ApiService { /** * If the service is {@linkplain State#STARTING starting} or {@linkplain State#RUNNING running}, - * this initiates service shutdown and returns immediately. If the service is - * {@linkplain State#NEW new}, it is {@linkplain State#TERMINATED terminated} without having been - * started nor stopped. If the service has already been stopped, this method returns immediately - * without taking action. + * this initiates service shutdown and returns immediately. If the service is {@linkplain + * State#NEW new}, it is {@linkplain State#TERMINATED terminated} without having been started nor + * stopped. If the service has already been stopped, this method returns immediately without + * taking action. * * @return this */ @@ -166,9 +160,8 @@ public interface ApiService { /** * The lifecycle states of a service. * - *

- * The ordering of the {@link State} enum is defined such that if there is a state transition from - * {@code A -> B} then {@code A.compareTo(B) < 0}. N.B. The converse is not true, i.e. if + *

The ordering of the {@link State} enum is defined such that if there is a state transition + * from {@code A -> B} then {@code A.compareTo(B) < 0}. N.B. The converse is not true, i.e. if * {@code A.compareTo(B) < 0} then there is not guaranteed to be a valid state transition * {@code A -> B}. */ @@ -203,8 +196,7 @@ enum State { * A listener for the various state changes that a {@link ApiService} goes through in its * lifecycle. * - *

- * All methods are no-ops by default, implementors should override the ones they care about. + *

All methods are no-ops by default, implementors should override the ones they care about. */ @BetaApi abstract class Listener { @@ -214,29 +206,29 @@ abstract class Listener { * Therefore, if this method is called, no other methods will be called on the {@link Listener}. * * @param from The previous state that is being transitioned from. Failure can occur in any - * state with the exception of {@linkplain State#NEW NEW} or {@linkplain State#TERMINATED - * TERMINATED}. + * state with the exception of {@linkplain State#NEW NEW} or {@linkplain State#TERMINATED + * TERMINATED}. * @param failure The exception that caused the failure. */ public void failed(State from, Throwable failure) {} /** - * Called when the service transitions from {@linkplain State#STARTING STARTING} to - * {@linkplain State#RUNNING RUNNING}. This occurs when a service has successfully started. + * Called when the service transitions from {@linkplain State#STARTING STARTING} to {@linkplain + * State#RUNNING RUNNING}. This occurs when a service has successfully started. */ public void running() {} /** - * Called when the service transitions from {@linkplain State#NEW NEW} to - * {@linkplain State#STARTING STARTING}. This occurs when {@link ApiService#startAsync} is - * called the first time. + * Called when the service transitions from {@linkplain State#NEW NEW} to {@linkplain + * State#STARTING STARTING}. This occurs when {@link ApiService#startAsync} is called the first + * time. */ public void starting() {} /** * Called when the service transitions to the {@linkplain State#STOPPING STOPPING} state. The - * only valid values for {@code from} are {@linkplain State#STARTING STARTING} or - * {@linkplain State#RUNNING RUNNING}. This occurs when {@link ApiService#stopAsync} is called. + * only valid values for {@code from} are {@linkplain State#STARTING STARTING} or {@linkplain + * State#RUNNING RUNNING}. This occurs when {@link ApiService#stopAsync} is called. * * @param from The previous state that is being transitioned from. */ @@ -245,12 +237,12 @@ public void stopping(State from) {} /** * Called when the service transitions to the {@linkplain State#TERMINATED TERMINATED} state. * The {@linkplain State#TERMINATED TERMINATED} state is a terminal state in the transition - * diagram. Therefore, if this method is called, no other methods will be called on the - * {@link Listener}. + * diagram. Therefore, if this method is called, no other methods will be called on the {@link + * Listener}. * * @param from The previous state that is being transitioned from. The only valid values for - * this are {@linkplain State#NEW NEW}, {@linkplain State#RUNNING RUNNING} or - * {@linkplain State#STOPPING STOPPING}. + * this are {@linkplain State#NEW NEW}, {@linkplain State#RUNNING RUNNING} or {@linkplain + * State#STOPPING STOPPING}. */ public void terminated(State from) {} } diff --git a/src/main/java/com/google/api/core/BetaApi.java b/src/main/java/com/google/api/core/BetaApi.java index 0c1d349ee..4b6491b73 100644 --- a/src/main/java/com/google/api/core/BetaApi.java +++ b/src/main/java/com/google/api/core/BetaApi.java @@ -39,16 +39,16 @@ * Indicates a public API that can change at any time, and has no guarantee of API stability and * backward-compatibility. * - *

- * Usage guidelines: + *

Usage guidelines: + * *

    - *
  1. This annotation is used only on APIs with public visibility. Internal interfaces should not - * use it.
  2. - *
  3. This annotation should only be added to new APIs. Adding it to an existing API is considered - * API-breaking.
  4. - *
  5. Removing this annotation from an API gives it stable status, assuming the API doesn't have - * other annotations denoting instability (such as {@link InternalApi} or - * {@link InternalExtensionOnly}).
  6. + *
  7. This annotation is used only on APIs with public visibility. Internal interfaces should not + * use it. + *
  8. This annotation should only be added to new APIs. Adding it to an existing API is + * considered API-breaking. + *
  9. Removing this annotation from an API gives it stable status, assuming the API doesn't have + * other annotations denoting instability (such as {@link InternalApi} or {@link + * InternalExtensionOnly}). *
*/ @BetaApi @@ -63,8 +63,6 @@ }) @Documented public @interface BetaApi { - /** - * Context information such as links to a discussion thread, tracking issue, etc. - */ + /** Context information such as links to a discussion thread, tracking issue, etc. */ String value() default ""; } diff --git a/src/main/java/com/google/api/core/InternalApi.java b/src/main/java/com/google/api/core/InternalApi.java index 67161bcbd..80b76706c 100644 --- a/src/main/java/com/google/api/core/InternalApi.java +++ b/src/main/java/com/google/api/core/InternalApi.java @@ -39,12 +39,10 @@ * Annotates a program element (class, method, package etc) which is internal to its containing * library, not part of the public API, and should not be used by users of the library. * - *

- * This annotation only makes sense on APIs that are not private. Its existence is necessary because - * Java does not have a visibility level for code within a compilation unit. + *

This annotation only makes sense on APIs that are not private. Its existence is necessary + * because Java does not have a visibility level for code within a compilation unit. * - *

- * Adding this annotation to an API is considered API-breaking. + *

Adding this annotation to an API is considered API-breaking. */ @BetaApi @Retention(RetentionPolicy.RUNTIME) @@ -58,8 +56,6 @@ }) @Documented public @interface InternalApi { - /** - * Context information such as "internal to library", "for testing", etc. - */ + /** Context information such as "internal to library", "for testing", etc. */ String value() default ""; } diff --git a/src/main/java/com/google/api/core/InternalExtensionOnly.java b/src/main/java/com/google/api/core/InternalExtensionOnly.java index 5b410e2c8..2304f77d6 100644 --- a/src/main/java/com/google/api/core/InternalExtensionOnly.java +++ b/src/main/java/com/google/api/core/InternalExtensionOnly.java @@ -39,20 +39,18 @@ * Indicates a public API that is stable for callers to use, but has no guarantee of stability for * extension. Consequently, the API should only be extended within the package containing the API. * - *

- * For example: + *

For example: + * *

* - *

- * The list above is just for illustration purposes and is not exhaustive. + *

The list above is just for illustration purposes and is not exhaustive. * - *

- * Adding this annotation to an API is considered API-breaking. + *

Adding this annotation to an API is considered API-breaking. */ @BetaApi @Retention(RetentionPolicy.RUNTIME) @@ -66,8 +64,6 @@ }) @Documented public @interface InternalExtensionOnly { - /** - * Context information on why the interface/class is annotated with InternalExtensionOnly. - */ + /** Context information on why the interface/class is annotated with InternalExtensionOnly. */ String value() default ""; } diff --git a/src/main/java/com/google/api/core/ListenableFutureToApiFuture.java b/src/main/java/com/google/api/core/ListenableFutureToApiFuture.java index 7bf9fabc4..fe77f56d3 100644 --- a/src/main/java/com/google/api/core/ListenableFutureToApiFuture.java +++ b/src/main/java/com/google/api/core/ListenableFutureToApiFuture.java @@ -32,9 +32,7 @@ import com.google.common.util.concurrent.ForwardingListenableFuture.SimpleForwardingListenableFuture; import com.google.common.util.concurrent.ListenableFuture; -/** - * INTERNAL USE ONLY. Adapter from Guava ListenableFuture to ApiFuture. - */ +/** INTERNAL USE ONLY. Adapter from Guava ListenableFuture to ApiFuture. */ @InternalApi public class ListenableFutureToApiFuture extends SimpleForwardingListenableFuture implements ApiFuture { diff --git a/src/main/java/com/google/api/pathtemplate/PathTemplate.java b/src/main/java/com/google/api/pathtemplate/PathTemplate.java index b23430e6e..cc9f4c110 100644 --- a/src/main/java/com/google/api/pathtemplate/PathTemplate.java +++ b/src/main/java/com/google/api/pathtemplate/PathTemplate.java @@ -52,54 +52,51 @@ /** * Represents a path template. * - *

- * Templates use the syntax of the API platform; see the protobuf of HttpRule for details. A + *

Templates use the syntax of the API platform; see the protobuf of HttpRule for details. A * template consists of a sequence of literals, wildcards, and variable bindings, where each binding - * can have a sub-path. A string representation can be parsed into an instance of - * {@link PathTemplate}, which can then be used to perform matching and instantiation. + * can have a sub-path. A string representation can be parsed into an instance of {@link + * PathTemplate}, which can then be used to perform matching and instantiation. * - *

- * Matching and instantiation deals with unescaping and escaping using URL encoding rules. For - * example, if a template variable for a single segment is instantiated with a string like - * {@code "a/b"}, the slash will be escaped to {@code "%2f"}. (Note that slash will not be escaped - * for a multiple-segment variable, but other characters will). The literals in the template itself - * are not escaped automatically, and must be already URL encoded. + *

Matching and instantiation deals with unescaping and escaping using URL encoding rules. For + * example, if a template variable for a single segment is instantiated with a string like {@code + * "a/b"}, the slash will be escaped to {@code "%2f"}. (Note that slash will not be escaped for a + * multiple-segment variable, but other characters will). The literals in the template itself are + * not escaped automatically, and must be already URL encoded. * - *

- * Here is an example for a template using simple variables: + *

Here is an example for a template using simple variables: * *

{@code
- *   PathTemplate template = PathTemplate.create("v1/shelves/{shelf}/books/{book}");
- *   assert template.matches("v2/shelves") == false;
- *   Map<String, String> values = template.match("v1/shelves/s1/books/b1");
- *   Map<String, String> expectedValues = new HashMap<>();
- *   expectedValues.put("shelf", "s1");
- *   expectedValues.put("book", "b1");
- *   assert values.equals(expectedValues);
- *   assert template.instantiate(values).equals("v1/shelves/s1/books/b1");
+ * PathTemplate template = PathTemplate.create("v1/shelves/{shelf}/books/{book}");
+ * assert template.matches("v2/shelves") == false;
+ * Map<String, String> values = template.match("v1/shelves/s1/books/b1");
+ * Map<String, String> expectedValues = new HashMap<>();
+ * expectedValues.put("shelf", "s1");
+ * expectedValues.put("book", "b1");
+ * assert values.equals(expectedValues);
+ * assert template.instantiate(values).equals("v1/shelves/s1/books/b1");
  * }
* * Templates can use variables which match sub-paths. Example: * *
{@code
- *   PathTemplate template = PathTemplate.create("v1/{name=shelves/*/books/*}"};
- *   assert template.match("v1/shelves/books/b1") == null;
- *   Map<String, String> expectedValues = new HashMap<>();
- *   expectedValues.put("name", "shelves/s1/books/b1");
- *   assert template.match("v1/shelves/s1/books/b1").equals(expectedValues);
+ * PathTemplate template = PathTemplate.create("v1/{name=shelves/*/books/*}"};
+ * assert template.match("v1/shelves/books/b1") == null;
+ * Map<String, String> expectedValues = new HashMap<>();
+ * expectedValues.put("name", "shelves/s1/books/b1");
+ * assert template.match("v1/shelves/s1/books/b1").equals(expectedValues);
  * }
* * Path templates can also be used with only wildcards. Each wildcard is associated with an implicit * variable {@code $n}, where n is the zero-based position of the wildcard. Example: * *
{@code
- *   PathTemplate template = PathTemplate.create("shelves/*/books/*"};
- *   assert template.match("shelves/books/b1") == null;
- *   Map<String, String> values = template.match("v1/shelves/s1/books/b1");
- *   Map<String, String> expectedValues = new HashMap<>();
- *   expectedValues.put("$0", s1");
- *   expectedValues.put("$1", "b1");
- *   assert values.equals(expectedValues);
+ * PathTemplate template = PathTemplate.create("shelves/*/books/*"};
+ * assert template.match("shelves/books/b1") == null;
+ * Map<String, String> values = template.match("v1/shelves/s1/books/b1");
+ * Map<String, String> expectedValues = new HashMap<>();
+ * expectedValues.put("$0", s1");
+ * expectedValues.put("$1", "b1");
+ * assert values.equals(expectedValues);
  * }
* * Paths input to matching can use URL relative syntax to indicate a host name by prefixing the host @@ -108,14 +105,14 @@ * for URL relative syntax and simple path syntax: * *
{@code
- *   PathTemplate template = PathTemplate.create("shelves/*"};
- *   Map<String, String> expectedValues = new HashMap<>();
- *   expectedValues.put(PathTemplate.HOSTNAME_VAR, "//somewhere.io");
- *   expectedValues.put("$0", s1");
- *   assert template.match("//somewhere.io/shelves/s1").equals(expectedValues);
- *   expectedValues.clear();
- *   expectedValues.put("$0", s1");
- *   assert template.match("shelves/s1").equals(expectedValues);
+ * PathTemplate template = PathTemplate.create("shelves/*"};
+ * Map<String, String> expectedValues = new HashMap<>();
+ * expectedValues.put(PathTemplate.HOSTNAME_VAR, "//somewhere.io");
+ * expectedValues.put("$0", s1");
+ * assert template.match("//somewhere.io/shelves/s1").equals(expectedValues);
+ * expectedValues.clear();
+ * expectedValues.put("$0", s1");
+ * assert template.match("shelves/s1").equals(expectedValues);
  * }
* * For the representation of a resource name see {@link TemplatedResourceName}, which is @@ -124,9 +121,8 @@ public class PathTemplate { /** - * A constant identifying the special variable used for endpoint bindings in the result of - * {@link #matchFromFullName(String)}. It may also contain protocol string, if its provided in the - * input. + * A constant identifying the special variable used for endpoint bindings in the result of {@link + * #matchFromFullName(String)}. It may also contain protocol string, if its provided in the input. */ public static final String HOSTNAME_VAR = "$hostname"; @@ -347,16 +343,15 @@ public PathTemplate withoutVars() { * Returns a path template for the sub-path of the given variable. Example: * *
{@code
-   *   PathTemplate template = PathTemplate.create("v1/{name=shelves/*/books/*}");
-   *   assert template.subTemplate("name").toString().equals("shelves/*/books/*");
+   * PathTemplate template = PathTemplate.create("v1/{name=shelves/*/books/*}");
+   * assert template.subTemplate("name").toString().equals("shelves/*/books/*");
    * }
* * The returned template will never have named variables, but only wildcards, which are dealt with - * in matching and instantiation using '$n'-variables. See the documentation of - * {@link #match(String)} and {@link #instantiate(Map)}, respectively. + * in matching and instantiation using '$n'-variables. See the documentation of {@link + * #match(String)} and {@link #instantiate(Map)}, respectively. * - *

- * For a variable which has no sub-path, this returns a path template with a single wildcard + *

For a variable which has no sub-path, this returns a path template with a single wildcard * ('*'). * * @throws ValidationException if the variable does not exist in the template. @@ -422,9 +417,7 @@ public void validate(String path, String exceptionMessagePrefix) { throw new ValidationException( String.format( "%s: Parameter \"%s\" must be in the form \"%s\"", - exceptionMessagePrefix, - path, - this.toString())); + exceptionMessagePrefix, path, this.toString())); } } @@ -434,30 +427,27 @@ public void validate(String path, String exceptionMessagePrefix) { * throws a ValidationException. The exceptionMessagePrefix parameter will be prepended to the * ValidationException message. * - *

- * If the path starts with '//', the first segment will be interpreted as a host name and stored - * in the variable {@link #HOSTNAME_VAR}. + *

If the path starts with '//', the first segment will be interpreted as a host name and + * stored in the variable {@link #HOSTNAME_VAR}. * - *

- * See the {@link PathTemplate} class documentation for examples. + *

See the {@link PathTemplate} class documentation for examples. * - *

- * For free wildcards in the template, the matching process creates variables named '$n', where + *

For free wildcards in the template, the matching process creates variables named '$n', where * 'n' is the wildcard's position in the template (starting at n=0). For example: * *

{@code
-   *   PathTemplate template = PathTemplate.create("shelves/*/books/*");
-   *   Map<String, String> expectedValues = new HashMap<>();
-   *   expectedValues.put("$0", "s1");
-   *   expectedValues.put("$1", "b1");
-   *   assert template.validatedMatch("shelves/s1/books/b2", "User exception string")
-   *              .equals(expectedValues);
-   *   expectedValues.clear();
-   *   expectedValues.put(HOSTNAME_VAR, "//somewhere.io");
-   *   expectedValues.put("$0", "s1");
-   *   expectedValues.put("$1", "b1");
-   *   assert template.validatedMatch("//somewhere.io/shelves/s1/books/b2", "User exception string")
-   *              .equals(expectedValues);
+   * PathTemplate template = PathTemplate.create("shelves/*/books/*");
+   * Map<String, String> expectedValues = new HashMap<>();
+   * expectedValues.put("$0", "s1");
+   * expectedValues.put("$1", "b1");
+   * assert template.validatedMatch("shelves/s1/books/b2", "User exception string")
+   *            .equals(expectedValues);
+   * expectedValues.clear();
+   * expectedValues.put(HOSTNAME_VAR, "//somewhere.io");
+   * expectedValues.put("$0", "s1");
+   * expectedValues.put("$1", "b1");
+   * assert template.validatedMatch("//somewhere.io/shelves/s1/books/b2", "User exception string")
+   *            .equals(expectedValues);
    * }
* * All matched values will be properly unescaped using URL encoding rules (so long as URL encoding @@ -469,9 +459,7 @@ public Map validatedMatch(String path, String exceptionMessagePr throw new ValidationException( String.format( "%s: Parameter \"%s\" must be in the form \"%s\"", - exceptionMessagePrefix, - path, - this.toString())); + exceptionMessagePrefix, path, this.toString())); } return matchMap; } @@ -486,28 +474,25 @@ public boolean matches(String path) { * will be properly unescaped using URL encoding rules. If the path does not match the template, * null is returned. * - *

- * If the path starts with '//', the first segment will be interpreted as a host name and stored - * in the variable {@link #HOSTNAME_VAR}. + *

If the path starts with '//', the first segment will be interpreted as a host name and + * stored in the variable {@link #HOSTNAME_VAR}. * - *

- * See the {@link PathTemplate} class documentation for examples. + *

See the {@link PathTemplate} class documentation for examples. * - *

- * For free wildcards in the template, the matching process creates variables named '$n', where + *

For free wildcards in the template, the matching process creates variables named '$n', where * 'n' is the wildcard's position in the template (starting at n=0). For example: * *

{@code
-   *   PathTemplate template = PathTemplate.create("shelves/*/books/*");
-   *   Map<String, String> expectedValues = new HashMap<>();
-   *   expectedValues.put("$0", "s1");
-   *   expectedValues.put("$1", "b1");
-   *   assert template.match("shelves/s1/books/b2").equals(expectedValues);
-   *   expectedValues.clear();
-   *   expectedValues.put(HOSTNAME_VAR, "//somewhere.io");
-   *   expectedValues.put("$0", "s1");
-   *   expectedValues.put("$1", "b1");
-   *   assert template.match("//somewhere.io/shelves/s1/books/b2").equals(expectedValues);
+   * PathTemplate template = PathTemplate.create("shelves/*/books/*");
+   * Map<String, String> expectedValues = new HashMap<>();
+   * expectedValues.put("$0", "s1");
+   * expectedValues.put("$1", "b1");
+   * assert template.match("shelves/s1/books/b2").equals(expectedValues);
+   * expectedValues.clear();
+   * expectedValues.put(HOSTNAME_VAR, "//somewhere.io");
+   * expectedValues.put("$0", "s1");
+   * expectedValues.put("$1", "b1");
+   * assert template.match("//somewhere.io/shelves/s1/books/b2").equals(expectedValues);
    * }
* * All matched values will be properly unescaped using URL encoding rules (so long as URL encoding @@ -523,11 +508,11 @@ public Map match(String path) { * it starts with '//' or not. Example: * *
{@code
-   *   Map<String, String> expectedValues = new HashMap<>();
-   *   expectedValues.put(HOSTNAME_VAR, "//somewhere.io");
-   *   expectedValues.put("name", "shelves/s1");
-   *   assert template("{name=shelves/*}").matchFromFullName("somewhere.io/shelves/s1")
-   *            .equals(expectedValues);
+   * Map<String, String> expectedValues = new HashMap<>();
+   * expectedValues.put(HOSTNAME_VAR, "//somewhere.io");
+   * expectedValues.put("name", "shelves/s1");
+   * assert template("{name=shelves/*}").matchFromFullName("somewhere.io/shelves/s1")
+   *          .equals(expectedValues);
    * }
*/ @Nullable @@ -696,10 +681,9 @@ private static String concatCaptures(@Nullable String cur, String next) { * Instantiate the template based on the given variable assignment. Performs proper URL escaping * of variable assignments. * - *

- * Note that free wildcards in the template must have bindings of '$n' variables, where 'n' is the - * position of the wildcard (starting at 0). See the documentation of {@link #match(String)} for - * details. + *

Note that free wildcards in the template must have bindings of '$n' variables, where 'n' is + * the position of the wildcard (starting at 0). See the documentation of {@link #match(String)} + * for details. * * @throws ValidationException if a variable occurs in the template without a binding. */ @@ -721,10 +705,10 @@ public String instantiate(String... keysAndValues) { * using their original syntax. Example: * *

{@code
-   *   PathTemplate template = PathTemplate.create("v1/shelves/{shelf}/books/{book}");
-   *   Map<String, String> partialMap = new HashMap<>();
-   *   partialMap.put("shelf", "s1");
-   *   assert template.instantiatePartial(partialMap).equals("v1/shelves/s1/books/{book}");
+   * PathTemplate template = PathTemplate.create("v1/shelves/{shelf}/books/{book}");
+   * Map<String, String> partialMap = new HashMap<>();
+   * partialMap.put("shelf", "s1");
+   * assert template.instantiatePartial(partialMap).equals("v1/shelves/s1/books/{book}");
    * }
* * The result of this call can be used to create a new template. @@ -1020,7 +1004,8 @@ private static boolean isSegmentBeginOrEndInvalid(String seg) { // A segment can start with a delimiter, as long as there is no { right after it. // A segment can end with a delimiter, as long as there is no } right before it. // e.g. Invalid: .{well}-{known}, {well}-{known}- - // Valid: .well-known, .well-{known}, .-~{well-known}, these segments are all considered as literals for matching + // Valid: .well-known, .well-{known}, .-~{well-known}, these segments are all considered as + // literals for matching return (COMPLEX_DELIMITER_PATTERN.matcher(seg.substring(0, 1)).find() && seg.charAt(1) == '{') || (COMPLEX_DELIMITER_PATTERN.matcher(seg.substring(seg.length() - 1)).find() && seg.charAt(seg.length() - 2) == '}'); diff --git a/src/main/java/com/google/api/pathtemplate/TemplatedResourceName.java b/src/main/java/com/google/api/pathtemplate/TemplatedResourceName.java index 98312e342..f448f9677 100644 --- a/src/main/java/com/google/api/pathtemplate/TemplatedResourceName.java +++ b/src/main/java/com/google/api/pathtemplate/TemplatedResourceName.java @@ -30,7 +30,6 @@ package com.google.api.pathtemplate; -import com.google.api.core.BetaApi; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; @@ -43,25 +42,22 @@ /** * Class for representing and working with resource names. * - *

- * A resource name is represented by {@link PathTemplate}, an assignment to variables in the + *

A resource name is represented by {@link PathTemplate}, an assignment to variables in the * template, and an optional endpoint. The {@code ResourceName} class implements the map interface * (unmodifiable) to work with the variable assignments, and has methods to reproduce the string * representation of the name, to construct new names, and to dereference names into resources. * - *

- * As a resource name essentially represents a match of a path template against a string, it can be - * also used for other purposes than naming resources. However, not all provided methods may make + *

As a resource name essentially represents a match of a path template against a string, it can + * be also used for other purposes than naming resources. However, not all provided methods may make * sense in all applications. * - *

- * Usage examples: + *

Usage examples: * *

{@code
- *   PathTemplate template = PathTemplate.create("shelves/*/books/*");
- *   TemplatedResourceName resourceName = TemplatedResourceName.create(template, "shelves/s1/books/b1");
- *   assert resourceName.get("$1").equals("b1");
- *   assert resourceName.parentName().toString().equals("shelves/s1/books");
+ * PathTemplate template = PathTemplate.create("shelves/*/books/*");
+ * TemplatedResourceName resourceName = TemplatedResourceName.create(template, "shelves/s1/books/b1");
+ * assert resourceName.get("$1").equals("b1");
+ * assert resourceName.parentName().toString().equals("shelves/s1/books");
  * }
*/ public class TemplatedResourceName implements Map { @@ -69,13 +65,9 @@ public class TemplatedResourceName implements Map { // ResourceName Resolver // ===================== - /** - * Represents a resource name resolver which can be registered with this class. - */ + /** Represents a resource name resolver which can be registered with this class. */ public interface Resolver { - /** - * Resolves the resource name into a resource by calling the underlying API. - */ + /** Resolves the resource name into a resource by calling the underlying API. */ T resolve(Class resourceType, TemplatedResourceName name, @Nullable String version); } @@ -180,31 +172,23 @@ public int hashCode() { return Objects.hash(template, endpoint, values); } - /** - * Gets the template associated with this resource name. - */ + /** Gets the template associated with this resource name. */ public PathTemplate template() { return template; } - /** - * Checks whether the resource name has an endpoint. - */ + /** Checks whether the resource name has an endpoint. */ public boolean hasEndpoint() { return endpoint != null; } - /** - * Returns the endpoint of this resource name, or null if none is defined. - */ + /** Returns the endpoint of this resource name, or null if none is defined. */ @Nullable public String endpoint() { return endpoint; } - /** - * Returns a resource name with specified endpoint. - */ + /** Returns a resource name with specified endpoint. */ public TemplatedResourceName withEndpoint(String endpoint) { return new TemplatedResourceName(template, values, Preconditions.checkNotNull(endpoint)); } diff --git a/src/main/java/com/google/api/pathtemplate/ValidationException.java b/src/main/java/com/google/api/pathtemplate/ValidationException.java index 0db919306..3efa388f5 100644 --- a/src/main/java/com/google/api/pathtemplate/ValidationException.java +++ b/src/main/java/com/google/api/pathtemplate/ValidationException.java @@ -68,9 +68,7 @@ public String get() { }); } - /** - * Clears the validation context. - */ + /** Clears the validation context. */ public static void popCurrentThreadValidationContext() { Stack stack = contextLocal.get(); if (stack != null) { @@ -78,9 +76,7 @@ public static void popCurrentThreadValidationContext() { } } - /** - * Construct validation exception with implicit context. - */ + /** Construct validation exception with implicit context. */ public ValidationException(String format, Object... args) { super(message(contextLocal.get(), format, args)); } diff --git a/src/main/java/com/google/api/resourcenames/ResourceName.java b/src/main/java/com/google/api/resourcenames/ResourceName.java index bb88cebe3..e1c54663d 100644 --- a/src/main/java/com/google/api/resourcenames/ResourceName.java +++ b/src/main/java/com/google/api/resourcenames/ResourceName.java @@ -35,9 +35,7 @@ /** An interface that generated resource name types must implement. */ public interface ResourceName { - /** - * Return the map of each field name to its value. - */ + /** Return the map of each field name to its value. */ Map getFieldValuesMap(); /** diff --git a/src/test/java/com/google/api/resourcenames/UntypedResourceNameTest.java b/src/test/java/com/google/api/resourcenames/UntypedResourceNameTest.java index b796f54f5..c0615da41 100644 --- a/src/test/java/com/google/api/resourcenames/UntypedResourceNameTest.java +++ b/src/test/java/com/google/api/resourcenames/UntypedResourceNameTest.java @@ -39,9 +39,7 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -/** - * Tests for {@link UntypedResourceNameTest}. - */ +/** Tests for {@link UntypedResourceNameTest}. */ @RunWith(JUnit4.class) public class UntypedResourceNameTest { private static final String NAME_STRING = "sunshine"; diff --git a/versions.txt b/versions.txt index 8910c8ba8..4893b96e8 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -api-common:2.2.2:2.2.2 +api-common:2.3.0:2.3.0