• 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_activity_activity",
45        "@maven//:androidx_annotation_annotation",
46        "@maven//:androidx_appcompat_appcompat",
47        "@maven//:androidx_fragment_fragment",
48        "@maven//:androidx_lifecycle_lifecycle_common",
49        "@maven//:androidx_lifecycle_lifecycle_viewmodel",
50        "@maven//:androidx_lifecycle_lifecycle_viewmodel_savedstate",
51    ],
52)
53
54pom_file(
55    name = "pom",
56    artifact_id = "dagger-android-support",
57    artifact_name = "Dagger Android Support",
58    packaging = "aar",
59    targets = [":support"],
60)
61
62dejetified_library(
63    name = "dejetified-support",
64    input = ":support.aar",
65    output = "support-legacy.aar",
66)
67
68android_library(
69    name = "legacy-deps",
70    tags = ["maven_coordinates=com.google.dagger:dagger-android-support-legacy:" + POM_VERSION],
71    exports = [
72        "//:dagger_with_compiler",
73        "//java/dagger/android:legacy-deps",
74        "@google_bazel_common//third_party/java/error_prone:annotations",
75        "@maven//:com_android_support_appcompat_v7",
76        "@maven//:com_android_support_support_annotations",
77        "@maven//:com_android_support_support_fragment",
78    ],
79)
80
81pom_file(
82    name = "legacy-pom",
83    artifact_id = "dagger-android-support-legacy",
84    artifact_name = "Dagger Android Legacy Support",
85    packaging = "aar",
86    targets = [":legacy-deps"],
87)
88
89javadoc_library(
90    name = "support-javadoc",
91    srcs = [":support-srcs"],
92    android_api_level = 30,
93    root_packages = ["dagger.android.support"],
94    deps = [":support"],
95)
96