JakeWharton/butterknife
61.0
Adequate · 24 September 2026
5.9k
lines of production code
Java
primary language
5
measurements over time
What this system is
Butter Knife is an Android library that simplifies view and resource binding through annotations, supporting both compile-time code generation and a reflection-based runtime implementation. The system provides a comprehensive set of annotations for binding views, handling UI events, and accessing various Android resources. It includes a Gradle plugin that automatically generates an \R2\ class for resource references and integrates with modern Android development practices like AndroidX. The library also features a lint rule to enforce correct usage of generated resources and offers a reflection-based backend for faster development cycles.
How it got here
2013–2014 — Gradle migration and runtime binding
7 changes.
The project underwent a significant infrastructure overhaul, migrating the build system from Maven to Gradle and updating the library's core mechanism from compile-time annotation processing to runtime reflection-based binding. This period also established the modern development environment with IDE configuration guides and automated deployment scripts.
2015–2016 — Reflection backend and AndroidX migration
11 changes.
This period focused on introducing a reflection-based binding backend to support incremental compilation and library projects, alongside a comprehensive refactor of the compiler's internal immutable models. The team also migrated the project to AndroidX and Java 8, while adding lint checks and integration tests to ensure the new features worked correctly.
2017–2019 — AndroidX migration and test coverage
10 changes.
This period focused on modernizing the Butter Knife codebase for AndroidX compatibility and updating the Gradle plugin to support feature variants. Significant effort was also directed toward expanding test coverage, including the introduction of a reflection-based development module and comprehensive integration tests for binding and event handling.
Features
Added IDE configuration guides for Eclipse and IntelliJ IDEA
The website now includes dedicated documentation pages for configuring Butter Knife in Eclipse and IntelliJ IDEA. These new pages provide step-by-step instructions for enabling annotation processing in each IDE, ensuring developers can correctly set up their development environments to use the library.
website · high confidence
Added lint check for invalid R2 usage
A new lint rule, InvalidR2UsageDetector, has been introduced to detect invalid usage of the R2 class. The implementation includes the LintRegistry to register the check and a corresponding test suite to verify its behavior, ensuring that R2 is not used inappropriately outside of annotations.
butterknife-lint · high confidence
Automated snapshot deployment to Sonatype
A new script (.buildscript/deploy\_snapshot.sh) has been added to automatically deploy snapshot builds to Sonatype. The script is configured to run on the master branch of the JakeWharton/butterknife repository using Oracle JDK 8, and it will skip deployment for pull requests or non-matching branches.
.buildscript · high confidence
Initial website styling and layout
The website's visual presentation is established with a new custom stylesheet (app.css) that applies a Roboto font, centers headings and images, and adds a drop-shadow to the logo. The site also incorporates Bootstrap v2.3.0 (bootstrap.min.css and bootstrap-responsive.min.css) to provide a responsive grid system and base component styles.
website/static · high confidence
Introduce reflection-based Butter Knife implementation for development builds
A new \butterknife-reflect\ module has been added to provide an API-compatible, 100% reflection-based implementation of Butter Knife. This module is designed for use during iterative development to avoid the overhead of annotation processing, offering a faster build cycle for IDEs. The package includes the necessary Java source files (such as \CompositeUnbinder\ and \EmptyTextWatcher\), an Android manifest, and ProGuard rules to preserve class members. This change allows developers to swap in this reflection-based artifact for development variants while retaining the standard compile-time validated version for release builds.
butterknife-reflect · high confidence
Introduce reflection-based binding backend
Butter Knife now supports a reflection-based binding implementation in the new \butterknife-reflect\ module. This allows users to bind views and resources without relying on the annotation processor, enabling support for Android Library Projects and incremental compilation. The reflection backend provides the same functionality as the codegen backend, including support for \@OnClick\, \@OnLongClick\, \@OnTouch\, \@OnPageChange\, and various resource bindings (colors, drawables, typefaces, animations, etc.). A new \InvalidR2UsageDetector\ lint rule ensures that \R2\ is only used inside annotations. The \BindingSet\ and related compiler classes have been refactored to support both codegen and reflection backends, with immutable data structures used for binding information.
. · high confidence
New resource and listener binding annotations
The butterknife-annotations module now includes a comprehensive set of new annotations to bind various Android resources and view listeners via reflection. This includes resource bindings for animations, arrays, bitmaps, booleans, colors, dimensions, drawables (with tint support), floats, fonts, integers, and strings. Additionally, new annotations are provided for view events such as clicks, long clicks, touch, focus changes, text changes, and page changes, enabling declarative event handling in Android applications.
butterknife-annotations · high confidence
Behavioural changes
Add AndroidManifest and ProGuard rules for the Butterknife integration test
The integration test module now includes an AndroidManifest.xml defining the application and activity structure, along with a proguard.pro file specifying ProGuard/R8 rules to preserve key Butterknife classes and methods during code shrinking and obfuscation.
butterknife-integration-test/src/main · medium confidence
Add support for AndroidX and feature variants in the Butter Knife Gradle plugin
The Butter Knife Gradle plugin has been rewritten in Kotlin and updated to support AndroidX and Android Gradle Plugin 3.3+. It now generates an \R2\ class for all variant types, including feature modules, by parsing the manifest to determine the package name. The plugin also ensures input path sensitivity for the R2Generator task, making it cacheable by default.
butterknife-gradle-plugin/src/main/java · high confidence
Added font license and ProGuard configuration for integration tests
Added the SIL Open Font License for the Inconsolata font used in the integration tests, and introduced a ProGuard configuration file that disables optimization, obfuscation, and shrinking, while suppressing all notes and warnings.
butterknife-integration-test/src/androidTest · high confidence
Butter Knife library deprecated and build system migrated to Gradle
The library is now deprecated in favor of Android's view binding, and the project has migrated from Maven to a Gradle build system. A new release process is defined in RELEASING.md, and a deploy\_website.sh script is added to automate website updates. The README is updated to reflect the deprecation status and new Gradle/Kotlin (kapt) integration instructions.
(repo-wide) · high confidence
ButterKnife Gradle plugin registration updated
The Gradle plugin metadata file for the ButterKnife plugin has been updated to specify the implementation class as 'butterknife.plugin.ButterKnifePlugin'. This change ensures the plugin is correctly registered and discoverable by the Gradle build system.
butterknife-gradle-plugin/src/main/resources · high confidence
Extracts runtime utilities and view collection helpers into the butterknife-runtime module
The butterknife-runtime module now includes the core runtime interfaces (Action, Setter, Unbinder) and utility classes (ViewCollections, Utils, DebouncingOnClickListener) that were previously part of the codegen or reflective lookup logic. This separation clarifies the runtime dependency, ensuring that generated code and view-binding operations rely on a dedicated runtime library rather than pulling in codegen or reflection-based lookup classes. Users of the runtime library will see these components available for view manipulation and click debouncing without needing the annotation processor or reflection dependencies.
butterknife-runtime/src/main · medium confidence
Migrate ButterKnife from compile-time injection to runtime binding
The library has shifted from a compile-time annotation processor that generated separate injector classes to a runtime-based binding system. The legacy \Views.inject()\ method and the \Views\ class containing the \AnnotationProcessor\ have been removed. Instead, \ButterKnife.bind()\ now uses reflection to find and instantiate generated binding constructors at runtime, caching them in a \BINDINGS\ map for performance. This change simplifies the API by removing the need for separate generated classes and allows for more flexible binding scenarios, such as binding to \Dialog\ objects and supporting generic superclasses.
butterknife/src/main/java · high confidence
Refactors ButterKnife compiler internal architecture to immutable models
The ButterKnife compiler has been refactored to use an immutable model for resource and view bindings. New classes such as Id, FieldViewBinding, FieldCollectionViewBinding, and ResourceBinding encapsulate binding data, while MemberViewBinding and Parameter define the interfaces for these models. This change improves memory efficiency during compilation and allows the compiler to carry additional metadata (such as resource IDs and qualified R class references) within the binding objects themselves, rather than relying on mutable state or external lookups. The test suite for BindingSet has been updated to reflect these internal structural changes.
butterknife-compiler · medium confidence
Removal of legacy @InjectView and Views.inject() API
The sample application's SimpleActivity has been removed, eliminating the use of the older @InjectView annotation and the static Views.inject() method. This change reflects a shift away from the legacy injection API, which is being superseded by newer binding mechanisms.
butterknife-sample · medium confidence
Update Butterknife integration test to use Java 8 and AndroidX
The Butterknife integration test suite has been updated to use Java 8 bytecode and AndroidX libraries. This includes migrating the test application and activity to use modern Android development practices, such as using \ViewCollections\ for handling multiple views and updating resource references to support static imports. The test now covers various scenarios including view binding, color binding, and click handling within a hierarchy of classes.
butterknife-integration-test/src/main/java · medium confidence
Updated sample app to release version
The sample application has been updated to the release version. This includes restructuring the sample app's directory layout, adding new test classes for view binding (SimpleApp, A through H), and updating the AndroidManifest to reflect the new package structure and activity names.
sample, sample/library · medium confidence
Test coverage
Added Android instrumentation tests for ViewCollections and Utils; Added Android integration tests for ButterKnife binding and unbinding; Added instrumentation tests for ButterKnife binding behavior; Added integration tests for ButterKnife annotation type-checking failures; Added test fixtures for R2 resource generation; Added test infrastructure and fixtures for the Butterknife Gradle plugin; Added unit tests for Butter Knife annotation processors; Expanded functional test coverage for Butterknife view and event bindings.
Dependencies
Migrate build system from Maven to Gradle
The project's build system has been converted from Maven to Gradle. This migration introduces a new Gradle-based build configuration, replacing the previous Maven \pom.xml\ files with \build.gradle\ scripts for each module (such as \butterknife\, \butterknife-compiler\, and \butterknife-runtime\). The new build defines explicit dependencies on libraries like JavaPoet, AutoService, and AndroidX, and configures the Android Gradle Plugin for compilation and testing.
(dependencies) · high confidence
Updated Gradle wrapper to version 4.10.3
The Gradle wrapper has been updated to version 4.10.3, ensuring that the project uses a consistent and specific version of the Gradle build tool for all developers and CI environments.
gradle · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 59 → 61 (+2.1)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 81 → 88 (+7.0)
- Architecture 100 → 100 (+0.0)
- Maturity 48 → 48 (+0.0)
- Readiness 52 → 56 (+3.5)
- Security 84 → 88 (+3.1)
Resolved (13)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- Duplicated block (10 lines × 3) (butterknife-compiler/src/main/java/butterknife/compiler/BindingSet.java)
- Duplicated block (11 lines × 2) (butterknife-reflect/src/main/java/butterknife/ButterKnife.java)
- Duplicated block (11 lines × 3) (butterknife-reflect/src/main/java/butterknife/ButterKnife.java)
- Duplicated block (12 lines × 2) (butterknife-reflect/src/main/java/butterknife/ButterKnife.java)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Low: security finding (details withheld)
- Low: security finding (details withheld)
- No exposed public API
- Test reliability not included
- dormant codebase — no living knowledge left to concentrate
New (150)
- ClassTooLong: BindingSet (butterknife-compiler/src/main/java/butterknife/compiler/BindingSet.java)
- ClassTooLong: ButterKnife (butterknife-reflect/src/main/java/butterknife/ButterKnife.java)
- ClassTooLong: ButterKnifeProcessor (butterknife-compiler/src/main/java/butterknife/compiler/ButterKnifeProcessor.java)
- Dependency hygiene PARTLY measured — Maven/Gradle declarations read, no dependency graph resolved
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (10 lines × 2) (butterknife-integration-test/src/main/java/com/example/butterknife/library/SimpleAdapter.java)
- Duplicated block (10 lines × 3) (butterknife-reflect/src/main/java/butterknife/ButterKnife.java)
- Duplicated block (11 lines × 2) (butterknife-reflect/src/main/java/butterknife/ButterKnife.java)
- Duplicated block (11 lines × 3) (butterknife-compiler/src/main/java/butterknife/compiler/BindingSet.java)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Low: security finding (details withheld)
- Low: security finding (details withheld)
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- MethodTooLong: ButterKnifeProcessor.findAndParseTargets (butterknife-compiler/src/main/java/butterknife/compiler/ButterKnifeProcessor.java)
- …and 130 more
Architecture
- Containers 0 added · 0 removed · contexts 4 added · 1 removed · edges 1 added · 0 removed
Added bounded contexts (4)
- butterknife-compiler
- butterknife-lint
- butterknife-reflect
- butterknife-runtime
Removed bounded contexts (1)
- .
Added dependency edges (1)
- butterknife-reflect → butterknife-runtime
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
JakeWharton/butterknife was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 24 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit fcdebedf3276096db2f51bf6372b849b5a9c75ed — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-ae95d6cad036.