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:
@@ -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'],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user