question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gradle incremental compilation doesn't detect changes to transitively included modules

See original GitHub issue

We have been using incremental compilation with Gradle for a few months, and we find it’s effective in a majority of cases. However, we found that it fails to detect changes to the types bound with @Binds or the elements in a multibound set or map. One simple way to repro is to build a Dagger module that contains a single binding like this:

@Module
abstract class DaggerModule {
  @Binds
  abstract Base provideBase(SubclassB subclass);
}

Replacing SubclassA with SubclassB here won’t cause the component to be regenerated. I created a small sample to facilitate a repro: https://github.com/cesar1000/dagger-incremental-bug.

I’m not sure whether this is a bug in Gradle or Dagger - @oehme and @autonomousapps, can you take a look?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

4reactions
oehmecommented, Mar 13, 2019

This is a bug in Gradle. I’ve pushed a fix, which will be in 5.4. This doesn’t just affect Dagger, but is a general problem with how we handle transitive dependencies. I guess it was never detected because usually the intermediate project fails when you remove some API. But in this case it just removes one of many bindings, so everything was still valid.

0reactions
ronshapirocommented, Mar 14, 2019

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incremental Compilation, the Java Library Plugin, and other ...
While Gradle can detect which jar contains annotation processors, what it cannot detect is which other jars in the compile classpath are used ......
Read more >
Still getting warning : Configuration 'compile' is obsolete and ...
I've updated com.google.gms:google-services from 3.1.1 to 3.2.0 and the warning stopped appearing. buildscript { repositories { google() ...
Read more >
Add build dependencies - Android Developers
The Gradle build system in Android Studio makes it easy to include external binaries or other library modules to your build as dependencies....
Read more >
Incremental testing with TeamCity - The JetBrains Blog
TeamCity 7.0 introduces a new feature: support for incremental builds for IntelliJ IDEA, Gradle and Maven projects, primarily aimed at ...
Read more >
Speed up your build: Non-transitive R files - Blundell
You use a resource from another module, but you do not declare as dependency on that module. Fix: Do as #1 but also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found