aboutsummaryrefslogtreecommitdiffstats
path: root/tools/default.defs
blob: 3481fa1f8a4391a3221830a8bf488a38f1f642de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
def java_sources(
    name,
    srcs,
    visibility = ['PUBLIC']
  ):
  java_library(
    name = name,
    resources = srcs,
    visibility = visibility,
  )

def maven_jar(
    name,
    group,
    artifact,
    version,
    bin_sha1,
    src_sha1,
    visibility = ['PUBLIC']):
  jar_name = '%s__jar' % name
  src_name = '%s__src' % name

  remote_file(
    name = jar_name,
    sha1 = bin_sha1,
    url = 'mvn:%s:%s:jar:%s' % (group, artifact, version),
    out = '%s.jar' % jar_name,
  )

  remote_file(
    name = src_name,
    sha1 = src_sha1,
    url = 'mvn:%s:%s:src:%s' % (group, artifact, version),
    out = '%s.jar' % src_name,
  )

  prebuilt_jar(
    name = name,
    binary_jar = ':' + jar_name,
    source_jar = ':' + src_name,
    visibility = visibility)