Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle Error Prone Plugin breaks with Instant Execution #42

Closed
stephanenicolas opened this issue May 23, 2020 · 3 comments
Closed

Gradle Error Prone Plugin breaks with Instant Execution #42

stephanenicolas opened this issue May 23, 2020 · 3 comments

Comments

@stephanenicolas
Copy link

Using instant execution (a.k.a configuration caching), using following versions, I got :

  • AGP:4.1.0-alpha09
  • Kotlin:1.3.72
  • Gradle:6.5-20200519143217+0000
2 instant execution problems were found.
- field '$javacConfiguration' from type 'net.ltgt.gradle.errorprone.ErrorPronePlugin$apply$1': cannot deserialize object of type 'org.gradle.api.artifacts.Configuration' as these are not supported with instant execution.
  See https://docs.gradle.org/6.5-20200519143217+0000/userguide/configuration_cache.html#disallowed_types
- field '$javacConfiguration' from type 'net.ltgt.gradle.errorprone.ErrorPronePlugin$apply$1': value 'file collection' is not assignable to 'org.gradle.api.artifacts.Configuration'

For gradle command:
./gradlew -Dorg.gradle.unsafe.instant-execution.fail-on-problems=false -Dorg.gradle.unsafe.instant-execution=true -Dorg.gradle.unsafe.instant-execution.max-problems=655360 --no-scan :app:build

Basically: configurations are not allowed as inputs of task with instant execution. Solutions are:

  • replace it by an ArtifactView or a file collection. They are supported.
  • use any serializable class instead.

Here is an example of resolution for another plugin: square/wire#1560

@tbroyer
Copy link
Owner

tbroyer commented May 23, 2020

Running preliminary tests (i.e. building the project and running the tests with -Ptest.gradle-version=6.5-20200522062645+0000, and JDK 8, and changing them to pass the new --configuration-cache=on), it looks like declaring the variable of type FileCollection (while still assigning a Configuration to it) would be enough (as documented here)
Note that using JDK 9+ wouldn't trigger the issue.

@tbroyer
Copy link
Owner

tbroyer commented May 24, 2020

I tested ac12999 locally with the latest snapshot (and verified in the report that the test was actually run, and not ignored).
I'll wait for 6.5-rc-1 to be actually released (hopefully tomorrow) to cut a new release though (which also takes into account the com.android.dynamic-feature plugin)

@tbroyer
Copy link
Owner

tbroyer commented May 29, 2020

In case you hadn't seen it, I released v1.2.0 a couple days ago, and added 6.5-rc-1 to the test matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants