• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2017 The Dagger Authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15# Description:
16#   Public Dagger API for Android that interacts with the Android support libraries
17
18load(
19    "//:build_defs.bzl",
20    "POM_VERSION",
21    "SOURCE_7_TARGET_7",
22)
23load("//tools:dejetify.bzl", "dejetified_library")
24load("//tools:maven.bzl", "pom_file")
25load("@google_bazel_common//tools/javadoc:javadoc.bzl", "javadoc_library")
26
27package(default_visibility = ["//:src"])
28
29filegroup(
30    name = "support-srcs",
31    srcs = glob(["*.java"]),
32)
33
34android_library(
35    name = "support",
36    srcs = glob(["*.java"]),
37    javacopts = SOURCE_7_TARGET_7,
38    manifest = "AndroidManifest.xml",
39    tags = ["maven_coordinates=com.google.dagger:dagger-android-support:" + POM_VERSION],
40    deps = [
41        "//:dagger_with_compiler",
42        "//java/dagger/android",
43        "@google_bazel_common//third_party/java/error_prone:annotations",
44        "@maven//:androidx_annotation_annotation",
45        "@maven//:androidx_appcompat_appcompat",
46        "@maven//:androidx_fragment_fragment",
47    ],
48)
49
50pom_file(
51    name = "pom",
52    artifact_id = "dagger-android-support",
53    artifact_name = "Dagger Android Support",
54    packaging = "aar",
55    targets = [":support"],
56)
57
58dejetified_library(
59    name = "dejetified-support",
60    input = ":support.aar",
61    output = "support-legacy.aar",
62)
63
64android_library(
65    name = "legacy-deps",
66    tags = ["maven_coordinates=com.google.dagger:dagger-android-support-legacy:" + POM_VERSION],
67    exports = [
68        "//:dagger_with_compiler",
69        "//java/dagger/android:legacy-deps",
70        "@google_bazel_common//third_party/java/error_prone:annotations",
71        "@maven//:com_android_support_appcompat_v7",
72        "@maven//:com_android_support_support_annotations",
73        "@maven//:com_android_support_support_fragment",
74    ],
75)
76
77pom_file(
78    name = "legacy-pom",
79    artifact_id = "dagger-android-support-legacy",
80    artifact_name = "Dagger Android Legacy Support",
81    packaging = "aar",
82    targets = [":legacy-deps"],
83)
84
85javadoc_library(
86    name = "support-javadoc",
87    srcs = [":support-srcs"],
88    android_api_level = 30,
89    root_packages = ["dagger.android.support"],
90    deps = [":support"],
91)
92