From 90135c1b884ac9c92da7d60ede162946db2eecd1 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Thu, 24 May 2018 15:24:41 -0400 Subject: [PATCH] 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 --- Documentation/BUILD | 4 +- .../gerrit/asciidoctor}/AsciiDoctor.java | 2 + java/com/google/gerrit/asciidoctor/BUILD | 39 +++++++++++++++++ .../gerrit/asciidoctor}/DocIndexer.java | 2 + lib/asciidoctor/BUILD | 43 +------------------ tools/bzl/asciidoc.bzl | 2 +- tools/eclipse/BUILD | 4 +- 7 files changed, 49 insertions(+), 47 deletions(-) rename {lib/asciidoctor/java => java/com/google/gerrit/asciidoctor}/AsciiDoctor.java (99%) create mode 100644 java/com/google/gerrit/asciidoctor/BUILD rename {lib/asciidoctor/java => java/com/google/gerrit/asciidoctor}/DocIndexer.java (99%) diff --git a/Documentation/BUILD b/Documentation/BUILD index 2e6f4bc9a3..4177f5101d 100644 --- a/Documentation/BUILD +++ b/Documentation/BUILD @@ -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 diff --git a/lib/asciidoctor/java/AsciiDoctor.java b/java/com/google/gerrit/asciidoctor/AsciiDoctor.java similarity index 99% rename from lib/asciidoctor/java/AsciiDoctor.java rename to java/com/google/gerrit/asciidoctor/AsciiDoctor.java index 596fe660fe..3768ce74aa 100644 --- a/lib/asciidoctor/java/AsciiDoctor.java +++ b/java/com/google/gerrit/asciidoctor/AsciiDoctor.java @@ -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; diff --git a/java/com/google/gerrit/asciidoctor/BUILD b/java/com/google/gerrit/asciidoctor/BUILD new file mode 100644 index 0000000000..10c7839714 --- /dev/null +++ b/java/com/google/gerrit/asciidoctor/BUILD @@ -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", + ], +) diff --git a/lib/asciidoctor/java/DocIndexer.java b/java/com/google/gerrit/asciidoctor/DocIndexer.java similarity index 99% rename from lib/asciidoctor/java/DocIndexer.java rename to java/com/google/gerrit/asciidoctor/DocIndexer.java index c90c439333..5dfde95811 100644 --- a/lib/asciidoctor/java/DocIndexer.java +++ b/java/com/google/gerrit/asciidoctor/DocIndexer.java @@ -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; diff --git a/lib/asciidoctor/BUILD b/lib/asciidoctor/BUILD index da05dd174b..62b1114219 100644 --- a/lib/asciidoctor/BUILD +++ b/lib/asciidoctor/BUILD @@ -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"], ) diff --git a/tools/bzl/asciidoc.bzl b/tools/bzl/asciidoc.bzl index 62fa4c6133..e20624dfd0 100644 --- a/tools/bzl/asciidoc.bzl +++ b/tools/bzl/asciidoc.bzl @@ -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, diff --git a/tools/eclipse/BUILD b/tools/eclipse/BUILD index 67763e207c..546c75e7e9 100644 --- a/tools/eclipse/BUILD +++ b/tools/eclipse/BUILD @@ -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",