xref: /JGit/tools/default.defs (revision 13502fef8f4814c6c5bdfa63674c94f9d32b5531)
1*13502fefSDavid Ostrovskydef java_sources(
2*13502fefSDavid Ostrovsky    name,
3*13502fefSDavid Ostrovsky    srcs,
4*13502fefSDavid Ostrovsky    visibility = ['PUBLIC']
5*13502fefSDavid Ostrovsky  ):
6*13502fefSDavid Ostrovsky  java_library(
7*13502fefSDavid Ostrovsky    name = name,
8*13502fefSDavid Ostrovsky    resources = srcs,
9*13502fefSDavid Ostrovsky    visibility = visibility,
10*13502fefSDavid Ostrovsky  )
11*13502fefSDavid Ostrovsky
12*13502fefSDavid Ostrovskydef maven_jar(
13*13502fefSDavid Ostrovsky    name,
14*13502fefSDavid Ostrovsky    group,
15*13502fefSDavid Ostrovsky    artifact,
16*13502fefSDavid Ostrovsky    version,
17*13502fefSDavid Ostrovsky    bin_sha1,
18*13502fefSDavid Ostrovsky    src_sha1,
19*13502fefSDavid Ostrovsky    visibility = ['PUBLIC']):
20*13502fefSDavid Ostrovsky  jar_name = '%s__jar' % name
21*13502fefSDavid Ostrovsky  src_name = '%s__src' % name
22*13502fefSDavid Ostrovsky
23*13502fefSDavid Ostrovsky  remote_file(
24*13502fefSDavid Ostrovsky    name = jar_name,
25*13502fefSDavid Ostrovsky    sha1 = bin_sha1,
26*13502fefSDavid Ostrovsky    url = 'mvn:%s:%s:jar:%s' % (group, artifact, version),
27*13502fefSDavid Ostrovsky    out = '%s.jar' % jar_name,
28*13502fefSDavid Ostrovsky  )
29*13502fefSDavid Ostrovsky
30*13502fefSDavid Ostrovsky  remote_file(
31*13502fefSDavid Ostrovsky    name = src_name,
32*13502fefSDavid Ostrovsky    sha1 = src_sha1,
33*13502fefSDavid Ostrovsky    url = 'mvn:%s:%s:src:%s' % (group, artifact, version),
34*13502fefSDavid Ostrovsky    out = '%s.jar' % src_name,
35*13502fefSDavid Ostrovsky  )
36*13502fefSDavid Ostrovsky
37*13502fefSDavid Ostrovsky  prebuilt_jar(
38*13502fefSDavid Ostrovsky    name = name,
39*13502fefSDavid Ostrovsky    binary_jar = ':' + jar_name,
40*13502fefSDavid Ostrovsky    source_jar = ':' + src_name,
41*13502fefSDavid Ostrovsky    visibility = visibility)
42*13502fefSDavid Ostrovsky
43