• 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
15load("@rules_java//java:defs.bzl", "java_library")
16load("@google_bazel_common//tools/javadoc:javadoc.bzl", "javadoc_library")
17load("@google_bazel_common//tools/jarjar:jarjar.bzl", "jarjar_library")
18load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "define_kt_toolchain")
19
20package(default_visibility = ["//visibility:public"])
21
22define_kt_toolchain(
23    name = "kotlin_toolchain",
24    api_version = "1.4",
25    jvm_target = "1.8",
26    language_version = "1.4",
27)
28
29package_group(
30    name = "src",
31    packages = ["//..."],
32)
33
34java_library(
35    name = "dagger_with_compiler",
36    exported_plugins = ["//java/dagger/internal/codegen:component-codegen"],
37    exports = ["//java/dagger:core"],
38)
39
40java_library(
41    name = "producers_with_compiler",
42    exports = [
43        ":dagger_with_compiler",
44        "//java/dagger/producers",
45    ],
46)
47
48java_library(
49    name = "spi",
50    exports = ["//java/dagger/spi"],
51)
52
53java_library(
54    name = "compiler_internals",
55    exports = [
56        "//java/dagger/internal/codegen:processor",
57        "//java/dagger/internal/codegen/base",
58        "//java/dagger/internal/codegen/binding",
59        "//java/dagger/internal/codegen/validation",
60        "//java/dagger/internal/codegen/writing",
61    ],
62)
63
64android_library(
65    name = "android",
66    exported_plugins = ["//java/dagger/android/processor:plugin"],
67    exports = ["//java/dagger/android"],
68)
69
70android_library(
71    name = "android-support",
72    exports = [
73        ":android",
74        "//java/dagger/android/support",
75    ],
76)
77
78jarjar_library(
79    name = "shaded_android_processor",
80    jars = [
81        "//java/dagger/android/processor",
82        "@maven//:com_google_auto_auto_common",
83    ],
84    rules = [
85        "rule com.google.auto.common.** dagger.android.shaded.auto.common.@1",
86    ],
87)
88
89jarjar_library(
90    name = "shaded_grpc_server_processor",
91    jars = [
92        "//java/dagger/grpc/server/processor",
93        "@maven//:com_google_auto_auto_common",
94    ],
95    rules = [
96        "rule com.google.auto.common.** dagger.grpc.shaded.auto.common.@1",
97    ],
98)
99
100# coalesced javadocs used for the gh-pages site
101javadoc_library(
102    name = "user-docs",
103    testonly = 1,
104    srcs = [
105        "//java/dagger:javadoc-srcs",
106        "//java/dagger/android:android-srcs",
107        "//java/dagger/android/support:support-srcs",
108        "//java/dagger/grpc/server:javadoc-srcs",
109        "//java/dagger/grpc/server/processor:javadoc-srcs",
110        "//java/dagger/hilt:javadoc-srcs",
111        "//java/dagger/producers:producers-srcs",
112        "//java/dagger/spi:spi-srcs",
113    ],
114    android_api_level = 30,
115    # TODO(ronshapiro): figure out how to specify the version number for release builds
116    doctitle = "Dagger Dependency Injection API",
117    exclude_packages = [
118        "dagger.hilt.android.internal",
119        "dagger.hilt.internal",
120        "dagger.internal",
121        "dagger.producers.internal",
122        "dagger.producers.monitoring.internal",
123    ],
124    root_packages = ["dagger"],
125    deps = [
126        "//java/dagger:core",
127        "//java/dagger/android",
128        "//java/dagger/android/support",
129        "//java/dagger/grpc/server",
130        "//java/dagger/grpc/server/processor",
131        "//java/dagger/hilt/android:artifact-lib",
132        "//java/dagger/hilt/android/testing:artifact-lib",
133        "//java/dagger/producers",
134        "//java/dagger/spi",
135    ],
136)
137