actions-on-google / actions-on-google-java

Java/Kotlin library for Actions on Google
Apache License 2.0
286 stars 39 forks source link

vendored googleapis proto cause duplicate-dependency-class issues #42

Open proppy opened 4 years ago

proppy commented 4 years ago

Running https://github.com/nebula-plugins/gradle-lint-plugin on a project that depens on actions-on-google:1.8.0 will trigger the following warning.

com.google.actions:actions-on-google:1.8.0 in configuration ':implementation' has 18 classes duplicated by com.google.api.grpc:proto-google-common-protos:1.17.0. Duplicate classes: [com/google/api/CustomHttpPatternOrBuilder, com/google/api/AnnotationsProto$1, com/google/api/CustomHttpPattern$1, com/google/api/AnnotationsProto, com/google/api/CustomHttpPattern, com/google/api/Http$Builder, com/google/api/HttpOrBuilder, com/google/api/CustomHttpPattern$Builder, com/google/api/HttpRule, com/google/api/HttpRuleOrBuilder, com/google/api/HttpRule$PatternCase, com/google/api/HttpProto, com/google/api/HttpRule$Builder, com/google/api/HttpRule$2, com/google/api/HttpRule$1, com/google/api/Http, com/google/api/Http$1, com/google/api/HttpProto$1]

This project contains lint violations. A complete listing of the violations follows. 
Because none were serious, the build's overall status was unaffected.

warning   duplicate-dependency-class         com.google.actions:actions-on-google:1.8.0 in configuration ':implementation' has 18 classes duplicated by com.google.api.grpc:proto-google-common-protos:1.17.0 (use --info for detailed class list) (no auto-fix available)

I believe this is due to the project vendoring the generated class from the following proto: https://github.com/actions-on-google/actions-on-google-java/tree/master/src/main/proto/google/api

While those are also available as part of the com.google.api.grpc:proto-google-common-protos:1.17.0, which actions-on-google:1.8.0 depends transitively thru io.grpc:grpc-protobuf in https://github.com/actions-on-google/actions-on-google-java/blob/master/build-smarthome.gradle#L51.

see:

~ 🍊 join <(unzip -Z1 /usr/local/google/home/proppy/.gradle/caches/modules-2/files-2.1/com.google.api.grpc/proto-google-common-protos/1.17.0/40471bf2045151c17da555889b5550fcfd5224a8/proto-google-common-protos-1.17.0.jar | sort)  <(unzip -Z1 ~/.gradle/caches/modules-2/files-2.1/com.google.actions/actions-on-google/1.8.0/4c3c71a26360b337a0afe4f3e5d27157a04ff132/actions-on-google-1.8.0.jar | sort)
com/
com/google/
com/google/api/
com/google/api/AnnotationsProto$1.class
com/google/api/AnnotationsProto.class
com/google/api/CustomHttpPattern$1.class
com/google/api/CustomHttpPattern$Builder.class
com/google/api/CustomHttpPattern.class
com/google/api/CustomHttpPatternOrBuilder.class
com/google/api/Http$1.class
com/google/api/Http$Builder.class
com/google/api/Http.class
com/google/api/HttpOrBuilder.class
com/google/api/HttpProto$1.class
com/google/api/HttpProto.class
com/google/api/HttpRule$1.class
com/google/api/HttpRule$2.class
com/google/api/HttpRule$Builder.class
com/google/api/HttpRule$PatternCase.class
com/google/api/HttpRule.class
com/google/api/HttpRuleOrBuilder.class
google/
google/api/
google/api/annotations.proto
google/api/http.proto
META-INF/
META-INF/MANIFEST.MF

/cc @taycaldwell @Fleker