Simplify documentation indexer

Write the index entirely in RAM. Its only a few hundred KiB, which
trivially fits in memory.

Compress it twice in memory, once to build the ZIP that is unpacked
at runtime, and again to package it into a JAR for linking with
the runtime. This saves a build step in the BUCK rules.

Move the ZIP under the server package name, to reduce any risk
of collision with another concept of "index.zip".

Change-Id: I74e59712e9855ac79c5220ff0a6b30ecbc3d152f
This commit is contained in:
Shawn Pearce
2014-01-08 13:06:01 -08:00
parent a427d9596e
commit a42c0bb09a
4 changed files with 51 additions and 37 deletions

View File

@@ -62,8 +62,7 @@ python_binary(
genrule(
name = 'index',
cmd = '$(exe //lib/asciidoctor:doc_indexer) ' +
'-z $OUT ' +
'--tmp $TMP ' +
'-o $OUT ' +
'--prefix "%s/" ' % DOC_DIR +
'--in-ext ".txt" ' +
'--out-ext ".html" ' +
@@ -73,20 +72,12 @@ genrule(
':licenses.txt',
'//lib/asciidoctor:doc_indexer',
],
out = 'index.zip',
)
genrule(
name = 'index_jar',
cmd = 'jar cf $OUT -C $SRCDIR index.zip',
srcs = [genfile('index.zip')],
deps = [':index'],
out = 'index.jar',
)
prebuilt_jar(
name = 'index_lib',
binary_jar = genfile('index.jar'),
deps = [':index_jar'],
deps = [':index'],
visibility = ['PUBLIC'],
)