-
Notifications
You must be signed in to change notification settings - Fork 4
Simplify protoc plugin location #559
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
Conversation
# Conflicts: # license-report.md # pom.xml # version.gradle.kts
# Conflicts: # license-report.md
Codecov Report
@@ Coverage Diff @@
## master #559 +/- ##
============================================
+ Coverage 73.86% 73.96% +0.10%
Complexity 2968 2968
============================================
Files 507 506 -1
Lines 12009 11990 -19
Branches 672 671 -1
============================================
- Hits 8871 8869 -2
+ Misses 2911 2893 -18
- Partials 227 228 +1 |
@armiol, PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmdashenkov LGTM with a comment.
@@ -103,32 +99,13 @@ private void configureProtocTasks(GenerateProtoTaskCollection tasks) { | |||
* | |||
* @param plugins | |||
* container of all plugins | |||
* @param project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have a description. In particular, in the context of the current issue, it may be either a root project or a project of a child Gradle module.
Previously, Model Compiler downloaded the executable Jar with the
protoc
plugin into the.spine
directory. This solution is bad for several reasons. The primary one — as it has been discovered, it does not work with included builds.In this PR we simplify the process of locating the Jar. Just like before, there are two scripts (for Windows and for *nix), which launch the Jar (via the
java
CLI tool). Unlike before, those scripts are not Maven artifacts but resources of the Model Compiler. Also, the script resources contain a placeholder for the path to the Jar.To launch the plugin, Model Compiler resolves a dependency on the executable Jar and writes the appropriate script file into a temporary dir with the path to the resolved Jar. Then, Model Compiler configures the Protobuf Gradle plugin to launch the Spine
protoc
plugin via the written script file.The benefit of the new solution is that all the FS paths are absolute, i.e. there is no difference in who requests the plugin: a root project, a subproject or an included build.