Buck: Make deps to $(exe :foo) and $(location :bar) implicitly
Apply [1] on our Buck tree. [1] https://github.com/facebook/buck/issues/128 Change-Id: Ie3a9de0b2ee3725170bcbd06df059ea5d9ae5252
This commit is contained in:
committed by
David Ostrovsky
parent
d8af092c0a
commit
5dacc8bcc2
@@ -20,10 +20,6 @@ genrule(
|
||||
'images/*.jpg',
|
||||
'images/*.png',
|
||||
]) + ['doc.css'],
|
||||
deps = [
|
||||
':generate_html',
|
||||
':licenses.txt',
|
||||
],
|
||||
out = 'html.zip',
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
@@ -31,7 +27,6 @@ genrule(
|
||||
genasciidoc(
|
||||
name = 'generate_html',
|
||||
srcs = SRCS + [':licenses.txt'],
|
||||
deps = [':licenses.txt'],
|
||||
attributes = documentation_attributes(git_describe()),
|
||||
backend = 'html5',
|
||||
out = 'only_html.zip',
|
||||
@@ -64,10 +59,6 @@ genrule(
|
||||
'$SRCS ' +
|
||||
'$(location :licenses.txt)',
|
||||
srcs = SRCS,
|
||||
deps = [
|
||||
':licenses.txt',
|
||||
'//lib/asciidoctor:doc_indexer',
|
||||
],
|
||||
out = 'index.jar',
|
||||
)
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ def genasciidoc(
|
||||
name,
|
||||
out,
|
||||
srcs = [],
|
||||
deps = [],
|
||||
attributes = [],
|
||||
backend = None,
|
||||
visibility = []):
|
||||
@@ -35,9 +34,7 @@ def genasciidoc(
|
||||
asciidoc.extend(['-a', attribute])
|
||||
asciidoc.append('$SRCS')
|
||||
newsrcs = ["doc.css"]
|
||||
newdeps = deps + ['//lib/asciidoctor:asciidoc']
|
||||
for src in srcs:
|
||||
tx = []
|
||||
fn = src
|
||||
# We have two cases: regular source files and generated files.
|
||||
# Generated files are passed as targets ':foo', and ':' is removed.
|
||||
@@ -46,7 +43,6 @@ def genasciidoc(
|
||||
srcs = [src]
|
||||
passed_src = ' -s %s' % fn
|
||||
if fn.startswith(':') :
|
||||
tx = [fn]
|
||||
fn = src[1:]
|
||||
srcs = []
|
||||
passed_src = ' -s $(location :%s)' % fn
|
||||
@@ -58,19 +54,15 @@ def genasciidoc(
|
||||
passed_src +
|
||||
' -o $OUT',
|
||||
srcs = srcs,
|
||||
deps = tx + [':replace_macros'],
|
||||
out = ex,
|
||||
)
|
||||
|
||||
ex = ':' + ex
|
||||
newdeps.append(ex)
|
||||
asciidoc.append('$(location %s)' % ex)
|
||||
asciidoc.append('$(location :%s)' % ex)
|
||||
|
||||
genrule(
|
||||
name = name,
|
||||
cmd = ' '.join(asciidoc),
|
||||
srcs = newsrcs,
|
||||
deps = newdeps,
|
||||
out = out,
|
||||
visibility = visibility,
|
||||
)
|
||||
|
||||
@@ -59,11 +59,6 @@ genrule(
|
||||
'mv $(location :js) net/codemirror/lib',
|
||||
'zip -qr $OUT *'
|
||||
]),
|
||||
deps = [
|
||||
':zip',
|
||||
':css',
|
||||
':js',
|
||||
],
|
||||
out = 'codemirror.jar',
|
||||
)
|
||||
|
||||
@@ -73,6 +68,5 @@ genrule(
|
||||
' -o $OUT' +
|
||||
' -u ' + URL +
|
||||
' -v ' + SHA1,
|
||||
deps = ['//tools:download_file'],
|
||||
out = ZIP,
|
||||
)
|
||||
|
||||
@@ -79,6 +79,5 @@ genrule(
|
||||
'org/eclipse/jgit/diff/Edit.java;' +
|
||||
'cd $TMP;' +
|
||||
'zip -Dq $OUT org/eclipse/jgit/diff/Edit.java',
|
||||
deps = [':jgit_src'],
|
||||
out = 'edit-src.jar',
|
||||
)
|
||||
|
||||
@@ -81,7 +81,6 @@ def maven_jar(
|
||||
genrule(
|
||||
name = '%s__download_bin' % name,
|
||||
cmd = ' '.join(cmd),
|
||||
deps = ['//tools:download_file'],
|
||||
out = binjar,
|
||||
)
|
||||
license = ['//lib:LICENSE-' + license]
|
||||
@@ -93,13 +92,12 @@ def maven_jar(
|
||||
genrule(
|
||||
name = '%s__download_src' % name,
|
||||
cmd = ' '.join(cmd),
|
||||
deps = ['//tools:download_file'],
|
||||
out = srcjar,
|
||||
)
|
||||
prebuilt_jar(
|
||||
name = '%s_src' % name,
|
||||
binary_jar = ':%s__download_src' % name,
|
||||
deps = license + [':' + name + '__download_src'],
|
||||
deps = license,
|
||||
visibility = visibility,
|
||||
)
|
||||
else:
|
||||
|
||||
@@ -23,7 +23,6 @@ def prolog_cafe_library(
|
||||
' $TMP $OUT ' +
|
||||
' '.join(srcs),
|
||||
srcs = srcs,
|
||||
deps = ['//lib/prolog:compiler'],
|
||||
out = name + '.src.zip',
|
||||
)
|
||||
java_library(
|
||||
|
||||
@@ -33,7 +33,6 @@ genrule(
|
||||
';do ln -s $s $TMP/WEB-INF/plugins;done;' +
|
||||
'cd $TMP;' +
|
||||
'zip -qr $OUT .',
|
||||
deps = ['//%s/%s:%s' % (BASE, n, n) for n in HAVE],
|
||||
out = 'core.zip',
|
||||
visibility = ['//:release'],
|
||||
)
|
||||
|
||||
@@ -49,18 +49,16 @@ def war(
|
||||
dep = []
|
||||
if docs:
|
||||
cmd.append('$(location %s)' % DOCS_HTML)
|
||||
dep.append(DOCS_HTML)
|
||||
dep.append(DOCS_LIB)
|
||||
cmd.extend(['--lib', DOCS_LIB])
|
||||
if context:
|
||||
for t in context:
|
||||
dep.append(t)
|
||||
cmd.append('$(location %s)' % t)
|
||||
|
||||
genrule(
|
||||
name = name,
|
||||
cmd = ' '.join(cmd),
|
||||
deps = libs + pgmlibs + dep + ['//tools:pack_war'],
|
||||
deps = libs + pgmlibs + dep,
|
||||
out = name + '.war',
|
||||
visibility = visibility,
|
||||
)
|
||||
|
||||
@@ -28,7 +28,6 @@ def genantlr(
|
||||
cmd = '$(exe //lib/antlr:antlr-tool) -o $TMP $SRCS;' +
|
||||
'cd $TMP;' +
|
||||
'zip -qr $OUT .',
|
||||
deps = ['//lib/antlr:antlr-tool'],
|
||||
out = out,
|
||||
)
|
||||
|
||||
@@ -119,7 +118,6 @@ def gerrit_plugin(
|
||||
':%s__gwt_application' % name +
|
||||
';cd $TMP' +
|
||||
';zip -qr $OUT .',
|
||||
deps = [':%s__gwt_application' % name],
|
||||
out = '%s-static.zip' % name,
|
||||
)
|
||||
gwt_binary(
|
||||
@@ -188,7 +186,6 @@ def java_doc(
|
||||
'-d $TMP',
|
||||
]) + ';jar cf $OUT -C $TMP .',
|
||||
srcs = srcs,
|
||||
deps = deps,
|
||||
out = name + '.jar',
|
||||
visibility = visibility,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user