Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
9136a474
Unverified
Commit
9136a474
authored
Mar 21, 2023
by
Victoria Ashworth
Committed by
GitHub
Mar 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set plugin template minimum iOS version to 11.0 (#122625)
Set plugin template minimum iOS version to 11.0
parent
783a367d
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
58 additions
and
32 deletions
+58
-32
plugin_tests.dart
dev/devicelab/lib/tasks/plugin_tests.dart
+1
-1
create_base.dart
packages/flutter_tools/lib/src/commands/create_base.dart
+0
-8
projectName.podspec.tmpl
...s/templates/plugin/ios-objc.tmpl/projectName.podspec.tmpl
+1
-1
projectName.podspec.tmpl
.../templates/plugin/ios-swift.tmpl/projectName.podspec.tmpl
+1
-1
projectName.podspec.tmpl
...ls/templates/plugin_ffi/ios.tmpl/projectName.podspec.tmpl
+1
-1
pubspec.yaml.tmpl
...s/flutter_tools/templates/plugin_shared/pubspec.yaml.tmpl
+1
-6
create_test.dart
...tter_tools/test/commands.shard/permeable/create_test.dart
+49
-3
IntegrationTestPlugin.m
...ages/integration_test/ios/Classes/IntegrationTestPlugin.m
+3
-10
integration_test.podspec
packages/integration_test/ios/integration_test.podspec
+1
-1
No files found.
dev/devicelab/lib/tasks/plugin_tests.dart
View file @
9136a474
...
...
@@ -346,7 +346,7 @@ public class $pluginClass: NSObject, FlutterPlugin {
throw
TaskResult
.
failure
(
'podspec file missing at
${podspec.path}
'
);
}
final
String
versionString
=
target
==
'ios'
?
"s.platform = :ios, '
9
.0'"
?
"s.platform = :ios, '
11
.0'"
:
"s.platform = :osx, '10.11'"
;
String
podspecContent
=
podspec
.
readAsStringSync
();
if
(!
podspecContent
.
contains
(
versionString
))
{
...
...
packages/flutter_tools/lib/src/commands/create_base.dart
View file @
9136a474
...
...
@@ -3,7 +3,6 @@
// found in the LICENSE file.
import
'package:meta/meta.dart'
;
import
'package:pub_semver/pub_semver.dart'
;
import
'package:uuid/uuid.dart'
;
import
'../android/android.dart'
as
android_common
;
...
...
@@ -381,12 +380,6 @@ abstract class CreateBase extends FlutterCommand {
// https://developer.gnome.org/gio/stable/GApplication.html#g-application-id-is-valid
final
String
linuxIdentifier
=
androidIdentifier
;
// TODO(dacoharkes): Replace with hardcoded version in template when Flutter 2.11 is released.
final
Version
ffiPluginStableRelease
=
Version
(
2
,
11
,
0
);
final
String
minFrameworkVersionFfiPlugin
=
Version
.
parse
(
globals
.
flutterVersion
.
frameworkVersion
)
<
ffiPluginStableRelease
?
globals
.
flutterVersion
.
frameworkVersion
:
ffiPluginStableRelease
.
toString
();
return
<
String
,
Object
?>{
'organization'
:
organization
,
'projectName'
:
projectName
,
...
...
@@ -416,7 +409,6 @@ abstract class CreateBase extends FlutterCommand {
'iosDevelopmentTeam'
:
iosDevelopmentTeam
??
''
,
'flutterRevision'
:
globals
.
flutterVersion
.
frameworkRevision
,
'flutterChannel'
:
globals
.
flutterVersion
.
channel
,
'minFrameworkVersionFfiPlugin'
:
minFrameworkVersionFfiPlugin
,
'ios'
:
ios
,
'android'
:
android
,
'web'
:
web
,
...
...
packages/flutter_tools/templates/plugin/ios-objc.tmpl/projectName.podspec.tmpl
View file @
9136a474
...
...
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.platform = :ios, '
9
.0'
s.platform = :ios, '
11
.0'
# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
...
...
packages/flutter_tools/templates/plugin/ios-swift.tmpl/projectName.podspec.tmpl
View file @
9136a474
...
...
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.platform = :ios, '
9
.0'
s.platform = :ios, '
11
.0'
# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
...
...
packages/flutter_tools/templates/plugin_ffi/ios.tmpl/projectName.podspec.tmpl
View file @
9136a474
...
...
@@ -20,7 +20,7 @@ Pod::Spec.new do |s|
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.platform = :ios, '
9
.0'
s.platform = :ios, '
11
.0'
# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
...
...
packages/flutter_tools/templates/plugin_shared/pubspec.yaml.tmpl
View file @
9136a474
...
...
@@ -5,12 +5,7 @@ homepage:
environment:
sdk: {{dartSdkVersionBounds}}
{{#withPlatformChannelPluginHook}}
flutter: ">=2.5.0"
{{/withPlatformChannelPluginHook}}
{{#withFfiPluginHook}}
flutter: ">={{minFrameworkVersionFfiPlugin}}"
{{/withFfiPluginHook}}
flutter: ">=3.3.0"
dependencies:
flutter:
...
...
packages/flutter_tools/test/commands.shard/permeable/create_test.dart
View file @
9136a474
...
...
@@ -2762,7 +2762,7 @@ void main() {
Logger:
()
=>
logger
,
});
testUsingContext
(
'newly created plugin has min flutter sdk version as
2.5
.0'
,
()
async
{
testUsingContext
(
'newly created plugin has min flutter sdk version as
3.3
.0'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
final
CreateCommand
command
=
CreateCommand
();
...
...
@@ -2771,8 +2771,54 @@ void main() {
final
String
rawPubspec
=
await
projectDir
.
childFile
(
'pubspec.yaml'
).
readAsString
();
final
Pubspec
pubspec
=
Pubspec
.
parse
(
rawPubspec
);
final
Map
<
String
,
VersionConstraint
?>
env
=
pubspec
.
environment
!;
expect
(
env
[
'flutter'
]!.
allows
(
Version
(
2
,
5
,
0
)),
true
);
expect
(
env
[
'flutter'
]!.
allows
(
Version
(
2
,
4
,
9
)),
false
);
expect
(
env
[
'flutter'
]!.
allows
(
Version
(
3
,
3
,
0
)),
true
);
expect
(
env
[
'flutter'
]!.
allows
(
Version
(
3
,
2
,
9
)),
false
);
});
testUsingContext
(
'newly created iOS plugins has min iOS version of 11.0'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
final
String
flutterToolsAbsolutePath
=
globals
.
fs
.
path
.
join
(
Cache
.
flutterRoot
!,
'packages'
,
'flutter_tools'
,
);
final
List
<
String
>
iosPluginTemplates
=
<
String
>[
globals
.
fs
.
path
.
join
(
flutterToolsAbsolutePath
,
'templates'
,
'plugin'
,
'ios-objc.tmpl'
,
'projectName.podspec.tmpl'
,
),
globals
.
fs
.
path
.
join
(
flutterToolsAbsolutePath
,
'templates'
,
'plugin'
,
'ios-swift.tmpl'
,
'projectName.podspec.tmpl'
,
),
globals
.
fs
.
path
.
join
(
flutterToolsAbsolutePath
,
'templates'
,
'plugin_ffi'
,
'ios.tmpl'
,
'projectName.podspec.tmpl'
,
),
];
for
(
final
String
templatePath
in
iosPluginTemplates
)
{
final
String
rawTemplate
=
globals
.
fs
.
file
(
templatePath
).
readAsStringSync
();
expect
(
rawTemplate
,
contains
(
"s.platform = :ios, '11.0'"
));
}
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=ios'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'ios'
).
childFile
(
'flutter_project.podspec'
),
exists
);
final
String
rawPodSpec
=
await
projectDir
.
childDirectory
(
'ios'
).
childFile
(
'flutter_project.podspec'
).
readAsString
();
expect
(
rawPodSpec
,
contains
(
"s.platform = :ios, '11.0'"
));
});
testUsingContext
(
'default app uses flutter default versions'
,
()
async
{
...
...
packages/integration_test/ios/Classes/IntegrationTestPlugin.m
View file @
9136a474
...
...
@@ -88,18 +88,11 @@ static NSString *const kMethodRevertImage = @"revertFlutterImage";
CGRect
screenshotBounds
=
window
.
bounds
;
UIImage
*
image
;
if
(
@available
(
iOS
10
,
*
))
{
UIGraphicsImageRenderer
*
renderer
=
[[
UIGraphicsImageRenderer
alloc
]
initWithBounds
:
screenshotBounds
];
UIGraphicsImageRenderer
*
renderer
=
[[
UIGraphicsImageRenderer
alloc
]
initWithBounds
:
screenshotBounds
];
image
=
[
renderer
imageWithActions
:
^
(
UIGraphicsImageRendererContext
*
rendererContext
)
{
[
window
drawViewHierarchyInRect
:
screenshotBounds
afterScreenUpdates
:
YES
];
}];
}
else
{
UIGraphicsBeginImageContextWithOptions
(
screenshotBounds
.
size
,
NO
,
UIScreen
.
mainScreen
.
scale
);
image
=
[
renderer
imageWithActions
:
^
(
UIGraphicsImageRendererContext
*
rendererContext
)
{
[
window
drawViewHierarchyInRect
:
screenshotBounds
afterScreenUpdates
:
YES
];
image
=
UIGraphicsGetImageFromCurrentImageContext
();
UIGraphicsEndImageContext
();
}
}];
return
image
;
}
...
...
packages/integration_test/ios/integration_test.podspec
View file @
9136a474
...
...
@@ -20,6 +20,6 @@ LICENSE
s
.
dependency
'Flutter'
s
.
ios
.
framework
=
'UIKit'
s
.
platform
=
:ios
,
'
9
.0'
s
.
platform
=
:ios
,
'
11
.0'
s
.
pod_target_xcconfig
=
{
'DEFINES_MODULE'
=>
'YES'
,
'EXCLUDED_ARCHS[sdk=iphonesimulator*]'
=>
'i386'
}
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment