From e4b7fa7219cfe00802aab1401d40760b3c27db34 Mon Sep 17 00:00:00 2001 From: Andrea Lin Date: Mon, 29 Apr 2019 15:16:00 -0700 Subject: [PATCH 01/18] Bump version for development (#83) --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index a8fdfda1c..4df9f77d1 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.8.1 +1.8.2-SNAPSHOT From 0c07a5fecdd1f68a39904764c6a8bb7e7f285836 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 4 Jun 2019 14:16:03 +0200 Subject: [PATCH 02/18] Add renovate.json (#84) --- renovate.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..f45d8f110 --- /dev/null +++ b/renovate.json @@ -0,0 +1,5 @@ +{ + "extends": [ + "config:base" + ] +} From 34d38cce37582cc8dd5a47af40904f4b3d10fac2 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Mon, 24 Jun 2019 11:01:48 -0400 Subject: [PATCH 03/18] workaround Gradle bug (#82) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d95645ed6..fdc5f580e 100644 --- a/build.gradle +++ b/build.gradle @@ -237,7 +237,7 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') name 'GoogleAPIs' email 'googleapis@googlegroups.com' url 'https://github.com/googleapis' - organization 'Google, Inc.' + organization = 'Google, Inc.' organizationUrl 'https://www.google.com' } } From dab4dea28e9d446ae985638e85dd5d90d460738e Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 24 Jun 2019 17:03:24 +0200 Subject: [PATCH 04/18] Update dependency gradle to v4.10.3 (#85) --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 84c977200..f6fd8db47 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-4.8.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip From fc3011ead66b006dd86b09ef7fb4ba7ec87cb030 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Thu, 29 Aug 2019 14:56:10 -0400 Subject: [PATCH 05/18] build on trusty (#81) --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 98fb50e41..058f65fc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ sudo: false -dist: precise +dist: trusty language: java addons: # https://github.com/travis-ci/travis-ci/issues/5227#issuecomment-165131913 @@ -8,7 +8,6 @@ addons: hostname: fake-hostname-to-work-around-travis-bug jdk: - oraclejdk8 - - oraclejdk7 - openjdk7 script: ./gradlew check --info From 317d111ae7389d0b70eb00cb5704c2f8641f4ca4 Mon Sep 17 00:00:00 2001 From: Kshithij Iyer Date: Fri, 1 Nov 2019 23:11:51 +0530 Subject: [PATCH 06/18] Adding title to CONTRIBUTING.md (#89) --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2827b7d3f..c6877c550 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,5 @@ +# How to Contribute + Want to contribute? Great! First, read this page (including the small print at the end). ### Before you contribute From 48c647f063f6f24e36428ef6cb42f55c0d7cb236 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Tue, 5 Nov 2019 16:34:50 -0500 Subject: [PATCH 07/18] Update guava and Truth (#90) * Update guava and Truth * update errorprone --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index fdc5f580e..2c63217c3 100644 --- a/build.gradle +++ b/build.gradle @@ -39,15 +39,15 @@ ext { // Shortcuts for libraries we are using libraries = [ javax_annotations: 'javax.annotation:javax.annotation-api:1.3.2', - guava: 'com.google.guava:guava:26.0-android', + guava: 'com.google.guava:guava:28.1-android', jsr305: 'com.google.code.findbugs:jsr305:3.0.2', autovalue: 'com.google.auto.value:auto-value:1.1', - error_prone_annotations: 'com.google.errorprone:error_prone_annotations:2.3.2', + error_prone_annotations: 'com.google.errorprone:error_prone_annotations:2.3.3', // Testing junit: 'junit:junit:4.12', mockito: 'org.mockito:mockito-core:1.10.19', - truth: 'com.google.truth:truth:0.42', + truth: 'com.google.truth:truth:1.0', commons: 'org.apache.commons:commons-lang3:3.5', // Formatter From d3495c6c90c506340094468b13329af21761b791 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Mon, 25 Nov 2019 10:30:09 -0500 Subject: [PATCH 08/18] remove unused dependencies (#91) --- build.gradle | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 2c63217c3..0178b4dbb 100644 --- a/build.gradle +++ b/build.gradle @@ -48,10 +48,6 @@ ext { junit: 'junit:junit:4.12', mockito: 'org.mockito:mockito-core:1.10.19', truth: 'com.google.truth:truth:1.0', - commons: 'org.apache.commons:commons-lang3:3.5', - - // Formatter - javaFomatter: 'com.google.googlejavaformat:google-java-format:0.1-alpha' ] } @@ -70,8 +66,7 @@ dependencies { testCompile libraries.junit, libraries.mockito, - libraries.truth, - libraries.commons + libraries.truth } clean.doFirst { From 0761dde9cf8e1789d4a6c8c68fffebba788576db Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 25 Nov 2019 12:07:55 -0600 Subject: [PATCH 09/18] Add Kokoro release scripts (#88) --- .kokoro/build.sh | 27 +++++++++++++++ .kokoro/common.cfg | 13 ++++++++ .kokoro/continuous/common.cfg | 24 +++++++++++++ .kokoro/continuous/java11.cfg | 7 ++++ .kokoro/continuous/java7.cfg | 7 ++++ .kokoro/continuous/java8.cfg | 7 ++++ .kokoro/presubmit/common.cfg | 24 +++++++++++++ .kokoro/presubmit/java11.cfg | 7 ++++ .kokoro/presubmit/java7.cfg | 7 ++++ .kokoro/presubmit/java8.cfg | 7 ++++ .kokoro/release/common.cfg | 49 +++++++++++++++++++++++++++ .kokoro/release/common.sh | 40 ++++++++++++++++++++++ .kokoro/release/drop.cfg | 5 +++ .kokoro/release/drop.sh | 19 +++++++++++ .kokoro/release/promote.cfg | 5 +++ .kokoro/release/promote.sh | 31 +++++++++++++++++ .kokoro/release/publish_javadoc.cfg | 19 +++++++++++ .kokoro/release/publish_javadoc.sh | 52 +++++++++++++++++++++++++++++ .kokoro/release/stage.cfg | 35 +++++++++++++++++++ .kokoro/release/stage.sh | 38 +++++++++++++++++++++ .kokoro/trampoline.sh | 24 +++++++++++++ build.gradle | 3 ++ 22 files changed, 450 insertions(+) create mode 100755 .kokoro/build.sh create mode 100644 .kokoro/common.cfg create mode 100644 .kokoro/continuous/common.cfg create mode 100644 .kokoro/continuous/java11.cfg create mode 100644 .kokoro/continuous/java7.cfg create mode 100644 .kokoro/continuous/java8.cfg create mode 100644 .kokoro/presubmit/common.cfg create mode 100644 .kokoro/presubmit/java11.cfg create mode 100644 .kokoro/presubmit/java7.cfg create mode 100644 .kokoro/presubmit/java8.cfg create mode 100644 .kokoro/release/common.cfg create mode 100755 .kokoro/release/common.sh create mode 100644 .kokoro/release/drop.cfg create mode 100755 .kokoro/release/drop.sh create mode 100644 .kokoro/release/promote.cfg create mode 100755 .kokoro/release/promote.sh create mode 100644 .kokoro/release/publish_javadoc.cfg create mode 100755 .kokoro/release/publish_javadoc.sh create mode 100644 .kokoro/release/stage.cfg create mode 100755 .kokoro/release/stage.sh create mode 100755 .kokoro/trampoline.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 000000000..dad012856 --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,27 @@ +#!/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 + +cd github/api-common-java/ + +# Print out Java +java -version +echo $JOB_TYPE + +./gradlew assemble +./gradlew build install + +bash $KOKORO_GFILE_DIR/codecov.sh diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg new file mode 100644 index 000000000..f10834a28 --- /dev/null +++ b/.kokoro/common.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# All builds use the trampoline script to run in docker. +build_file: "api-common-java/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/api-common-java/.kokoro/build.sh" +} diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 000000000..1c23fa586 --- /dev/null +++ b/.kokoro/continuous/common.cfg @@ -0,0 +1,24 @@ +# 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" + +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 new file mode 100644 index 000000000..709f2b4c7 --- /dev/null +++ b/.kokoro/continuous/java11.cfg @@ -0,0 +1,7 @@ +# 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 new file mode 100644 index 000000000..cb24f44ee --- /dev/null +++ b/.kokoro/continuous/java7.cfg @@ -0,0 +1,7 @@ +# 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 new file mode 100644 index 000000000..3b017fc80 --- /dev/null +++ b/.kokoro/continuous/java8.cfg @@ -0,0 +1,7 @@ +# 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" +} diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg new file mode 100644 index 000000000..1c23fa586 --- /dev/null +++ b/.kokoro/presubmit/common.cfg @@ -0,0 +1,24 @@ +# 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" + +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/java11.cfg b/.kokoro/presubmit/java11.cfg new file mode 100644 index 000000000..709f2b4c7 --- /dev/null +++ b/.kokoro/presubmit/java11.cfg @@ -0,0 +1,7 @@ +# 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 new file mode 100644 index 000000000..cb24f44ee --- /dev/null +++ b/.kokoro/presubmit/java7.cfg @@ -0,0 +1,7 @@ +# 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.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 000000000..3b017fc80 --- /dev/null +++ b/.kokoro/presubmit/java8.cfg @@ -0,0 +1,7 @@ +# 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" +} diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 000000000..c22ce6933 --- /dev/null +++ b/.kokoro/release/common.cfg @@ -0,0 +1,49 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# 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/java8" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-keyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-passphrase" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-pubkeyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "sonatype-credentials" + } + } +} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh new file mode 100755 index 000000000..d5738d430 --- /dev/null +++ b/.kokoro/release/common.sh @@ -0,0 +1,40 @@ +#!/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 + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export GPG_KEY_ID=$(echo -n $(gpg --with-colons ${GPG_HOMEDIR}/pubring.gpg | awk -F':' '/pub/{ print $5 }')) + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_gradle_properties_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 +} diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg new file mode 100644 index 000000000..feb878972 --- /dev/null +++ b/.kokoro/release/drop.cfg @@ -0,0 +1,5 @@ +# 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 new file mode 100755 index 000000000..ce6ae7543 --- /dev/null +++ b/.kokoro/release/drop.sh @@ -0,0 +1,19 @@ +#!/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 new file mode 100644 index 000000000..d69f1d6f2 --- /dev/null +++ b/.kokoro/release/promote.cfg @@ -0,0 +1,5 @@ +# 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 new file mode 100755 index 000000000..2dcfd256d --- /dev/null +++ b/.kokoro/release/promote.sh @@ -0,0 +1,31 @@ +#!/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 new file mode 100644 index 000000000..043f92f13 --- /dev/null +++ b/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto +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 new file mode 100755 index 000000000..09e830704 --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,52 @@ +#!/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/stage.cfg b/.kokoro/release/stage.cfg new file mode 100644 index 000000000..4016988c9 --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,35 @@ +# Format: //devtools/kokoro/config/proto/build.proto + env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/api-common-java/.kokoro/release/stage.sh" +} + +# Fetch the token needed for reporting release status to GitHub +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + } + } +} + +# Fetch magictoken to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "releasetool-magictoken" + } + } +} + +# Fetch api key to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "magic-github-proxy-api-key" + } + } +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh new file mode 100755 index 000000000..f927ce143 --- /dev/null +++ b/.kokoro/release/stage.sh @@ -0,0 +1,38 @@ +#!/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 [[ -n "${AUTORELEASE_PR}" ]] +then + # Start the releasetool reporter + python3 -m pip install gcp-releasetool + python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script +fi + +source $(dirname "$0")/common.sh +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" + +./gradlew assemble uploadArchives + +if [[ -n "${AUTORELEASE_PR}" ]] +then + ./gradlew closeAndReleaseRepository +fi diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh new file mode 100755 index 000000000..3e90f6494 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,24 @@ +#!/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 +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/build.gradle b/build.gradle index 0178b4dbb..5aa3faa66 100644 --- a/build.gradle +++ b/build.gradle @@ -190,6 +190,9 @@ artifacts { signing { required { gradle.taskGraph.hasTask("uploadArchives") } + if (project.hasProperty('signing.gnupg.executable')) { + useGpgCmd() + } sign configurations.archives } From cb7171e7b7b84618324a8f453b1a7d37a27e2d16 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Wed, 11 Dec 2019 18:36:06 -0500 Subject: [PATCH 10/18] update autovalue (#103) * update autovalue * auto value requires Java 8 compiler * give auto_value_annotations compile scope --- .travis.yml | 2 +- build.gradle | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 058f65fc9..2e07a726e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ addons: hostname: fake-hostname-to-work-around-travis-bug jdk: - oraclejdk8 - - openjdk7 + - openjdk8 script: ./gradlew check --info after_success: diff --git a/build.gradle b/build.gradle index 5aa3faa66..29d33638a 100644 --- a/build.gradle +++ b/build.gradle @@ -39,9 +39,10 @@ ext { // Shortcuts for libraries we are using libraries = [ javax_annotations: 'javax.annotation:javax.annotation-api:1.3.2', + auto_value_annotations: 'com.google.auto.value:auto-value-annotations:1.7', + auto_value: 'com.google.auto.value:auto-value:1.7', guava: 'com.google.guava:guava:28.1-android', jsr305: 'com.google.code.findbugs:jsr305:3.0.2', - autovalue: 'com.google.auto.value:auto-value:1.1', error_prone_annotations: 'com.google.errorprone:error_prone_annotations:2.3.3', // Testing @@ -57,12 +58,15 @@ repositories { } dependencies { + + annotationProcessor libraries.auto_value + compile libraries.guava, libraries.jsr305, - libraries.javax_annotations + libraries.javax_annotations, + libraries.auto_value_annotations - compileOnly libraries.autovalue, - libraries.error_prone_annotations + compileOnly libraries.error_prone_annotations testCompile libraries.junit, libraries.mockito, @@ -134,9 +138,8 @@ configurations { } dependencies { - codeGeneration libraries.autovalue, libraries.jsr305 - compile libraries.jsr305 - compileOnly libraries.autovalue + codeGeneration libraries.auto_value, libraries.jsr305 + compile libraries.jsr305, libraries.auto_value_annotations } compileJava.classpath += configurations.codeGeneration From 9538997378c638fd4d38777612a024a0a3501fca Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 19 Feb 2020 22:28:38 +0100 Subject: [PATCH 11/18] Update dependency junit:junit to v4.13 (#105) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 29d33638a..ebfc6d56b 100644 --- a/build.gradle +++ b/build.gradle @@ -46,7 +46,7 @@ ext { error_prone_annotations: 'com.google.errorprone:error_prone_annotations:2.3.3', // Testing - junit: 'junit:junit:4.12', + junit: 'junit:junit:4.13', mockito: 'org.mockito:mockito-core:1.10.19', truth: 'com.google.truth:truth:1.0', ] From c3319b79459fda38cb30f2535fd6c39efee2fae2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 19 Feb 2020 22:29:55 +0100 Subject: [PATCH 12/18] Update dependency com.google.truth:truth to v1.0.1 (#107) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ebfc6d56b..b12fbf172 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ ext { // Testing junit: 'junit:junit:4.13', mockito: 'org.mockito:mockito-core:1.10.19', - truth: 'com.google.truth:truth:1.0', + truth: 'com.google.truth:truth:1.0.1', ] } From c4c1fff02b4d0c2f37f5f1f1c32b94c9db3b76ab Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Wed, 19 Feb 2020 16:38:23 -0500 Subject: [PATCH 13/18] deps: update guava to 28.2 (#110) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index b12fbf172..295c2be43 100644 --- a/build.gradle +++ b/build.gradle @@ -41,7 +41,7 @@ ext { javax_annotations: 'javax.annotation:javax.annotation-api:1.3.2', auto_value_annotations: 'com.google.auto.value:auto-value-annotations:1.7', auto_value: 'com.google.auto.value:auto-value:1.7', - guava: 'com.google.guava:guava:28.1-android', + guava: 'com.google.guava:guava:28.2-android', jsr305: 'com.google.code.findbugs:jsr305:3.0.2', error_prone_annotations: 'com.google.errorprone:error_prone_annotations:2.3.3', From 4848c9cf1cba8b9eb78b5b5ff0260d8326097296 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 24 Feb 2020 16:18:13 +0100 Subject: [PATCH 14/18] chore(deps): update dependency com.google.errorprone:error_prone_annotations to v2.3.4 (#111) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 295c2be43..24e5b0af7 100644 --- a/build.gradle +++ b/build.gradle @@ -43,7 +43,7 @@ ext { auto_value: 'com.google.auto.value:auto-value:1.7', guava: 'com.google.guava:guava:28.2-android', jsr305: 'com.google.code.findbugs:jsr305:3.0.2', - error_prone_annotations: 'com.google.errorprone:error_prone_annotations:2.3.3', + error_prone_annotations: 'com.google.errorprone:error_prone_annotations:2.3.4', // Testing junit: 'junit:junit:4.13', From f125067440b40cadd5d9e857b62da607db9fc9aa Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 24 Feb 2020 16:18:56 +0100 Subject: [PATCH 15/18] Update dependency io.codearte.gradle.nexus:gradle-nexus-staging-plugin to v0.21.2 (#104) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 24e5b0af7..e7220b02b 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { } dependencies { classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.6", - "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.8.0" + "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.21.2" } } From f9320c361eeea642929cec137fece445e27ee374 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 28 Feb 2020 21:23:29 +0100 Subject: [PATCH 16/18] chore(deps): update dependency gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin to v0.8 (#109) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e7220b02b..b4e410765 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { jcenter() } dependencies { - classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.6", + classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.8", "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.21.2" } } From 8d40a11357c3bb614d0442f3b9341e7830830464 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Fri, 13 Mar 2020 11:27:31 -0700 Subject: [PATCH 17/18] feat: add @BetaApi ApiFutures.catchingAsync (#117) Add new ApiFuture.catchingAsync method mirroring ApiFuture.catching, except allowing for an ApiAsyncFunction to be passed instead of ApiFunction. I tried to match the existing signature that allows the callback to return '? extends V' but this does not seem to be possible (see transformAsync). --- .../java/com/google/api/core/ApiFutures.java | 21 +++++++++++++++++++ .../com/google/api/core/ApiFuturesTest.java | 18 ++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/main/java/com/google/api/core/ApiFutures.java b/src/main/java/com/google/api/core/ApiFutures.java index d0638f1f6..d02892619 100644 --- a/src/main/java/com/google/api/core/ApiFutures.java +++ b/src/main/java/com/google/api/core/ApiFutures.java @@ -104,6 +104,27 @@ public static ApiFuture catching( return new ListenableFutureToApiFuture(catchingFuture); } + @BetaApi + public static ApiFuture catchingAsync( + ApiFuture input, + Class exceptionType, + final ApiAsyncFunction callback, + Executor executor) { + ListenableFuture catchingFuture = + Futures.catchingAsync( + listenableFutureForApiFuture(input), + exceptionType, + new AsyncFunction() { + @Override + public ListenableFuture apply(X exception) throws Exception { + ApiFuture result = callback.apply(exception); + return listenableFutureForApiFuture(result); + } + }, + executor); + return new ListenableFutureToApiFuture<>(catchingFuture); + } + public static ApiFuture immediateFuture(V value) { return new ListenableFutureToApiFuture<>(Futures.immediateFuture(value)); } diff --git a/src/test/java/com/google/api/core/ApiFuturesTest.java b/src/test/java/com/google/api/core/ApiFuturesTest.java index eec0fd8f3..de10b7ee8 100644 --- a/src/test/java/com/google/api/core/ApiFuturesTest.java +++ b/src/test/java/com/google/api/core/ApiFuturesTest.java @@ -83,6 +83,24 @@ public Integer apply(Exception ex) { assertThat(fallback.get()).isEqualTo(42); } + @Test + public void testCatchAsync() throws Exception { + SettableApiFuture future = SettableApiFuture.create(); + ApiFuture fallback = + ApiFutures.catchingAsync( + future, + Exception.class, + new ApiAsyncFunction() { + @Override + public ApiFuture apply(Exception ex) { + return ApiFutures.immediateFuture(42); + } + }, + directExecutor()); + future.setException(new Exception()); + assertThat(fallback.get()).isEqualTo(42); + } + @Test public void testTransform() throws Exception { SettableApiFuture inputFuture = SettableApiFuture.create(); From b6e9dadb29dfa124a39857f0784cfd1387d7507e Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Wed, 25 Mar 2020 14:14:21 -0700 Subject: [PATCH 18/18] chore: release v1.9.0 (#118) --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 4df9f77d1..f8e233b27 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.8.2-SNAPSHOT +1.9.0