Move AsciiDoctor Java files to a java package

These classes are authored by the Gerrit project, so let's give them a
Gerrit package name and put them in the normal java/... hierarchy.

Change-Id: I7b681fdd64e3ab96e073c91f8e16597704c85154
This commit is contained in:
Dave Borowitz 2018-05-24 15:24:41 -04:00
parent 90163dec7c
commit 90135c1b88
7 changed files with 49 additions and 47 deletions

View File

@ -71,13 +71,13 @@ genrule(
name = "index",
srcs = SRCS,
outs = ["index.jar"],
cmd = "$(location //lib/asciidoctor:doc_indexer) " +
cmd = "$(location //java/com/google/gerrit/asciidoctor:doc_indexer) " +
"-o $(OUTS) " +
"--prefix \"%s/\" " % DOC_DIR +
"--in-ext \".txt\" " +
"--out-ext \".html\" " +
"$(SRCS)",
tools = ["//lib/asciidoctor:doc_indexer"],
tools = ["//java/com/google/gerrit/asciidoctor:doc_indexer"],
)
# For the same srcs, we can have multiple genasciidoc_zip rules, but only one

View File

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.asciidoctor;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.io.ByteStreams;

View File

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

View File

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.asciidoctor;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.gerrit.server.documentation.Constants;

View File

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

View File

@ -103,7 +103,7 @@ def _asciidoc_impl(ctx):
_asciidoc_attrs = {
"_exe": attr.label(
default = Label("//lib/asciidoctor:asciidoc"),
default = Label("//java/com/google/gerrit/asciidoctor:asciidoc"),
cfg = "host",
allow_files = True,
executable = True,

View File

@ -18,8 +18,8 @@ DEPS = [
"//gerrit-plugin-gwtui:gwtui-api-lib",
"//java/com/google/gerrit/acceptance:lib",
"//java/com/google/gerrit/server",
"//lib/asciidoctor:asciidoc_lib",
"//lib/asciidoctor:doc_indexer_lib",
"//java/com/google/gerrit/asciidoctor:asciidoc_lib",
"//java/com/google/gerrit/asciidoctor:doc_indexer_lib",
"//lib/auto:auto-value",
"//lib/gwt:ant",
"//lib/gwt:colt",