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

refactor: simplify doFindLatestInstalledBuildTools #900

Merged
merged 4 commits into from
Jan 17, 2020

Conversation

raphinesse
Copy link
Contributor

@raphinesse raphinesse commented Jan 16, 2020

Motivation and Context

Just minor code cleanup

Description

  • simplify doFindLatestInstalledBuildTools
  • remove getAvailableBuildTools
  • update com.g00fy2:versioncompare
  • use string interpolation for error messages

Testing

npm t

Comment on lines 71 to 73
"No usable Android build tools found. Highest installed version is " +
highestBuildToolsVersion.getOriginalString() + "; minimum version required is " +
minBuildToolsVersionString + ".")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For informational purposes, since Gradle scripts are written in Groovy, using double quotations gives you string interpolation. String literals works 👍

These three lines could be written in one as,

"No usable Android build tools found. Highest installed version is ${highestBuildToolsVersion.getOriginalString()}; minimum version required is ${minBuildToolsVersionString}."

If this way is preferred just because the string is long, I would suggest single quotes so there is no string interpolation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a commit that uses string interpolation for the error messages while still avoiding line lengths of > 80 characters. What do you think of it?

Comment on lines 65 to 66
"No installed build tools found. Install the Android build tools version " +
minBuildToolsVersionString + " or higher.")
Copy link
Member

@erisu erisu Jan 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though this line is not touched, same could apply here as an example.

@raphinesse raphinesse requested a review from erisu January 17, 2020 10:24
@codecov-io
Copy link

Codecov Report

Merging #900 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #900   +/-   ##
=======================================
  Coverage   66.17%   66.17%           
=======================================
  Files          19       19           
  Lines        1839     1839           
=======================================
  Hits         1217     1217           
  Misses        622      622

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a951793...8046808. Read the comment docs.

@raphinesse raphinesse merged commit 66ad2c9 into apache:master Jan 17, 2020
@raphinesse raphinesse deleted the build-tools-version branch January 17, 2020 12:43
@erisu erisu added this to the 9.0.0 milestone Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants