From 149b6c3f5cbcff7f51edfdf550d739746cb69630 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 25 Apr 2019 11:31:19 -0700 Subject: [PATCH] Add publish javadoc kokoro job (#631) * Add publish javadoc kokoro job * Update maven-javadoc-plugin * Add source config for maven-javadoc-plugin * Fix gson hosted javadoc location * Update maven-site-plugin and skip site generation for bom artifact * we don't need to stage the site as we're aggregating * Fix url for jackson-core-asl javadocs --- .kokoro/release/publish_javadoc.cfg | 19 ++++++++ .kokoro/release/publish_javadoc.sh | 55 ++++++++++++++++++++++++ google-http-client-apache-legacy/pom.xml | 2 +- google-http-client-bom/pom.xml | 12 ++++++ google-http-client-gson/pom.xml | 2 +- google-http-client-jackson/pom.xml | 2 +- pom.xml | 14 ++++-- 7 files changed, 99 insertions(+), 7 deletions(-) create mode 100644 .kokoro/release/publish_javadoc.cfg create mode 100755 .kokoro/release/publish_javadoc.sh diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 000000000..fabf592e2 --- /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/google-http-java-client/.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..b65eb9f90 --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,55 @@ +#!/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 + +# compile all packages +mvn clean install -B -DskipTests=true + +NAME=google-http-client +VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B + +pushd target/site/apidocs + +# 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/google-http-client-apache-legacy/pom.xml b/google-http-client-apache-legacy/pom.xml index 405953bdb..1545c6257 100644 --- a/google-http-client-apache-legacy/pom.xml +++ b/google-http-client-apache-legacy/pom.xml @@ -18,7 +18,7 @@ https://download.oracle.com/javase/7/docs/api/ - https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}/documentation + https://jar-download.com/javaDoc/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version} ${project.name} ${project.version} ${project.artifactId} ${project.version} diff --git a/google-http-client-bom/pom.xml b/google-http-client-bom/pom.xml index 2b4287634..ec6bd9deb 100644 --- a/google-http-client-bom/pom.xml +++ b/google-http-client-bom/pom.xml @@ -130,6 +130,18 @@ false + + maven-javadoc-plugin + + true + + + + maven-site-plugin + + true + + diff --git a/google-http-client-gson/pom.xml b/google-http-client-gson/pom.xml index 48a134233..4c810993d 100644 --- a/google-http-client-gson/pom.xml +++ b/google-http-client-gson/pom.xml @@ -18,7 +18,7 @@ http://download.oracle.com/javase/7/docs/api/ - https://www.javadoc.io/doc/com.google.code.gson/gson/${project.gson.version} + https://static.javadoc.io/com.google.code.gson/gson/${project.gson.version} ${project.name} ${project.version} ${project.artifactId} ${project.version} diff --git a/google-http-client-jackson/pom.xml b/google-http-client-jackson/pom.xml index fdeb9c22d..731ecc527 100644 --- a/google-http-client-jackson/pom.xml +++ b/google-http-client-jackson/pom.xml @@ -18,7 +18,7 @@ http://download.oracle.com/javase/7/docs/api/ - https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}/documentation + https://jar-download.com/javaDoc/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version} ${project.name} ${project.version} ${project.artifactId} ${project.version} diff --git a/pom.xml b/pom.xml index 2fea3c146..c8175302d 100644 --- a/pom.xml +++ b/pom.xml @@ -304,7 +304,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.0.1 + 3.1.0 attach-javadocs @@ -357,7 +357,12 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 2.7 + 3.0.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 @@ -385,6 +390,7 @@ maven-javadoc-plugin none + 7 @@ -397,9 +403,9 @@ http://download.oracle.com/javase/7/docs/api/ http://cloud.google.com/appengine/docs/java/javadoc - https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}/documentation + https://jar-download.com/javaDoc/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version} http://fasterxml.github.com/jackson-core/javadoc/${project.jackson-core2.version}/ - https://www.javadoc.io/doc/com.google.code.gson/gson/${project.gson.version} + https://static.javadoc.io/doc/com.google.code.gson/gson/${project.gson.version} https://google.github.io/guava/releases/${project.guava.version}/api/docs/ Google HTTP Client Library for Java ${project.version}