Carmelo Cascone | 27b9712 | 2019-11-12 10:34:05 -0800 | [diff] [blame] | 1 | load("//tools/build/bazel:pom_file.bzl", "dependencies_pom") |
| 2 | load( |
| 3 | "//tools/build/bazel:variables.bzl", |
| 4 | "DEFAULT_JAVA_VERSION", |
| 5 | "ONOS_ARTIFACT_BASE", |
| 6 | "ONOS_GROUP_ID", |
| 7 | "ONOS_VERSION", |
| 8 | ) |
| 9 | load( |
| 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 |
| 21 | DEPS = [ |
| 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 Moro | cc41a94 | 2020-02-03 23:33:55 -0800 | [diff] [blame^] | 31 | "@kafka_clients//jar", |
Carmelo Cascone | 27b9712 | 2019-11-12 10:34:05 -0800 | [diff] [blame] | 32 | ] |
| 33 | |
| 34 | # Listed in the <dependencies> section with scope 'provided' |
| 35 | DEPS_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'. |
| 47 | DEPS_TEST = [d for d in TEST if d.startswith("@")] |
| 48 | |
| 49 | VARS = [ |
| 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 | |
| 56 | dependencies_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. |
| 66 | java_library( |
| 67 | name = "onos-dependencies", |
| 68 | resources = ["empty.txt"], |
| 69 | visibility = ["//visibility:public"], |
| 70 | ) |