-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
base: main
Are you sure you want to change the base?
Conversation
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly reverts a hardcoded compileSdkVersion
in the camera_android
plugin's build.gradle
file, replacing it with the flutter.compileSdkVersion
variable. This is the correct approach, ensuring the plugin respects the SDK version of the consuming Flutter application, which improves compatibility and maintainability. The change is sound and aligns with best practices for Flutter plugin development. I have no further comments.
if (!compileSdkLine.contains('flutter.compileSdkVersion') && minFlutterVersion! >= Version(3, 27, 0)) { | ||
printError('${indentation}Please use flutter.compileSdkVersion instead ' | ||
'of a hardcoded compileSdk version number'); | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return false; |
@@ -469,6 +471,11 @@ for more details.'''; | |||
return false; | |||
} | |||
} | |||
if (!compileSdkLine.contains('flutter.compileSdkVersion') && minFlutterVersion! >= Version(3, 27, 0)) { | |||
printError('${indentation}Please use flutter.compileSdkVersion instead ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
printError('${indentation}Please use flutter.compileSdkVersion instead ' | |
printError('${indentation}Warning: please use flutter.compileSdkVersion instead ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A useful warning requires some sort of message at the bottom of the gradle_check_command
output. Will probably have to look in package_looping_command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per my comment in the other PR, a message at the bottom of the output still won't really be a useful warning most of the time. We have printWarning
, which will cause a message in the summary at the end, but as it says in its docs:
/// Warnings are not surfaced in CI summaries, so this is only useful for
/// highlighting something when someone is already looking though the log
/// messages. DO NOT RELY on someone noticing a warning; instead, use it for
/// things that might be useful to someone debugging an unexpected result.
@@ -31,7 +31,7 @@ buildFeatures { | |||
buildConfig true | |||
} | |||
namespace 'io.flutter.plugins.camera' | |||
compileSdk = 36 | |||
compileSdk = flutter.compileSdkVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should get a package version bump since it affected clients.
@@ -469,6 +471,11 @@ for more details.'''; | |||
return false; | |||
} | |||
} | |||
if (!compileSdkLine.contains('flutter.compileSdkVersion') && minFlutterVersion! >= Version(3, 27, 0)) { | |||
printError('${indentation}Please use flutter.compileSdkVersion instead ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per my comment in the other PR, a message at the bottom of the output still won't really be a useful warning most of the time. We have printWarning
, which will cause a message in the summary at the end, but as it says in its docs:
/// Warnings are not surfaced in CI summaries, so this is only useful for
/// highlighting something when someone is already looking though the log
/// messages. DO NOT RELY on someone noticing a warning; instead, use it for
/// things that might be useful to someone debugging an unexpected result.
Merged hardcoded compileSdkVersion instead of using
flutter.compileSdkVersion
. Reverting back toflutter.compileSdkVersion
.Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assist
bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3