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

fix: ignore commented minSdkVersion #365

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/android.dart
Expand Up @@ -317,6 +317,10 @@ int getMinSdkFromFile(File file) {
final List<String> lines = file.readAsLinesSync();
for (String line in lines) {
if (line.contains('minSdkVersion')) {
if (line.contains('//') && line.indexOf('//') < line.indexOf('minSdkVersion')) {
// This line is commented
continue;
}
// remove anything from the line that is not a digit
final String minSdk = line.replaceAll(RegExp(r'[^\d]'), '');
// when minSdkVersion value not found
Expand Down