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
65159afb
Unverified
Commit
65159afb
authored
Sep 28, 2020
by
Jenn Magder
Committed by
GitHub
Sep 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force plugins to inherit minimum iOS version from Flutter app (#66590)
parent
14722d31
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
5 deletions
+55
-5
plugin_tests.dart
dev/devicelab/lib/tasks/plugin_tests.dart
+39
-4
podhelper.rb
packages/flutter_tools/bin/podhelper.rb
+10
-1
build.dart
packages/flutter_tools/lib/src/base/build.dart
+6
-0
No files found.
dev/devicelab/lib/tasks/plugin_tests.dart
View file @
65159afb
...
@@ -37,12 +37,12 @@ class PluginTest {
...
@@ -37,12 +37,12 @@ class PluginTest {
try
{
try
{
section
(
'Create plugin'
);
section
(
'Create plugin'
);
final
_FlutterProject
plugin
=
await
_FlutterProject
.
create
(
final
_FlutterProject
plugin
=
await
_FlutterProject
.
create
(
tempDir
,
options
,
tempDir
,
options
,
buildTarget
,
name:
'plugintest'
,
template:
'plugin'
,
environment:
pluginCreateEnvironment
);
name:
'plugintest'
,
template:
'plugin'
,
environment:
pluginCreateEnvironment
);
section
(
'Test plugin'
);
section
(
'Test plugin'
);
await
plugin
.
test
();
await
plugin
.
test
();
section
(
'Create Flutter app'
);
section
(
'Create Flutter app'
);
final
_FlutterProject
app
=
await
_FlutterProject
.
create
(
tempDir
,
options
,
final
_FlutterProject
app
=
await
_FlutterProject
.
create
(
tempDir
,
options
,
buildTarget
,
name:
'plugintestapp'
,
template:
'app'
,
environment:
appCreateEnvironment
);
name:
'plugintestapp'
,
template:
'app'
,
environment:
appCreateEnvironment
);
try
{
try
{
section
(
'Add plugins'
);
section
(
'Add plugins'
);
...
@@ -95,6 +95,7 @@ class _FlutterProject {
...
@@ -95,6 +95,7 @@ class _FlutterProject {
static
Future
<
_FlutterProject
>
create
(
static
Future
<
_FlutterProject
>
create
(
Directory
directory
,
Directory
directory
,
List
<
String
>
options
,
List
<
String
>
options
,
String
target
,
{
{
String
name
,
String
name
,
String
template
,
String
template
,
...
@@ -113,12 +114,46 @@ class _FlutterProject {
...
@@ -113,12 +114,46 @@ class _FlutterProject {
environment:
environment
,
environment:
environment
,
);
);
});
});
return
_FlutterProject
(
directory
,
name
);
final
_FlutterProject
project
=
_FlutterProject
(
directory
,
name
);
if
(
template
==
'plugin'
&&
target
==
'ios'
)
{
project
.
_reduceIOSPluginMinimumVersion
(
name
);
}
return
project
;
}
// Make the platform version artificially low to test that the "deployment
// version too low" warning is never emitted.
void
_reduceIOSPluginMinimumVersion
(
String
plugin
)
{
final
File
podspec
=
File
(
path
.
join
(
rootPath
,
'ios'
,
'
$plugin
.podspec'
));
if
(!
podspec
.
existsSync
())
{
throw
TaskResult
.
failure
(
'podspec file missing at
${podspec.path}
'
);
}
const
String
versionString
=
"s.platform = :ios, '8.0'"
;
String
podspecContent
=
podspec
.
readAsStringSync
();
if
(!
podspecContent
.
contains
(
versionString
))
{
throw
TaskResult
.
failure
(
'Update this test to match plugin minimum iOS deployment version'
);
}
podspecContent
=
podspecContent
.
replaceFirst
(
versionString
,
"s.platform = :ios, '7.0'"
,
);
podspec
.
writeAsStringSync
(
podspecContent
,
flush:
true
);
}
}
Future
<
void
>
build
(
String
target
)
async
{
Future
<
void
>
build
(
String
target
)
async
{
await
inDirectory
(
Directory
(
rootPath
),
()
async
{
await
inDirectory
(
Directory
(
rootPath
),
()
async
{
await
flutter
(
'build'
,
options:
<
String
>[
target
]);
final
String
buildOutput
=
await
evalFlutter
(
'build'
,
options:
<
String
>[
target
,
'-v'
]);
if
(
target
==
'ios'
)
{
// This warning is confusing and shouldn't be emitted. Plugins often support lower versions than the
// Flutter app, but as long as they support the minimum it will work.
// warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0,
// but the range of supported deployment target versions is 9.0 to 14.0.99.
if
(
buildOutput
.
contains
(
'the range of supported deployment target versions'
))
{
throw
TaskResult
.
failure
(
'Minimum plugin version warning present'
);
}
}
});
});
}
}
...
...
packages/flutter_tools/bin/podhelper.rb
View file @
65159afb
...
@@ -27,8 +27,17 @@ end
...
@@ -27,8 +27,17 @@ end
# end
# end
# @param [PBXAggregateTarget] target Pod target.
# @param [PBXAggregateTarget] target Pod target.
def
flutter_additional_ios_build_settings
(
target
)
def
flutter_additional_ios_build_settings
(
target
)
return
unless
target
.
platform_name
==
:ios
# [target.deployment_target] is a [String] formatted as "8.0".
inherit_deployment_target
=
target
.
deployment_target
[
/\d+/
].
to_i
<
9
target
.
build_configurations
.
each
do
|
build_configuration
|
target
.
build_configurations
.
each
do
|
build_configuration
|
build_configuration
.
build_settings
[
'ENABLE_BITCODE'
]
=
'NO'
build_configuration
.
build_settings
[
'ENABLE_BITCODE'
]
=
'NO'
# Suppress warning when pod supports a version lower than the minimum supported by Xcode (Xcode 12 - iOS 9).
# This warning is harmless but confusing--it's not a bad thing for dependencies to support a lower version.
# When deleted, the deployment version will inherit from the higher version derived from the 'Runner' target.
# If the pod only supports a higher version, do not delete to correctly produce an error.
build_configuration
.
build_settings
.
delete
'IPHONEOS_DEPLOYMENT_TARGET'
if
inherit_deployment_target
end
end
end
end
...
...
packages/flutter_tools/lib/src/base/build.dart
View file @
65159afb
...
@@ -240,6 +240,12 @@ class AOTSnapshotter {
...
@@ -240,6 +240,12 @@ class AOTSnapshotter {
final
List
<
String
>
commonBuildOptions
=
<
String
>[
final
List
<
String
>
commonBuildOptions
=
<
String
>[
'-arch'
,
targetArch
,
'-arch'
,
targetArch
,
if
(
isIOS
)
if
(
isIOS
)
// When the minimum version is updated, remember to update
// template IPHONEOS_DEPLOYMENT_TARGET and MinimumOSVersion.
// https://github.com/flutter/flutter/pull/62902
// Also update the podhelper.rb "deployment version too low"
// warning suppression version.
// https://github.com/flutter/flutter/pull/66590
'-miphoneos-version-min=9.0'
,
'-miphoneos-version-min=9.0'
,
];
];
...
...
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