google / protobuf-gradle-plugin

Protobuf Plugin for Gradle
Other
1.77k stars 273 forks source link

Avoid eagerly resolving input files in ProtobufExtract (#713) (v0.9.x backport) #719

Closed YifeiZhuang closed 1 year ago

YifeiZhuang commented 1 year ago

Rely on FileCollection.getElements() (available in Gradle 5.6+) to ensure no files are accessed eagerly during configuration. This also ensures configuration cache key does not depend on them.

Fixes issue #711.

Test: Added "testProjectDependent proto extraction with configuration cache" with Gradle 8.1

backport of https://github.com/google/protobuf-gradle-plugin/pull/713