Carmelo Cascone | 87b893e | 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", |
| 31 | ] |
| 32 | |
| 33 | # Listed in the <dependencies> section with scope 'provided' |
| 34 | DEPS_PROVIDED = [ |
| 35 | "@com_google_guava_guava//jar", |
| 36 | "@slf4j_api//jar", |
| 37 | "@osgi_core//jar", |
| 38 | "@org_osgi_cmpn//jar", |
| 39 | "@org_osgi_util_promise//jar", |
| 40 | "@org_osgi_service_component//jar", |
| 41 | "@org_osgi_service_component_annotations//jar", |
| 42 | "@org_osgi_service_metatype_annotations//jar", |
| 43 | ] |
| 44 | |
| 45 | # Listed in the <dependencies> section with scope 'test'. |
| 46 | DEPS_TEST = [d for d in TEST if d.startswith("@")] |
| 47 | |
| 48 | VARS = [ |
| 49 | "ONOS_VERSION=" + ONOS_VERSION, |
| 50 | "ONOS_GROUP_ID=" + ONOS_GROUP_ID, |
| 51 | "ONOS_ARTIFACT_BASE=" + ONOS_ARTIFACT_BASE, |
| 52 | "JAVA_VERSION=" + DEFAULT_JAVA_VERSION, |
| 53 | ] |
| 54 | |
| 55 | dependencies_pom( |
| 56 | name = "onos-dependencies-pom", |
| 57 | deps_provided = DEPS_PROVIDED, |
| 58 | deps_test = DEPS_TEST, |
| 59 | pom_template = "template.pom", |
| 60 | vars = VARS, |
| 61 | deps = DEPS, |
| 62 | ) |
| 63 | |
| 64 | # An empty jar, so we can re-use onos-publish logic. |
| 65 | java_library( |
| 66 | name = "onos-dependencies", |
| 67 | resources = ["empty.txt"], |
| 68 | visibility = ["//visibility:public"], |
| 69 | ) |