Skip to content

Commit

Permalink
Add publish javadoc kokoro job (#631)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
chingor13 authored Apr 25, 2019
1 parent b6f3755 commit 149b6c3
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 7 deletions.
19 changes: 19 additions & 0 deletions .kokoro/release/publish_javadoc.cfg
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
55 changes: 55 additions & 0 deletions .kokoro/release/publish_javadoc.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion google-http-client-apache-legacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<configuration>
<links>
<link>https://download.oracle.com/javase/7/docs/api/</link>
<link>https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}/documentation</link>
<link>https://jar-download.com/javaDoc/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}</link>
</links>
<doctitle>${project.name} ${project.version}</doctitle>
<windowtitle>${project.artifactId} ${project.version}</windowtitle>
Expand Down
12 changes: 12 additions & 0 deletions google-http-client-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
2 changes: 1 addition & 1 deletion google-http-client-gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<configuration>
<links>
<link>http://download.oracle.com/javase/7/docs/api/</link>
<link>https://www.javadoc.io/doc/com.google.code.gson/gson/${project.gson.version}</link>
<link>https://static.javadoc.io/com.google.code.gson/gson/${project.gson.version}</link>
</links>
<doctitle>${project.name} ${project.version}</doctitle>
<windowtitle>${project.artifactId} ${project.version}</windowtitle>
Expand Down
2 changes: 1 addition & 1 deletion google-http-client-jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<configuration>
<links>
<link>http://download.oracle.com/javase/7/docs/api/</link>
<link>https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}/documentation</link>
<link>https://jar-download.com/javaDoc/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}</link>
</links>
<doctitle>${project.name} ${project.version}</doctitle>
<windowtitle>${project.artifactId} ${project.version}</windowtitle>
Expand Down
14 changes: 10 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down Expand Up @@ -357,7 +357,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.7</version>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down Expand Up @@ -385,6 +390,7 @@
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<doclint>none</doclint>
<source>7</source>
</configuration>
<executions>
<execution>
Expand All @@ -397,9 +403,9 @@
<links>
<link>http://download.oracle.com/javase/7/docs/api/</link>
<link>http://cloud.google.com/appengine/docs/java/javadoc</link>
<link>https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}/documentation</link>
<link>https://jar-download.com/javaDoc/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}</link>
<link>http://fasterxml.github.com/jackson-core/javadoc/${project.jackson-core2.version}/</link>
<link>https://www.javadoc.io/doc/com.google.code.gson/gson/${project.gson.version}</link>
<link>https://static.javadoc.io/doc/com.google.code.gson/gson/${project.gson.version}</link>
<link>https://google.github.io/guava/releases/${project.guava.version}/api/docs/</link>
</links>
<doctitle>Google HTTP Client Library for Java ${project.version}</doctitle>
Expand Down

0 comments on commit 149b6c3

Please sign in to comment.