1 /*
2  * Copyright (C) 2021 The Dagger Authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package dagger.hilt.android.plugin.root
18 
19 // Annotations used for aggregating dependencies by the annotation processors.
20 internal enum class AggregatedAnnotation(
21   private val descriptor: String,
22   private val aggregatedPackage: String
23 ) {
24   AGGREGATED_ROOT(
25     "Ldagger/hilt/internal/aggregatedroot/AggregatedRoot;",
26     "dagger/hilt/internal/aggregatedroot/codegen"
27   ),
28   PROCESSED_ROOT_SENTINEL(
29     "Ldagger/hilt/internal/processedrootsentinel/ProcessedRootSentinel;",
30     "dagger/hilt/internal/processedrootsentinel/codegen"
31   ),
32   DEFINE_COMPONENT(
33     "Ldagger/hilt/internal/definecomponent/DefineComponentClasses;",
34     "dagger/hilt/processor/internal/definecomponent/codegen"
35   ),
36   ALIAS_OF(
37     "Ldagger/hilt/internal/aliasof/AliasOfPropagatedData;",
38     "dagger/hilt/processor/internal/aliasof/codegen"
39   ),
40   AGGREGATED_DEP(
41     "Ldagger/hilt/processor/internal/aggregateddeps/AggregatedDeps;",
42     "hilt_aggregated_deps"
43   ),
44   AGGREGATED_DEP_PROXY(
45     "Ldagger/hilt/android/internal/legacy/AggregatedElementProxy;",
46     "", // Proxies share the same package name as the elements they are proxying.
47   ),
48   AGGREGATED_UNINSTALL_MODULES(
49     "Ldagger/hilt/android/internal/uninstallmodules/AggregatedUninstallModules;",
50     "dagger/hilt/android/internal/uninstallmodules/codegen"
51   ),
52   AGGREGATED_EARLY_ENTRY_POINT(
53     "Ldagger/hilt/android/internal/earlyentrypoint/AggregatedEarlyEntryPoint;",
54     "dagger/hilt/android/internal/earlyentrypoint/codegen"
55   ),
56   NONE("", "");
57 
58   companion object {
<lambda>null59     fun fromString(str: String) = values().firstOrNull { it.descriptor == str } ?: NONE
60 
<lambda>null61     val AGGREGATED_PACKAGES = values().map { it.aggregatedPackage }.filter { it.isNotEmpty() }
62   }
63 }
64