cli
cli copied to clipboard
fix: be able to read more complex buildToolsVersion definitions
Summary:
As highlighted in https://github.com/react-native-community/cli/issues/2221, the way some projects (like expo ones) define the buildToolsVersion is breaking react-native doctor.
buildscript {
ext {
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
...
leads to buildToolsVersion => .b34.0.0.
The PR is slightly tweaking the parsing to account for those cases.
Test Plan:
- A new test has been added to demonstrate code is now able to properly read the
buildToolsVersion - Existing tests are already covering the basic
buildToolsVersion = "a version"syntax
Checklist
- ~~[ ] Documentation is up to date to reflect these changes.~~ NA
- [x] Follows commit message convention described in CONTRIBUTING.md