xref: /aosp_15_r20/external/dagger2/java/dagger/hilt/android/plugin/main/BUILD (revision f585d8a307d0621d6060bd7e80091fdcbf94fe27)
1# Copyright (C) 2020 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#   A Gradle plugin that performs a transform.
17
18package(default_visibility = ["//:src"])
19
20genrule(
21    name = "import-shared-lib",
22    srcs = [
23        "//java/dagger/hilt/processor/internal/root/ir",
24        "//java/dagger/hilt/processor/internal/optionvalues",
25    ],
26    outs = ["processor-shared-lib.jar"],
27    # Combine all the jar files by extracting them to the same dir and package them again.
28    cmd = " && ".join([
29        "mkdir tmp",
30        "find $(SRCS) -type f -name '*.jar' -exec unzip -o {} -d tmp \\;",
31        "jar -cvf $@ -C tmp .",
32    ]),
33    local = True,
34)
35
36filegroup(
37    name = "srcs_filegroup",
38    srcs = glob(
39        ["**/*"],
40        # Exclude Gradle build folder to enable working along side Bazel
41        exclude = ["**/build/**"],
42    ),
43)
44