Add a GCB job to build and publish javadoc (#609)

This commit is contained in:
Lai Jiang 2020-06-05 13:00:15 -04:00 committed by GitHub
parent 5a1f3d0376
commit da65a38782
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 3 deletions

View file

@ -458,6 +458,7 @@ task javadoc(type: Javadoc) {
source javadocSource source javadocSource
classpath = files(javadocClasspath) classpath = files(javadocClasspath)
destinationDir = file("${buildDir}/docs/javadoc") destinationDir = file("${buildDir}/docs/javadoc")
options.encoding = "UTF-8"
// In a lot of places we don't write @return so suppress warnings about that. // In a lot of places we don't write @return so suppress warnings about that.
options.addBooleanOption('Xdoclint:all,-missing', true) options.addBooleanOption('Xdoclint:all,-missing', true)
options.addBooleanOption("-allow-script-in-comments",true) options.addBooleanOption("-allow-script-in-comments",true)
@ -467,4 +468,4 @@ task javadoc(type: Javadoc) {
tasks.build.dependsOn(tasks.javadoc) tasks.build.dependsOn(tasks.javadoc)
javadocDependentTasks.each { tasks.javadoc.shouldRunAfter(it) } javadocDependentTasks.each { tasks.javadoc.dependsOn(it) }

View file

@ -0,0 +1,30 @@
# To run the build locally, install cloud-build-local first.
# See: https://cloud.google.com/cloud-build/docs/build-debug-locally
# In the root of a nomulus source tree, run:
# cloud-build-local --config=cloudbuild-javadoc.yaml --dryrun=false ..
#
# This will compile javadoc for the FOSS version of the code base and replace
# the content at gs://${PROJECT_ID}-javadoc with the it. The compiled javadoc
# can then be accesssed at https://storage.googleapis.com/${PROJECT_ID}-javadoc
#
# To manually trigger a build on GCB, run:
# gcloud builds submit --config cloudbuild-javadoc.yaml ..
#
# To trigger a build automatically, follow the instructions below and add a trigger:
# https://cloud.google.com/cloud-build/docs/running-builds/automate-builds
steps:
# Compile javadoc
- name: 'gcr.io/${PROJECT_ID}/builder'
entrypoint: /bin/bash
args: ['./gradlew,', ':javadoc']
# Upload the files to GCS
# We don't use GCB's built-in artifacts uploader because we want to delete
# the existing files in the bucket first, and we want to parallelize the
# uploading process.
- name: 'gcr.io/${PROJECT_ID}/builder'
entrypoint: /bin/bash
args: ['gsutil', '-m', 'rsync', '-d', '-r', 'build/docs/javadoc', 'gs://${PROJECT_ID}-javadoc']
timeout: 3600s
options:
machineType: 'N1_HIGHCPU_8'

View file

@ -2,13 +2,13 @@
# See: https://cloud.google.com/cloud-build/docs/build-debug-locally # See: https://cloud.google.com/cloud-build/docs/build-debug-locally
# In the root of a nomulus source tree, run: # In the root of a nomulus source tree, run:
# cloud-build-local --config=cloudbuild-kythe.yaml --dryrun=false \ # cloud-build-local --config=cloudbuild-kythe.yaml --dryrun=false \
# --substitutions _KYTHE_VERSION=[kythe_version],COMMIT_HASH=[hash] . # --substitutions _KYTHE_VERSION=[kythe_version],COMMIT_SHA=[hash] ..
# This will download kythe version ${kythe_version} (must be higher than # This will download kythe version ${kythe_version} (must be higher than
# v0.0.39 and build a ${hash}.kzip file for Kythe to enable cross referencing. # v0.0.39 and build a ${hash}.kzip file for Kythe to enable cross referencing.
# #
# To manually trigger a build on GCB, run: # To manually trigger a build on GCB, run:
# gcloud builds submit --config cloudbuild-kythe.yaml --substitutions \ # gcloud builds submit --config cloudbuild-kythe.yaml --substitutions \
# _KYTHE_VERSION[kythe_version] . # _KYTHE_VERSION=[kythe_version] ..
# #
# To trigger a build automatically, follow the instructions below and add a trigger: # To trigger a build automatically, follow the instructions below and add a trigger:
# https://cloud.google.com/cloud-build/docs/running-builds/automate-builds # https://cloud.google.com/cloud-build/docs/running-builds/automate-builds