-
Notifications
You must be signed in to change notification settings - Fork 520
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
Fix #4644: Set custom protobuf artifact for macOS #4675
Conversation
Changed the conditional check for the 'protobuf_platform' property from checking for property presence to checking for the current os. This is because `project.rootProject.hasProperty('protobuf_platform')` does not actually read the properties file as it is meant to, therefore the if condition was never met and the artifact was never set correctly. Changed how the property is read by loading the local.properties file with inputstream.
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.
Nice catch! I just had one comment, but otherwise need to see CI fully passing before this can be merged. PTAL @adhiamboperes at the new comment.
This should help prevent potential resource leaks should the file grow big.
I added a close operation to the inputStream. PTAL @BenHenning at the new commit. |
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.
Thanks @adhiamboperes! This LGTM.
Explanation
Fix #4644:
Changed the conditional check for the
protobuf_platform
property from checking for property presence to checking for the current os. This is becauseproject.rootProject.hasProperty('protobuf_platform')
does not actually read the properties file as it is meant to, therefore the if condition was never met and the artifact was never set correctly.I tested the existing implementaion by adding in build.gradle:
println project.rootProject.property('protobuf_platform')
This throws an error:
Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'protobuf_platform' for root project 'oppia-android' of type org.gradle.api.Project.
Which shows that the current solution for reading the property from l
ocal.properties
file does not work correctly.This solution changes how the property is read by loading the local.properties file with inputstream.
Essential Checklist