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

Using together with protobuf-gradle-plugin #17

Open
Audrius-GR opened this issue Apr 30, 2019 · 0 comments
Open

Using together with protobuf-gradle-plugin #17

Audrius-GR opened this issue Apr 30, 2019 · 0 comments

Comments

@Audrius-GR
Copy link

So I am trying to write my own plugin that applies both the protobuf-gradle-plugin plugin, and your plugin.

The project in question extends FieldOptions in the protobuf "standard library" so I have com.google.protobuf:protobuf-java:3.7.1 as a compile dependency, which protobuf-gradle-plugin picks up correctly as an include.

It seems that the scala plugin picks it up too, but extracts it, and includes in the compilation path (it only needs to include it in the include path), so my jar ends up with a bunch of "com.google" classes that are not mine.

This is my plugin code:

        project.getPlugins().apply("com.charlesahunt.scalapb");
        ScalaPBPluginExtension scalaPBPluginExtension = project.getExtensions().getByType(ScalaPBPluginExtension.class);
        scalaPBPluginExtension.setGrpc(myExtension.getGrpc());
        scalaPBPluginExtension.setProtocVersion("-v350");
        scalaPBPluginExtension.setEmbeddedProtoc(true);
        scalaPBPluginExtension.setProjectProtoSourceDir("src/main/proto");
        scalaPBPluginExtension.setTargetDir("build/generated/source/proto/main/scala")
        scalaPBPluginExtension.setExtractedIncludeDir("build/extracted-include-protos/main");

I tried adding

scalaPBPluginExtension.getDependencySpec().exclude("**/google/**");

but that doesn't seem to do anything. As a matter of fact, even .exclude("**") doesn't do anything.

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

1 participant