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

Tighter dependency for protoc plugin #2209

Merged
merged 3 commits into from
May 11, 2022
Merged

Conversation

bondolo
Copy link
Contributor

@bondolo bondolo commented May 10, 2022

Motivation:
Currently the servicetalk-grpc-protoc module exposes javapoet and
protobuf-java as dependencies though they are used only in the protoc
plugin and are not accurately dependencies of the module.

Modifications:
Use compileOnly for protoc plugin dependencies and change shadowJar
to build using compileClasspath configuration. The dependencies are
also needed for testImplementation.

Result:
Fewer exposed dependencies, especially dependency which is not
actually used by module outside of protoc plugin.

Motivation:
Currently the `servicetalk-grpc-protoc` module exposes javapoet and
protobuf-java as dependencies though they are used only in the protoc
plugin and are not accurately dependencies of the module.
Modifications:
Use `compileOnly` for protoc plugin dependencies and change shadowJar
to build using `compileClasspath` configuration. The dependencies are
also needed for `testImplementation`.
Result:
Fewer exposed dependencies, especially dependency which is not
actually used by module outside of protoc plugin.
@bondolo bondolo force-pushed the protoc-dependency branch from caa98e4 to 809e7f8 Compare May 10, 2022 21:15
@bondolo bondolo self-assigned this May 10, 2022
@bondolo bondolo added the enhancement New feature or request label May 10, 2022
@bondolo bondolo requested a review from idelpivnitskiy May 10, 2022 22:43
@bondolo bondolo merged commit 4ce81d5 into apple:main May 11, 2022
@bondolo bondolo deleted the protoc-dependency branch May 11, 2022 01:30
idelpivnitskiy added a commit to idelpivnitskiy/servicetalk that referenced this pull request May 13, 2022
Motivation:

`build.gradle` for grpc example uses `servicetalk-grpc-protoc-all`
artifact, but `pom.xml` uses `servicetalk-grpc-protoc`. After apple#2209,
maven example does not work anymore:

servicetalk-grpc-protoc_out: ServiceTalk code generation failed:
   java.lang.NoClassDefFoundError: com/squareup/javapoet/ClassName

Modifications:

- Use `<classifier>all</classifier>` to let maven use an uber jar;

Result:

Maven build works for grpc example.

Related:

servicetalk/examples#1
Scottmitch pushed a commit that referenced this pull request May 13, 2022
Motivation:

`build.gradle` for grpc example uses `servicetalk-grpc-protoc-all`
artifact, but `pom.xml` uses `servicetalk-grpc-protoc`. After #2209,
maven example does not work anymore:

servicetalk-grpc-protoc_out: ServiceTalk code generation failed:
   java.lang.NoClassDefFoundError: com/squareup/javapoet/ClassName

Modifications:

- Use `<classifier>all</classifier>` to let maven use an uber jar;

Result:

Maven build works for grpc example.

Related:

servicetalk/examples#1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants