Port doc_indexer to bazel

Also, bump jruby-complete in BUCK to the same version (9.1.5.0).

Change-Id: I67b6c74680faf2630afb965b81d71026029d5385
This commit is contained in:
Yuxuan 'fishy' Wang 2016-09-27 06:05:06 +08:00
parent 9d0e8eac3b
commit dd6f8dd2f1
4 changed files with 81 additions and 2 deletions

View File

@ -9,3 +9,23 @@ license_map(
],
opts = ["--asciidoctor"],
)
DOC_DIR = "Documentation"
SRCS = glob(["*.txt"])
genrule(
name = "index",
cmd = "$(location //lib/asciidoctor:doc_indexer) " +
"-o $(OUTS) " +
'--prefix "%s/" ' % DOC_DIR +
'--in-ext ".txt" ' +
'--out-ext ".html" ' +
"$(SRCS) " +
"$(location :licenses.txt)",
tools = [
":licenses.txt",
"//lib/asciidoctor:doc_indexer",
],
srcs = SRCS,
outs = ["index.jar"],
)

View File

@ -786,3 +786,15 @@ maven_jar(
artifact = 'commons-io:commons-io:1.4',
sha1 = 'a8762d07e76cfde2395257a5da47ba7c1dbd3dce',
)
maven_jar(
name = "asciidoctor",
artifact = "org.asciidoctor:asciidoctorj:1.5.4.1",
sha1 = "f7ddfb2bbed2f8da3f9ad0d1a5514f04b4274a5a",
)
maven_jar(
name = "jruby",
artifact = "org.jruby:jruby-complete:9.1.5.0",
sha1 = "00d0003e99da3c4d830b12c099691ce910c84e39",
)

View File

@ -53,8 +53,8 @@ maven_jar(
maven_jar(
name = 'jruby',
id = 'org.jruby:jruby-complete:1.7.25',
sha1 = '8eb234259ec88edc05eedab05655f458a84bfcab',
id = 'org.jruby:jruby-complete:9.1.5.0',
sha1 = '00d0003e99da3c4d830b12c099691ce910c84e39',
license = 'DO_NOT_DISTRIBUTE',
visibility = [],
attach_source = False,

47
lib/asciidoctor/BUILD Normal file
View File

@ -0,0 +1,47 @@
java_library(
name = "asciidoc_lib",
srcs = ["java/AsciiDoctor.java"],
deps = [
":asciidoctor",
"//lib:args4j",
"//lib:guava",
"//lib/log:api",
"//lib/log:nop",
],
visibility = ["//visibility:public"],
)
java_binary(
name = "doc_indexer",
main_class = "DocIndexer",
runtime_deps = [":doc_indexer_lib"],
visibility = ["//visibility:public"],
)
java_library(
name = "doc_indexer_lib",
srcs = ["java/DocIndexer.java"],
deps = [
":asciidoc_lib",
"//gerrit-server:constants",
"//lib:args4j",
"//lib:guava",
"//lib/lucene:lucene-analyzers-common",
"//lib/lucene:lucene-core-and-backward-codecs",
],
visibility = ["//visibility:public"],
)
java_library(
name = "asciidoctor",
exports = ["@asciidoctor//jar"],
runtime_deps = [":jruby"],
visibility = ["//visibility:public"],
data = ["//lib:LICENSE-asciidoctor"],
)
java_library(
name = "jruby",
exports = ["@jruby//jar"],
data = ["//lib:LICENSE-DO_NOT_DISTRIBUTE"],
)