blob: bb5003182c8db90b48926462f716198eff70f69b [file] [log] [blame]
Carmelo Cascone27b97122019-11-12 10:34:05 -08001load("//tools/build/bazel:pom_file.bzl", "dependencies_pom")
2load(
3 "//tools/build/bazel:variables.bzl",
4 "DEFAULT_JAVA_VERSION",
5 "ONOS_ARTIFACT_BASE",
6 "ONOS_GROUP_ID",
7 "ONOS_VERSION",
8)
9load(
10 "//tools/build/bazel:generate_workspace.bzl",
11 "CLI",
12 "CORE_DEPS",
13 "JACKSON",
14 "JAXB",
15 "KRYO",
16 "REST",
17 "TEST",
18)
19
20# Listed in the <dependencyManagement> section of the generated pom
21DEPS = [
22 d
23 for d in CORE_DEPS + JAXB + JACKSON + KRYO +
24 CLI + REST + TEST
25 # Keep only third-party (external) ones.
26 if d.startswith("@")
27] + [
28 "@org_apache_karaf_shell_console//jar",
29 "@org_osgi_cmpn//jar",
30 "@jersey_container_servlet//jar",
Daniele Morocc41a942020-02-03 23:33:55 -080031 "@kafka_clients//jar",
Carmelo Cascone27b97122019-11-12 10:34:05 -080032]
33
34# Listed in the <dependencies> section with scope 'provided'
35DEPS_PROVIDED = [
36 "@com_google_guava_guava//jar",
37 "@slf4j_api//jar",
38 "@osgi_core//jar",
39 "@org_osgi_cmpn//jar",
40 "@org_osgi_util_promise//jar",
41 "@org_osgi_service_component//jar",
42 "@org_osgi_service_component_annotations//jar",
43 "@org_osgi_service_metatype_annotations//jar",
44]
45
46# Listed in the <dependencies> section with scope 'test'.
47DEPS_TEST = [d for d in TEST if d.startswith("@")]
48
49VARS = [
50 "ONOS_VERSION=" + ONOS_VERSION,
51 "ONOS_GROUP_ID=" + ONOS_GROUP_ID,
52 "ONOS_ARTIFACT_BASE=" + ONOS_ARTIFACT_BASE,
53 "JAVA_VERSION=" + DEFAULT_JAVA_VERSION,
54]
55
56dependencies_pom(
57 name = "onos-dependencies-pom",
58 deps_provided = DEPS_PROVIDED,
59 deps_test = DEPS_TEST,
60 pom_template = "template.pom",
61 vars = VARS,
62 deps = DEPS,
63)
64
65# An empty jar, so we can re-use onos-publish logic.
66java_library(
67 name = "onos-dependencies",
68 resources = ["empty.txt"],
69 visibility = ["//visibility:public"],
70)