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
ee845255
Unverified
Commit
ee845255
authored
Mar 18, 2020
by
Jenn Magder
Committed by
GitHub
Mar 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move XcodeProjectInterpreter to globals (#52847)
parent
e0ab6fc0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
14 additions
and
16 deletions
+14
-16
clean.dart
packages/flutter_tools/lib/src/commands/clean.dart
+2
-2
context_runner.dart
packages/flutter_tools/lib/src/context_runner.dart
+1
-1
globals.dart
packages/flutter_tools/lib/src/globals.dart
+2
-0
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+3
-3
xcodeproj.dart
packages/flutter_tools/lib/src/ios/xcodeproj.dart
+0
-3
build_macos.dart
packages/flutter_tools/lib/src/macos/build_macos.dart
+1
-1
cocoapods.dart
packages/flutter_tools/lib/src/macos/cocoapods.dart
+2
-3
project.dart
packages/flutter_tools/lib/src/project.dart
+2
-2
clean_test.dart
...lutter_tools/test/commands.shard/hermetic/clean_test.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/commands/clean.dart
View file @
ee845255
...
...
@@ -67,9 +67,9 @@ class CleanCommand extends FlutterCommand {
);
try
{
final
Directory
xcodeWorkspace
=
xcodeProject
.
xcodeWorkspace
;
final
XcodeProjectInfo
projectInfo
=
await
xcodeProjectInterpreter
.
getInfo
(
xcodeWorkspace
.
parent
.
path
);
final
XcodeProjectInfo
projectInfo
=
await
globals
.
xcodeProjectInterpreter
.
getInfo
(
xcodeWorkspace
.
parent
.
path
);
for
(
final
String
scheme
in
projectInfo
.
schemes
)
{
await
xcodeProjectInterpreter
.
cleanWorkspace
(
xcodeWorkspace
.
path
,
scheme
);
await
globals
.
xcodeProjectInterpreter
.
cleanWorkspace
(
xcodeWorkspace
.
path
,
scheme
);
}
}
on
Exception
catch
(
error
)
{
globals
.
printTrace
(
'Could not clean Xcode workspace:
$error
'
);
...
...
packages/flutter_tools/lib/src/context_runner.dart
View file @
ee845255
...
...
@@ -206,7 +206,7 @@ Future<T> runInContext<T>(
processManager:
globals
.
processManager
,
platform:
globals
.
platform
,
fileSystem:
globals
.
fs
,
xcodeProjectInterpreter:
xcodeProjectInterpreter
,
xcodeProjectInterpreter:
globals
.
xcodeProjectInterpreter
,
),
XCDevice:
()
=>
XCDevice
(
processManager:
globals
.
processManager
,
...
...
packages/flutter_tools/lib/src/globals.dart
View file @
ee845255
...
...
@@ -27,6 +27,7 @@ import 'ios/ios_workflow.dart';
import
'ios/mac.dart'
;
import
'ios/plist_parser.dart'
;
import
'ios/simulators.dart'
;
import
'ios/xcodeproj.dart'
;
import
'macos/xcode.dart'
;
import
'persistent_tool_state.dart'
;
import
'reporting/reporting.dart'
;
...
...
@@ -78,6 +79,7 @@ IOSWorkflow get iosWorkflow => context.get<IOSWorkflow>();
SimControl
get
simControl
=>
context
.
get
<
SimControl
>();
UserMessages
get
userMessages
=>
context
.
get
<
UserMessages
>();
Xcode
get
xcode
=>
context
.
get
<
Xcode
>();
XcodeProjectInterpreter
get
xcodeProjectInterpreter
=>
context
.
get
<
XcodeProjectInterpreter
>();
XCDevice
get
xcdevice
=>
context
.
get
<
XCDevice
>();
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
ee845255
...
...
@@ -104,7 +104,7 @@ Future<XcodeBuildResult> buildXcodeProject({
return
XcodeBuildResult
(
success:
false
);
}
final
XcodeProjectInfo
projectInfo
=
await
xcodeProjectInterpreter
.
getInfo
(
app
.
project
.
hostAppRoot
.
path
);
final
XcodeProjectInfo
projectInfo
=
await
globals
.
xcodeProjectInterpreter
.
getInfo
(
app
.
project
.
hostAppRoot
.
path
);
if
(!
projectInfo
.
targets
.
contains
(
'Runner'
))
{
globals
.
printError
(
'The Xcode project does not define target "Runner" which is needed by Flutter tooling.'
);
globals
.
printError
(
'Open Xcode to fix the problem:'
);
...
...
@@ -545,12 +545,12 @@ bool _checkXcodeVersion() {
if
(!
globals
.
platform
.
isMacOS
)
{
return
false
;
}
if
(!
xcodeProjectInterpreter
.
isInstalled
)
{
if
(!
globals
.
xcodeProjectInterpreter
.
isInstalled
)
{
globals
.
printError
(
'Cannot find "xcodebuild".
$_xcodeRequirement
'
);
return
false
;
}
if
(!
globals
.
xcode
.
isVersionSatisfactory
)
{
globals
.
printError
(
'Found "
${xcodeProjectInterpreter.versionText}
".
$_xcodeRequirement
'
);
globals
.
printError
(
'Found "
${
globals.
xcodeProjectInterpreter.versionText}
".
$_xcodeRequirement
'
);
return
false
;
}
return
true
;
...
...
packages/flutter_tools/lib/src/ios/xcodeproj.dart
View file @
ee845255
...
...
@@ -10,7 +10,6 @@ import 'package:process/process.dart';
import
'../artifacts.dart'
;
import
'../base/common.dart'
;
import
'../base/context.dart'
;
import
'../base/file_system.dart'
;
import
'../base/io.dart'
;
import
'../base/logger.dart'
;
...
...
@@ -243,8 +242,6 @@ List<String> _xcodeBuildSettingsLines({
return
xcodeBuildSettings
;
}
XcodeProjectInterpreter
get
xcodeProjectInterpreter
=>
context
.
get
<
XcodeProjectInterpreter
>();
/// Interpreter of Xcode projects.
class
XcodeProjectInterpreter
{
XcodeProjectInterpreter
({
...
...
packages/flutter_tools/lib/src/macos/build_macos.dart
View file @
ee845255
...
...
@@ -52,7 +52,7 @@ Future<void> buildMacOS({
// other Xcode projects in the macos/ directory. Otherwise pass no name, which will work
// regardless of the project name so long as there is exactly one project.
final
String
xcodeProjectName
=
xcodeProject
.
existsSync
()
?
xcodeProject
.
basename
:
null
;
final
XcodeProjectInfo
projectInfo
=
await
xcodeProjectInterpreter
.
getInfo
(
final
XcodeProjectInfo
projectInfo
=
await
globals
.
xcodeProjectInterpreter
.
getInfo
(
xcodeProject
.
parent
.
path
,
projectFilename:
xcodeProjectName
,
);
...
...
packages/flutter_tools/lib/src/macos/cocoapods.dart
View file @
ee845255
...
...
@@ -16,7 +16,6 @@ import '../base/process.dart';
import
'../base/version.dart'
;
import
'../cache.dart'
;
import
'../globals.dart'
as
globals
;
import
'../ios/xcodeproj.dart'
;
import
'../project.dart'
;
const
String
noCocoaPodsConsequence
=
'''
...
...
@@ -225,7 +224,7 @@ class CocoaPods {
/// contains a suitable `Podfile` and that its `Flutter/Xxx.xcconfig` files
/// include pods configuration.
Future
<
void
>
setupPodfile
(
XcodeBasedProject
xcodeProject
)
async
{
if
(!
xcodeProjectInterpreter
.
isInstalled
)
{
if
(!
globals
.
xcodeProjectInterpreter
.
isInstalled
)
{
// Don't do anything for iOS when host platform doesn't support it.
return
;
}
...
...
@@ -242,7 +241,7 @@ class CocoaPods {
if
(
xcodeProject
is
MacOSProject
)
{
podfileTemplateName
=
'Podfile-macos'
;
}
else
{
final
bool
isSwift
=
(
await
xcodeProjectInterpreter
.
getBuildSettings
(
final
bool
isSwift
=
(
await
globals
.
xcodeProjectInterpreter
.
getBuildSettings
(
runnerProject
.
path
,
'Runner'
,
)).
containsKey
(
'SWIFT_VERSION'
);
...
...
packages/flutter_tools/lib/src/project.dart
View file @
ee845255
...
...
@@ -441,11 +441,11 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
///
/// Returns null, if iOS tooling is unavailable.
Future<Map<String, String>> get buildSettings async {
if (!
xcode
.xcodeProjectInterpreter.isInstalled) {
if (!
globals
.xcodeProjectInterpreter.isInstalled) {
return null;
}
Map<String, String> buildSettings = _buildSettings;
buildSettings ??= await
xcode
.xcodeProjectInterpreter.getBuildSettings(
buildSettings ??= await
globals
.xcodeProjectInterpreter.getBuildSettings(
xcodeProject.path,
_hostAppBundleName,
);
...
...
packages/flutter_tools/test/commands.shard/hermetic/clean_test.dart
View file @
ee845255
...
...
@@ -72,7 +72,7 @@ void main() {
expect
(
projectUnderTest
.
macos
.
ephemeralDirectory
.
existsSync
(),
isFalse
);
expect
(
projectUnderTest
.
windows
.
ephemeralDirectory
.
existsSync
(),
isFalse
);
verify
(
x
codeProjectInterpreter
.
cleanWorkspace
(
any
,
'Runner'
)).
called
(
2
);
verify
(
mockX
codeProjectInterpreter
.
cleanWorkspace
(
any
,
'Runner'
)).
called
(
2
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
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