• 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
18package(default_visibility = ["//:src"])
19
20load("//:build_defs.bzl", "SOURCE_7_TARGET_7")
21load("//tools:maven.bzl", "pom_file", "POM_VERSION")
22
23filegroup(
24    name = "support-srcs",
25    srcs = glob(["*.java"]),
26)
27
28android_library(
29    name = "support",
30    srcs = glob(["*.java"]),
31    javacopts = SOURCE_7_TARGET_7,
32    manifest = "AndroidManifest.xml",
33    tags = ["maven_coordinates=com.google.dagger:dagger-android-support:" + POM_VERSION],
34    deps = [
35        ":manual-maven-deps",
36        "//:dagger_with_compiler",
37        "//java/dagger/android",
38        "@google_bazel_common//third_party/java/error_prone:annotations",
39    ],
40)
41
42# Our pom.xml generator does not have a way to add manual maven deps. This target exports the
43# targets that don't have the necessary maven_coordinates tags.
44android_library(
45    name = "manual-maven-deps",
46    tags = [
47        "maven_coordinates=com.android.support:appcompat-v7:25.0.0",
48        "maven_coordinates=com.android.support:support-annotations:25.0.0",
49        "maven_coordinates=com.android.support:support-fragment:25.0.0",
50    ],
51    visibility = ["//visibility:private"],
52    exports = [
53        "@androidsdk//com.android.support:appcompat-v7-25.0.0",
54        "@androidsdk//com.android.support:support-annotations-25.0.0",
55        "@androidsdk//com.android.support:support-fragment-25.0.0",
56    ],
57)
58
59pom_file(
60    name = "pom",
61    artifact_id = "dagger-android-support",
62    artifact_name = "Dagger Android Support",
63    packaging = "aar",
64    targets = [":support"],
65)
66
67load("@google_bazel_common//tools/javadoc:javadoc.bzl", "javadoc_library")
68
69javadoc_library(
70    name = "support-javadoc",
71    srcs = [":support-srcs"],
72    android_api_level = 26,
73    root_packages = ["dagger.android.support"],
74    deps = [":support"],
75)
76