Skip to content

Commit

Permalink
fix: ignore commented minSdkVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
BenVercammen committed Jun 7, 2022
1 parent e420c33 commit 11adaa9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/android.dart
Original file line number Diff line number Diff line change
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

0 comments on commit 11adaa9

Please sign in to comment.