bazel: generate the classpath in a file, for use with eclipse.
Change-Id: I6562c045a7e47c6661889d63f3103e1aeef113ec
This commit is contained in:
parent
269cce1a82
commit
888f4ac705
@ -1,3 +1,7 @@
|
||||
package(
|
||||
default_visibility=["//visibility:public"]
|
||||
)
|
||||
|
||||
load('//tools/bzl:junit.bzl', 'junit_tests')
|
||||
|
||||
SRCS = glob(
|
||||
|
@ -1,3 +1,7 @@
|
||||
package(
|
||||
default_visibility=["//visibility:public"]
|
||||
)
|
||||
|
||||
load('//tools/bzl:gwt.bzl', 'gwt_module')
|
||||
load('//tools/bzl:junit.bzl', 'junit_tests')
|
||||
|
||||
|
19
tools/bzl/classpath.bzl
Normal file
19
tools/bzl/classpath.bzl
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
def _classpath_collector(ctx):
|
||||
all = set()
|
||||
for d in ctx.attr.deps:
|
||||
all += d.java.compilation_info.runtime_classpath
|
||||
|
||||
as_strs = [c.path for c in all]
|
||||
ctx.file_action(output= ctx.outputs.runtime,
|
||||
content="\n".join(sorted(as_strs)))
|
||||
|
||||
|
||||
classpath_collector = rule(
|
||||
implementation = _classpath_collector,
|
||||
attrs = {
|
||||
"deps": attr.label_list(),
|
||||
},
|
||||
outputs={
|
||||
"runtime": "%{name}.runtime_classpath"
|
||||
})
|
@ -94,7 +94,7 @@ def _maven_jar_impl(ctx):
|
||||
out = ctx.execute(args)
|
||||
|
||||
if out.return_code:
|
||||
fail("failed %s: %s" % (args, out.stderr))
|
||||
fail("failed %s: %s" % (' '.join(args), out.stderr))
|
||||
_generate_build_file(ctx, "jar", binjar)
|
||||
|
||||
if ctx.attr.src_sha1 or ctx.attr.attach_source:
|
||||
|
Loading…
Reference in New Issue
Block a user