Allow to share guava definitions between buck and bazel builds

Move the definitions of GUAVA_VERSION and GUAVA_DOC_URL into a
separate .bzl file, and add GUAVA_BIN_SHA1. Modify the existing
GUAVA_VERSION file to include the new .bzl file.

This allows to reuse the same values in both the buck and bazel
builds, and when we update Guava we only need to modify one file.

Update the bazel build of the extension API to include the Guava
Javadoc URL in the javadoc rule.

Change-Id: I7895ceb761d609d79d3b80a271e6bd7425c17e2b
This commit is contained in:
David Pursehouse 2016-10-26 08:42:25 +09:00
parent bc1062f2b6
commit 5eaed62346
5 changed files with 11 additions and 6 deletions

View File

@ -221,10 +221,12 @@ maven_jar(
sha1 = '675642ac208e0b741bc9118dcbcae44c271b992a',
)
load('//lib:guava.bzl', 'GUAVA_VERSION', 'GUAVA_BIN_SHA1')
maven_jar(
name = 'guava',
artifact = 'com.google.guava:guava:20.0-rc1',
sha1 = '4c2a4581b69b16a57968da32fcadb8e362b639b2',
artifact = 'com.google.guava:guava:' + GUAVA_VERSION,
sha1 = GUAVA_BIN_SHA1,
)
maven_jar(

View File

@ -1,3 +1,4 @@
load('//lib:guava.bzl', 'GUAVA_DOC_URL')
load('//lib/jgit:jgit.bzl', 'JGIT_DOC_URL')
load('//tools/bzl:gwt.bzl', 'gwt_module')
@ -53,5 +54,5 @@ java_doc(
title = 'Gerrit Review Extension API Documentation',
libs = [':api'],
pkgs = ['com.google.gerrit.extensions'],
external_docs = [JGIT_DOC_URL],
external_docs = [JGIT_DOC_URL, GUAVA_DOC_URL],
)

View File

@ -70,7 +70,7 @@ maven_jar(
maven_jar(
name = 'guava',
id = 'com.google.guava:guava:' + GUAVA_VERSION,
sha1 = '4c2a4581b69b16a57968da32fcadb8e362b639b2',
sha1 = GUAVA_BIN_SHA1,
license = 'Apache2.0',
)

View File

@ -1,2 +1 @@
GUAVA_VERSION = '20.0-rc1'
GUAVA_DOC_URL = 'https://google.github.io/guava/releases/' + GUAVA_VERSION + '/api/docs/'
include_defs('//lib/guava.bzl')

3
lib/guava.bzl Normal file
View File

@ -0,0 +1,3 @@
GUAVA_VERSION = '20.0-rc1'
GUAVA_BIN_SHA1 = '4c2a4581b69b16a57968da32fcadb8e362b639b2'
GUAVA_DOC_URL = 'https://google.github.io/guava/releases/' + GUAVA_VERSION + '/api/docs/'