All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dagger.hilt.processor.internal.root.ir.MetadataIr.kt Maven / Gradle / Ivy

There is a newer version: 2.45-kim-rc1
Show newest version
/*
 * Copyright (C) 2021 The Dagger Authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package dagger.hilt.processor.internal.root.ir

import com.squareup.javapoet.ClassName

/**
 * Represents [dagger.hilt.processor.internal.aggregateddeps.AggregatedDeps]
 *
 * Even though the annotation uses arrays for modules, entryPoints and componentEntryPoints the
 * reality is that exactly only one value will be present in one of those arrays.
 */
data class AggregatedDepsIr(
  val fqName: ClassName,
  val components: List,
  val test: ClassName?,
  val replaces: List,
  val module: ClassName?,
  val entryPoint: ClassName?,
  val componentEntryPoint: ClassName?,
)

/** Represents [dagger.hilt.android.internal.earlyentrypoint.AggregatedEarlyEntryPoint] */
data class AggregatedEarlyEntryPointIr(
  val fqName: ClassName,
  val earlyEntryPoint: ClassName,
)

/** Represents [dagger.hilt.android.internal.legacy.AggregatedElementProxy] */
data class AggregatedElementProxyIr(
  val fqName: ClassName,
  val value: ClassName,
)

/** Represents [dagger.hilt.internal.aggregatedroot.AggregatedRoot] */
data class AggregatedRootIr(
  val fqName: ClassName,
  val root: ClassName,
  val originatingRoot: ClassName,
  val rootAnnotation: ClassName,
  // External property from the annotation that indicates if root can use a shared component.
  val allowsSharingComponent: Boolean = true
) {
  // Equivalent to RootType.isTestRoot()
  val isTestRoot = TEST_ROOT_ANNOTATIONS.contains(rootAnnotation.toString())

  companion object {
    private val TEST_ROOT_ANNOTATIONS =
      listOf(
        "dagger.hilt.android.testing.HiltAndroidTest",
        "dagger.hilt.android.internal.testing.InternalTestRoot",
      )
  }
}

/** Represents [dagger.hilt.android.internal.uninstallmodules.AggregatedUninstallModules] */
data class AggregatedUninstallModulesIr(
  val fqName: ClassName,
  val test: ClassName,
  val uninstallModules: List
)

/** Represents [dagger.hilt.internal.aliasof.AliasOfPropagatedData] */
data class AliasOfPropagatedDataIr(
  val fqName: ClassName,
  val defineComponentScopes: List,
  val alias: ClassName,
)

/** Represents [dagger.hilt.internal.componenttreedeps.ComponentTreeDeps] */
data class ComponentTreeDepsIr(
  val name: ClassName,
  val rootDeps: Set,
  val defineComponentDeps: Set,
  val aliasOfDeps: Set,
  val aggregatedDeps: Set,
  val uninstallModulesDeps: Set,
  val earlyEntryPointDeps: Set,
)

/** Represents [dagger.hilt.internal.definecomponent.DefineComponentClasses] */
data class DefineComponentClassesIr(
  val fqName: ClassName,
  val component: ClassName,
)

/** Represents [dagger.hilt.internal.processedrootsentinel.ProcessedRootSentinel] */
data class ProcessedRootSentinelIr(val fqName: ClassName, val roots: List)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy