# square/anvil

A Kotlin compiler plugin to make dependency injection with Dagger 2 easier.

Repository: https://github.com/square/anvil
Canonical: https://ross.abutalabs.com/products/square-anvil
Language: Kotlin
License: Apache-2.0
License Family: permissive
Topics: dagger2, dagger2-android, kotlin, kotlin-compiler-plugin
Last push: 2026-08-18T04:36:34+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 38, longevity 100
- inputs: {"age_days": 2275, "days_push": 15, "days_rel": 335, "gap_med": 63.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1402, forks 91 (observed 2026-08-28T04:04:37.730219+00:00)

## What it is
Anvil is a Kotlin compiler plugin and Gradle plugin that simplifies dependency injection with Dagger 2 by automatically merging Dagger modules and component interfaces. It is now in maintenance mode, supporting only the K1 compiler with development ending when K2 becomes required.

## Use cases
- automatically merge Dagger modules into a component without listing them manually
- avoid manually extending component interfaces in multi-module Android apps
- reduce boilerplate in Dagger dependency injection setup
- contribute modules and interfaces to scoped Dagger components across Gradle modules
- generate Dagger component annotations at compile time

## When to avoid
- you are using or migrating to the K2 Kotlin compiler, since Anvil development ends there
- you are starting a new project and can choose a DI framework without Dagger boilerplate
- you need a solution with active long-term support

## Facets
- artifact type: library
- maturity: maintenance
- function: compiler, build-tool, plugin-system
- domain: developer-tools, programming-languages, android-tools
- platform: jvm
- tags: kotlin-compiler-plugin, dagger2, dependency-injection, code-generation, android, gradle

## Member repositories
- square/anvil (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:37.730219+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:38:59.798183+00:00, confidence not recorded.
  - readme: https://github.com/square/anvil (fetched 2026-08-28T04:04:37.730219+00:00, sha 3f458bf63289)
- Data as of 2026-08-30T08:39:29.467469+00:00.
