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

gRPC gradle plugin rework #983

Merged
merged 1 commit into from Mar 26, 2020
Merged

Conversation

@Scottmitch
Copy link
Member

Scottmitch commented Mar 25, 2020

Motivation:
0ebe48e divided the
servicetalk-grpc-gradle plugin into two files:

  1. an executable script
  2. an uber jar with the plugin logic
    The executable script assumed the uber jar would be co-located in the
    same directory as the uber jar, but that isn't the case in gradle
    caches. This means the plugin may fail to execute outside of the maven
    m2 repository structure.

Modifications:

  • Instead of publishing a static script for each platform which assumes
    a co-located uber jar, dynamically generate the executable script
    depending upon where the uber jar is resolved from for the local build.

Result:
servicetalk-grpc-gradle works with gradle cache directory structure and
local development.

@Scottmitch Scottmitch requested a review from idelpivnitskiy Mar 25, 2020
@Scottmitch Scottmitch force-pushed the Scottmitch:grpc_plugin_deps branch from 3e72295 to 0cb7da2 Mar 25, 2020
File scriptExecutableFile
try {
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
scriptExecutableFile = File.createTempFile(scriptNamePrefix, ".bat")

This comment has been minimized.

Copy link
@Scottmitch

Scottmitch Mar 25, 2020

Author Member

generation of temp files is not ideal ... but a reliable way to make sure we use the jar file that is actually resolved for each build. I'm open to alternatives @idelpivnitskiy

This comment has been minimized.

Copy link
@idelpivnitskiy

idelpivnitskiy Mar 26, 2020

Member

how grpc-java solves this issue?

This comment has been minimized.

Copy link
@Scottmitch

Scottmitch Mar 26, 2020

Author Member

they don't have to deal with this because they write their plugin in c++ and publish a single executable for each platform.

@Scottmitch Scottmitch force-pushed the Scottmitch:grpc_plugin_deps branch from 0cb7da2 to bf58a81 Mar 26, 2020
File scriptExecutableFile
try {
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
scriptExecutableFile = File.createTempFile(scriptNamePrefix, ".bat")

This comment has been minimized.

Copy link
@idelpivnitskiy

idelpivnitskiy Mar 26, 2020

Member

how grpc-java solves this issue?

@Scottmitch

This comment has been minimized.

Copy link
Member Author

Scottmitch commented Mar 26, 2020

build failure attributed to #744

@Scottmitch

This comment has been minimized.

Copy link
Member Author

Scottmitch commented Mar 26, 2020

@servicetalk-bot test this please

Motivation:
0ebe48e divided the
servicetalk-grpc-gradle plugin into two files:
1. an executable script
2. an uber jar with the plugin logic
The executable script assumed the uber jar would be co-located in the
same directory as the uber jar, but that isn't the case in gradle
caches. This means the plugin may fail to execute outside of the maven
m2 repository structure.

Modifications:
- Instead of publishing a static script for each platform which assumes
a co-located uber jar, dynamically generate the executable script
depending upon where the uber jar is resolved from for the local build.

Result:
servicetalk-grpc-gradle works with gradle cache directory structure and
local development.
@Scottmitch Scottmitch force-pushed the Scottmitch:grpc_plugin_deps branch from 30b4f2c to 5cceef5 Mar 26, 2020
@Scottmitch

This comment has been minimized.

Copy link
Member Author

Scottmitch commented Mar 26, 2020

another failure attributed to #744

@Scottmitch Scottmitch merged commit 4a85c39 into apple:master Mar 26, 2020
3 checks passed
3 checks passed
pull request validation (jdk11) Build finished.
Details
pull request validation (jdk8) Build finished.
Details
pull request validation (quality) Build finished.
Details
@Scottmitch Scottmitch deleted the Scottmitch:grpc_plugin_deps branch Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.