-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Revert hardcoded compilesdk back to flutter.compileSdkVersion in camera_android
#9668
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4690dc4
revert hardcoded compilesdk back to flutter.compileSdkVersion
jesswrd f8f999c
added check for hardcoding compilesdk version number
jesswrd eb5f109
Merge remote-tracking branch 'upstream/main' into use-compileSdkVersion
camsim99 1e12eec
Bump version
camsim99 72c63df
add check for below min flutter sdk version
camsim99 2d83876
test for main message
camsim99 ef09abb
format
camsim99 139e5cd
Merge remote-tracking branch 'upstream/main' into use-compileSdkVersion
camsim99 459ef39
fix typo
camsim99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -427,6 +427,7 @@ for more details.'''; | |
| final RegExp legacySettingPattern = RegExp(r'^\s*compileSdkVersion'); | ||
| final String? compileSdkLine = gradleLines | ||
| .firstWhereOrNull((String line) => linePattern.hasMatch(line)); | ||
|
|
||
| if (compileSdkLine == null) { | ||
| // Equals regex not found check for method pattern. | ||
| final RegExp compileSpacePattern = RegExp(r'^\s*compileSdk'); | ||
|
|
@@ -467,6 +468,28 @@ for more details.'''; | |
| 'version to at least 3.27.'); | ||
| return false; | ||
| } | ||
| } else { | ||
| // Extract compileSdkVersion and check if it higher than flutter.compileSdkVersion. | ||
|
||
| final RegExp numericVersionPattern = RegExp(r'=\s*(\d+)'); | ||
| final RegExpMatch? versionMatch = | ||
| numericVersionPattern.firstMatch(compileSdkLine); | ||
|
|
||
| if (versionMatch != null) { | ||
| final int compileSdkVersion = int.parse(versionMatch.group(1)!); | ||
| const int minCompileSdkVersion = 36; | ||
|
|
||
| if (compileSdkVersion < minCompileSdkVersion) { | ||
| printError( | ||
| '${indentation}compileSdk version $compileSdkVersion is too low. ' | ||
| 'Minimum required version is $minCompileSdkVersion.\n' | ||
| "${indentation}Please update this package's compileSdkVersion to at least " | ||
| '$minCompileSdkVersion or use flutter.compileSdkVersion.'); | ||
| return false; | ||
| } | ||
| } else { | ||
| printError('${indentation}Unable to parse compileSdk version number.'); | ||
| return false; | ||
| } | ||
| } | ||
| return true; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.