-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -428,6 +428,15 @@ for more details.'''; | |||||
final RegExp legacySettingPattern = RegExp(r'^\s*compileSdkVersion'); | ||||||
final String? compileSdkLine = gradleLines | ||||||
.firstWhereOrNull((String line) => linePattern.hasMatch(line)); | ||||||
|
||||||
final Pubspec pubspec = package.parsePubspec(); | ||||||
final VersionConstraint? flutterConstraint = | ||||||
pubspec.environment['flutter']; | ||||||
final Version? minFlutterVersion = | ||||||
flutterConstraint != null && flutterConstraint is VersionRange | ||||||
? flutterConstraint.min | ||||||
: null; | ||||||
|
||||||
if (compileSdkLine == null) { | ||||||
// Equals regex not found check for method pattern. | ||||||
final RegExp compileSpacePattern = RegExp(r'^\s*compileSdk'); | ||||||
|
@@ -447,13 +456,6 @@ for more details.'''; | |||||
return false; | ||||||
} | ||||||
if (compileSdkLine.contains('flutter.compileSdkVersion')) { | ||||||
final Pubspec pubspec = package.parsePubspec(); | ||||||
final VersionConstraint? flutterConstraint = | ||||||
pubspec.environment['flutter']; | ||||||
final Version? minFlutterVersion = | ||||||
flutterConstraint != null && flutterConstraint is VersionRange | ||||||
? flutterConstraint.min | ||||||
: null; | ||||||
if (minFlutterVersion == null) { | ||||||
printError('${indentation}Unable to find a Flutter SDK version ' | ||||||
'constraint. Use of flutter.compileSdkVersion requires a minimum ' | ||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||||||
'of a hardcoded compileSdk version number'); | ||||||
return false; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
return true; | ||||||
} | ||||||
|
||||||
|
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.