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
7f177087
Unverified
Commit
7f177087
authored
Oct 28, 2021
by
嘟囔
Committed by
GitHub
Oct 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: migrate ios/bitcode.dart to null safety (#92557)
parent
9d263866
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
bitcode.dart
packages/flutter_tools/lib/src/ios/bitcode.dart
+15
-15
No files found.
packages/flutter_tools/lib/src/ios/bitcode.dart
View file @
7f177087
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import
'../artifacts.dart'
;
import
'../base/common.dart'
;
import
'../base/context.dart'
;
...
...
@@ -16,21 +14,23 @@ import '../macos/xcode.dart';
const
bool
kBitcodeEnabledDefault
=
false
;
Future
<
void
>
validateBitcode
(
BuildMode
buildMode
,
TargetPlatform
targetPlatform
,
EnvironmentType
environmentType
)
async
{
final
Artifacts
localArtifacts
=
globals
.
artifacts
;
final
String
flutterFrameworkPath
=
localArtifacts
.
getArtifactPath
(
final
Artifacts
?
localArtifacts
=
globals
.
artifacts
;
final
String
?
flutterFrameworkPath
=
localArtifacts
?
.
getArtifactPath
(
Artifact
.
flutterFramework
,
mode:
buildMode
,
platform:
targetPlatform
,
environmentType:
environmentType
,
);
final
Xcode
xcode
=
context
.
get
<
Xcode
>();
final
Xcode
?
xcode
=
context
.
get
<
Xcode
>();
final
RunResult
clangResult
=
await
xcode
.
clang
(<
String
>[
'--version'
]);
final
String
clangVersion
=
clangResult
.
stdout
.
split
(
'
\n
'
).
first
;
final
String
engineClangVersion
=
globals
.
plistParser
.
getValueFromFile
(
globals
.
fs
.
path
.
join
(
flutterFrameworkPath
,
'Info.plist'
),
'ClangVersion'
,
);
final
RunResult
?
clangResult
=
await
xcode
?.
clang
(<
String
>[
'--version'
]);
final
String
?
clangVersion
=
clangResult
?.
stdout
.
split
(
'
\n
'
).
first
;
final
String
?
engineClangVersion
=
flutterFrameworkPath
==
null
?
null
:
globals
.
plistParser
.
getValueFromFile
(
globals
.
fs
.
path
.
join
(
flutterFrameworkPath
,
'Info.plist'
),
'ClangVersion'
,
);
final
Version
engineClangSemVer
=
_parseVersionFromClang
(
engineClangVersion
);
final
Version
clangSemVer
=
_parseVersionFromClang
(
clangVersion
);
if
(
engineClangSemVer
>
clangSemVer
)
{
...
...
@@ -44,9 +44,9 @@ Future<void> validateBitcode(BuildMode buildMode, TargetPlatform targetPlatform,
}
}
Version
_parseVersionFromClang
(
String
clangVersion
)
{
Version
_parseVersionFromClang
(
String
?
clangVersion
)
{
final
RegExp
pattern
=
RegExp
(
r'Apple (LLVM|clang) version (\d+\.\d+\.\d+) '
);
void
_invalid
()
{
Never
_invalid
()
{
throwToolExit
(
'Unable to parse Clang version from "
$clangVersion
". '
'Expected a string like "Apple (LLVM|clang) #.#.# (clang-####.#.##.#)".'
);
}
...
...
@@ -54,11 +54,11 @@ Version _parseVersionFromClang(String clangVersion) {
if
(
clangVersion
==
null
||
clangVersion
.
isEmpty
)
{
_invalid
();
}
final
RegExpMatch
match
=
pattern
.
firstMatch
(
clangVersion
);
final
RegExpMatch
?
match
=
pattern
.
firstMatch
(
clangVersion
);
if
(
match
==
null
||
match
.
groupCount
!=
2
)
{
_invalid
();
}
final
Version
version
=
Version
.
parse
(
match
.
group
(
2
));
final
Version
?
version
=
Version
.
parse
(
match
.
group
(
2
));
if
(
version
==
null
)
{
_invalid
();
}
...
...
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