You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you apply the latest version of the protobuf plugin to a pure Java project like this (latest Gradle 6.6 nightly):
plugins {
id 'java-library'
id 'com.google.protobuf' version '0.8.13-SNAPSHOT'
}
And use the configurations cache
./gradlew assemble --configuration-cache
You'll get the following configuration cache warning:
value provider(?) failed to unpack provider
fieldvariantName of com.google.protobuf.gradle.GenerateProtoTask
task:Server-Protocol-Buffer:generateProto of type com.google.protobuf.gradle.GenerateProtoTask
java.lang.IllegalStateException: variant should not be used in a Java project
This is because Gradle tries to read the variantName field which is backed by the variant property. The getter of that property then throws the "variant should not be used in a Java project" error.
I think this can be fixed by making variantName transient similar to how it was done for the backing variant field in #408. //cc @gavra0
The text was updated successfully, but these errors were encountered:
voidzcy
changed the title
Using plugin in a Java project with configuration cache enabled gives unexpected warning
[Configuration cache] Using plugin in a Java project with configuration cache enabled gives unexpected warning
Oct 21, 2020
gavra0
added a commit
to gavra0/protobuf-gradle-plugin
that referenced
this issue
Nov 16, 2020
When configuration caching is enabled, all task
properties will be serialized, causing variantName
to be queried even for Java-only projects which throws
runtime exception. This PR completely removes that property
as it is required only during task configuration.
Fixesgoogle#419.
When configuration caching is enabled, all task
properties will be serialized, causing variantName
to be queried even for Java-only projects which throws
runtime exception. This PR completely removes that property
as it is required only during task configuration.
Fixesgoogle#419.
This is a follow up issue to #408
If you apply the latest version of the protobuf plugin to a pure Java project like this (latest Gradle 6.6 nightly):
And use the configurations cache
You'll get the following configuration cache warning:
This is because Gradle tries to read the variantName field which is backed by the
variant
property. The getter of that property then throws the "variant should not be used in a Java project" error.I think this can be fixed by making
variantName
transient similar to how it was done for the backingvariant
field in #408. //cc @gavra0The text was updated successfully, but these errors were encountered: