bazel: update for elasticsearch and lucene.

Change-Id: Icb9f9f0344b10a008d5b353362933890446eb544
This commit is contained in:
Han-Wen Nienhuys 2016-09-28 19:59:08 +02:00 committed by David Ostrovsky
parent c9be186e0a
commit 5e4491886b
13 changed files with 440 additions and 1 deletions

2
BUILD
View File

@ -10,4 +10,4 @@ genrule(
pkg_war(name = 'gerrit')
pkg_war(name = 'headless', ui = None)
pkg_war(name = 'release', ui = 'ui_optdbg_r', context = ['//plugins:core'])
#pkg_war(name = 'release', ui = 'ui_optdbg_r', context = ['//plugins:core'])

157
WORKSPACE
View File

@ -317,6 +317,12 @@ maven_jar(
sha1 = '0ce1edb914c94ebc388f086c6827e8bdeec71ac2',
)
maven_jar(
name = 'commons_lang3',
artifact = 'org.apache.commons:commons-lang3:3.3.2',
sha1 = '90a3822c38ec8c996e84c16a3477ef632cbc87a3',
)
maven_jar(
name = 'commons_dbcp',
artifact = 'commons-dbcp:commons-dbcp:1.4',
@ -429,6 +435,13 @@ maven_jar(
sha1 = 'f0bc3114a6b43f8e64a33c471d5b9e8ddc51564d',
)
maven_jar(
name = 'lucene_codecs',
artifact = 'org.apache.lucene:lucene-codecs:' + LUCENE_VERS,
sha1 = 'e01fe463d9490bb1b4a6a168e771f7b7255a50b1',
)
maven_jar(
name = 'backward_codecs',
artifact = 'org.apache.lucene:lucene-backward-codecs:' + LUCENE_VERS,
@ -447,6 +460,55 @@ maven_jar(
sha1 = '8ac921563e744463605284c6d9d2d95e1be5b87c',
)
maven_jar(
name = 'lucene_highlighter',
artifact = 'org.apache.lucene:lucene-highlighter:' + LUCENE_VERS,
sha1 = 'd127ac514e9df965ab0b57d92bbe0c68d3d145b8',
)
maven_jar(
name = 'lucene_join',
artifact = 'org.apache.lucene:lucene-join:'+ LUCENE_VERS,
sha1 = 'dac1b322508f3f2696ecc49a97311d34d8382054',
)
maven_jar(
name = 'lucene_memory',
artifact = 'org.apache.lucene:lucene-memory:' + LUCENE_VERS,
sha1 = '7409db9863d8fbc265c27793c6cc7511304182c2',
)
maven_jar(
name = 'lucene_misc',
artifact = 'org.apache.lucene:lucene-misc:' + LUCENE_VERS,
sha1 = '37bbe5a2fb429499dfbe75d750d1778881fff45d',
)
maven_jar(
name = 'lucene_sandbox',
artifact = 'org.apache.lucene:lucene-sandbox:' + LUCENE_VERS,
sha1 = '30a91f120706ba66732d5a974b56c6971b3c8a16',
)
maven_jar(
name = 'lucene_spatial',
artifact = 'org.apache.lucene:lucene-spatial:' + LUCENE_VERS,
sha1 = '8ed7a9a43d78222038573dd1c295a61f3c0bb0db',
)
maven_jar(
name = 'lucene_suggest',
artifact = 'org.apache.lucene:lucene-suggest:' + LUCENE_VERS,
sha1 = 'e8316b37dddcf2092a54dab2ce6aad0d5ad78585',
)
maven_jar(
name = 'lucene_queries',
artifact = 'org.apache.lucene:lucene-queries:' + LUCENE_VERS,
sha1 = '692f1ad887cf4e006a23f45019e6de30f3312d3f',
)
maven_jar(
name = 'mime_util',
artifact = 'eu.medsea.mimeutil:mime-util:2.1.3',
@ -798,3 +860,98 @@ maven_jar(
artifact = "org.jruby:jruby-complete:9.1.5.0",
sha1 = "00d0003e99da3c4d830b12c099691ce910c84e39",
)
maven_jar(
name = 'elasticsearch',
artifact = 'org.elasticsearch:elasticsearch:2.4.0',
sha1 = 'aeb9704a76fa8654c348f38fcbb993a952a7ab07',
)
# Java REST client for Elasticsearch.
ELASTIC_VERSION = '0.1.7'
maven_jar(
name = 'jest_common',
artifact = 'io.searchbox:jest-common:' + ELASTIC_VERSION,
sha1 = 'ff6e2694405557a3a02b444cb7f7da28c4d99f07',
)
maven_jar(
name = 'jest',
artifact = 'io.searchbox:jest:' + ELASTIC_VERSION,
sha1 = '686619c7141edb50b562ad2a39d32ea4cf20b567',
)
maven_jar(
name = 'compress_lzf',
artifact = 'com.ning:compress-lzf:1.0.2',
sha1 = '62896e6fca184c79cc01a14d143f3ae2b4f4b4ae',
)
maven_jar(
name = 'hppc',
artifact = 'com.carrotsearch:hppc:0.7.1',
sha1 = '8b5057f74ea378c0150a1860874a3ebdcb713767',
)
maven_jar(
name = 'jsr166e',
artifact = 'com.twitter:jsr166e:1.1.0',
sha1 = '233098147123ee5ddcd39ffc57ff648be4b7e5b2',
)
maven_jar(
name = 'netty',
artifact = 'io.netty:netty:3.10.0.Final',
sha1 = 'ad61cd1bba067e6634ddd3e160edf0727391ac30',
)
maven_jar(
name = 't_digest',
artifact = 'com.tdunning:t-digest:3.0',
sha1 = '84ccf145ac2215e6bfa63baa3101c0af41017cfc',
)
maven_jar(
name = 'jna',
artifact = 'net.java.dev.jna:jna:4.1.0',
sha1 = '1c12d070e602efd8021891cdd7fd18bc129372d4',
)
JACKSON_VERSION = '2.6.6'
maven_jar(
name = 'jackson_core',
artifact = 'com.fasterxml.jackson.core:jackson-core:' + JACKSON_VERSION,
sha1 = '02eb801df67aacaf5b1deb4ac626e1964508e47b',
)
maven_jar(
name = 'jackson_dataformat_smile',
artifact = 'com.fasterxml.jackson.dataformat:jackson-dataformat-smile:' + JACKSON_VERSION,
sha1 = 'ccbfc948748ed2754a58c1af9e0a02b5cc1aed69',
)
maven_jar(
name = 'jackson_dataformat_cbor',
artifact = 'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:' + JACKSON_VERSION,
sha1 = '34c7b7ff495fc6b049612bdc9db0900a68e112f8',
)
maven_jar(
name = 'httpasyncclient',
artifact = 'org.apache.httpcomponents:httpasyncclient:4.1.2',
sha1 = '95aa3e6fb520191a0970a73cf09f62948ee614be',
)
maven_jar(
name = 'httpcore_nio',
artifact = 'org.apache.httpcomponents:httpcore-nio:' + HTTPCOMP_VERS,
sha1 = 'a8c5e3c3bfea5ce23fb647c335897e415eb442e3',
)
maven_jar(
name = 'httpcore_niossl',
artifact = 'org.apache.httpcomponents:httpcore-niossl:4.0-alpha6',
sha1 = '9c662e7247ca8ceb1de5de629f685c9ef3e4ab58',
)

View File

@ -0,0 +1,53 @@
java_library(
name = 'elasticsearch',
srcs = glob(['src/main/java/**/*.java']),
deps = [
'//gerrit-antlr:query_exception',
'//gerrit-extension-api:api',
'//gerrit-lucene:lucene', # only for LuceneAccountIndex
'//gerrit-reviewdb:client',
'//gerrit-reviewdb:server',
'//gerrit-server:server',
'//gerrit-index:index',
'//lib:gson',
'//lib:guava',
'//lib:gwtorm',
'//lib:protobuf',
'//lib/commons:codec',
'//lib/commons:lang',
'//lib/elasticsearch:elasticsearch',
'//lib/elasticsearch:jest',
'//lib/elasticsearch:jest-common',
'//lib/guice:guice',
'//lib/guice:guice-assistedinject',
'//lib/jgit/org.eclipse.jgit:jgit',
'//lib/joda:joda-time',
'//lib/log:api',
'//lib/lucene:lucene-analyzers-common',
'//lib/lucene:lucene-core',
],
visibility = ['//visibility:public'],
)
load('//tools/bzl:junit.bzl', 'junit_tests')
junit_tests(
name = 'elasticsearch_tests',
tags = ['elastic'],
srcs = glob(['src/test/java/**/*.java']),
deps = [
':elasticsearch',
'//gerrit-extension-api:api',
'//gerrit-server:server',
'//gerrit-server:testutil',
'//gerrit-server:query_tests_code',
'//lib:gson',
'//lib:guava',
'//lib:junit',
'//lib:truth',
'//lib/elasticsearch:elasticsearch',
'//lib/guice:guice',
'//lib/jgit/org.eclipse.jgit:jgit',
'//lib/jgit/org.eclipse.jgit.junit:junit',
],
)

13
gerrit-index/BUILD Normal file
View File

@ -0,0 +1,13 @@
java_library(
name = 'index',
srcs = glob(['src/main/java/**/*.java']),
deps = [
'//gerrit-extension-api:api',
'//gerrit-server:server',
'//gerrit-patch-jgit:server',
'//lib/guice:guice',
'//lib/jgit/org.eclipse.jgit:jgit',
'//lib:guava',
],
visibility = ['//visibility:public'],
)

View File

@ -25,6 +25,7 @@ java_library(
'//gerrit-common:annotations',
'//gerrit-common:server',
'//gerrit-extension-api:api',
'//gerrit-index:index',
'//gerrit-reviewdb:server',
'//gerrit-server:server',
'//lib:guava',

View File

@ -45,6 +45,7 @@ java_library(
':init-api',
':util',
'//gerrit-common:annotations',
'//gerrit-index:index',
'//gerrit-launcher:launcher', # We want this dep to be provided_deps
'//gerrit-lucene:lucene',
'//lib:args4j',
@ -110,6 +111,7 @@ REST_PGM_DEPS = [
':init-api',
':util',
'//gerrit-cache-h2:cache-h2',
'//gerrit-elasticsearch:elasticsearch',
'//gerrit-gpg:gpg',
'//gerrit-lucene:lucene',
'//gerrit-oauth:oauth',

View File

@ -169,6 +169,20 @@ QUERY_TESTS = glob(
['src/test/java/com/google/gerrit/server/query/**/*.java'],
)
java_library(
name = 'query_tests_code',
srcs = QUERY_TESTS,
deps = TESTUTIL_DEPS + [
':testutil',
'//gerrit-antlr:query_exception',
'//gerrit-antlr:query_parser',
'//gerrit-common:annotations',
'//gerrit-server/src/main/prolog:common',
'//lib/antlr:java_runtime',
],
visibility = ['//visibility:public'],
)
junit_tests(
name = 'query_tests',
srcs = QUERY_TESTS,

View File

@ -5,6 +5,7 @@ java_library(
srcs = glob(['src/main/java/**/*.java']),
deps = [
'//gerrit-cache-h2:cache-h2',
'//gerrit-elasticsearch:elasticsearch',
'//gerrit-extension-api:api',
'//gerrit-gpg:gpg',
'//gerrit-httpd:httpd',

View File

@ -1,3 +1,5 @@
package(default_visibility = ['//visibility:public'])
java_library(
name = 'codec',
exports = ['@commons_codec//jar'],
@ -26,6 +28,12 @@ java_library(
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'lang3',
exports = [ '@commons_lang3//jar'],
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'net',
exports = ['@commons_net//jar'],

92
lib/elasticsearch/BUILD Normal file
View File

@ -0,0 +1,92 @@
package(default_visibility=['//visibility:public'])
java_library(
name = 'elasticsearch',
data = [ '//lib:LICENSE-Apache2.0' ],
exports = [ '@elasticsearch//jar' ],
runtime_deps = [
':jna',
':hppc',
':jsr166e',
':netty',
':t-digest',
':compress-lzf',
'//lib/joda:joda-time',
'//lib/lucene:lucene-codecs',
'//lib/lucene:lucene-highlighter',
'//lib/lucene:lucene-join',
'//lib/lucene:lucene-memory',
'//lib/lucene:lucene-sandbox',
'//lib/lucene:lucene-suggest',
'//lib/lucene:lucene-queries',
'//lib/lucene:lucene-spatial',
'//lib/jackson:jackson-core',
'//lib/jackson:jackson-dataformat-cbor',
'//lib/jackson:jackson-dataformat-smile',
]
)
# Java REST client for Elasticsearch.
VERSION = '0.1.7'
java_library(
name = 'jest-common',
exports = [ '@jest_common//jar' ],
data = [ '//lib:LICENSE-Apache2.0' ],
)
java_library(
name = 'jest',
exports = [ '@jest//jar' ],
data = [ '//lib:LICENSE-Apache2.0' ],
runtime_deps = [
':elasticsearch',
':jest-common',
'//lib/commons:lang3',
'//lib/httpcomponents:httpasyncclient',
'//lib/httpcomponents:httpclient',
'//lib/httpcomponents:httpcore-nio',
'//lib/httpcomponents:httpcore-niossl',
],
)
java_library(
name = 'compress-lzf',
exports = [ '@compress_lzf//jar' ],
data = [ '//lib:LICENSE-Apache2.0' ],
visibility = ['//lib/elasticsearch:__pkg__'],
)
java_library(
name = 'hppc',
exports = [ '@hppc//jar' ],
data = [ '//lib:LICENSE-Apache2.0' ],
visibility = ['//lib/elasticsearch:__pkg__'],
)
java_library(
name = 'jsr166e',
exports = [ '@jsr166e//jar' ],
data = [ '//lib:LICENSE-Apache2.0' ],
visibility = ['//lib/elasticsearch:__pkg__'],
)
java_library(
name = 'netty',
exports = [ '@netty//jar' ],
data = [ '//lib:LICENSE-Apache2.0' ],
visibility = ['//lib/elasticsearch:__pkg__'],
)
java_library(
name = 't-digest',
exports = [ '@t_digest//jar' ],
data = [ '//lib:LICENSE-Apache2.0' ],
visibility = ['//lib/elasticsearch:__pkg__'],
)
java_library(
name = 'jna',
exports = [ '@jna//jar' ],
data = [ '//lib:LICENSE-Apache2.0' ],
)

View File

@ -1,3 +1,5 @@
package(default_visibility = ['//visibility:public'])
java_library(
name = 'fluent-hc',
exports = ['@fluent_hc//jar'],
@ -31,3 +33,21 @@ java_library(
visibility = ['//visibility:public'],
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'httpasyncclient',
exports = [ '@httpasyncclient//jar' ],
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'httpcore-nio',
exports = [ '@httpcore_nio//jar' ],
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'httpcore-niossl',
exports = ['@httpcore_niossl//jar'],
data = ['//lib:LICENSE-Apache2.0'],
)

21
lib/jackson/BUILD Normal file
View File

@ -0,0 +1,21 @@
package(default_visibility = [ "//visibility:public"])
VERSION = '2.6.6'
java_library(
name = 'jackson-core',
exports = [ '@jackson_core//jar' ],
data = [ '//lib:LICENSE-Apache2.0' ],
)
java_library(
name = 'jackson-dataformat-smile',
exports = [ '@jackson_dataformat_smile//jar' ],
data = [ '//lib:LICENSE-Apache2.0' ],
)
java_library(
name = 'jackson-dataformat-cbor',
exports = [ '@jackson_dataformat_cbor//jar' ],
data = [ '//lib:LICENSE-Apache2.0' ],
)

View File

@ -1,3 +1,4 @@
package(default_visibility = [ "//visibility:public"])
load('//tools/bzl:maven.bzl', 'merge_maven_jars')
# core and backward-codecs both provide
@ -20,6 +21,20 @@ java_library(
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'lucene-codecs',
exports = ['@lucene_codecs//jar'],
visibility = ['//visibility:public'],
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'lucene-core',
exports = ['@lucene_core//jar'],
visibility = ['//visibility:public'],
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'lucene-misc',
exports = ['@lucene_misc//jar'],
@ -35,3 +50,45 @@ java_library(
visibility = ['//visibility:public'],
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'lucene-highlighter',
exports = [ '@lucene_highlighter//jar' ],
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'lucene-join',
exports = [ '@lucene_join//jar' ],
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'lucene-memory',
exports = [ '@lucene_memory//jar' ],
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'lucene-sandbox',
exports = [ '@lucene_sandbox//jar' ],
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'lucene-spatial',
exports = [ '@lucene_spatial//jar' ],
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'lucene-suggest',
exports = [ '@lucene_suggest//jar' ],
data = ['//lib:LICENSE-Apache2.0'],
)
java_library(
name = 'lucene-queries',
exports = [ '@lucene_queries//jar' ],
data = ['//lib:LICENSE-Apache2.0'],
)