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
e9e7f44d
Commit
e9e7f44d
authored
Mar 03, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2379 from devoncarew/refactor_xcode
refactor to move an ios specific class out of globals.dart
parents
5e9f51a7
0fb288c5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
19 deletions
+9
-19
executable.dart
packages/flutter_tools/lib/executable.dart
+0
-2
globals.dart
packages/flutter_tools/lib/src/globals.dart
+0
-4
ios_workflow.dart
packages/flutter_tools/lib/src/ios/ios_workflow.dart
+5
-6
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+2
-5
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+2
-2
No files found.
packages/flutter_tools/lib/executable.dart
View file @
e9e7f44d
...
...
@@ -32,7 +32,6 @@ import 'src/commands/update_packages.dart';
import
'src/commands/upgrade.dart'
;
import
'src/device.dart'
;
import
'src/doctor.dart'
;
import
'src/ios/mac.dart'
;
import
'src/runner/flutter_command_runner.dart'
;
/// Main entry point for commands.
...
...
@@ -69,7 +68,6 @@ Future main(List<String> args) async {
context
[
Logger
]
=
new
StdoutLogger
();
context
[
DeviceManager
]
=
new
DeviceManager
();
Doctor
.
initGlobal
();
XCode
.
initGlobal
();
dynamic
result
=
await
runner
.
run
(
args
);
...
...
packages/flutter_tools/lib/src/globals.dart
View file @
e9e7f44d
...
...
@@ -7,16 +7,12 @@ import 'base/context.dart';
import
'base/logger.dart'
;
import
'device.dart'
;
import
'doctor.dart'
;
import
'ios/mac.dart'
;
DeviceManager
get
deviceManager
=>
context
[
DeviceManager
];
Logger
get
logger
=>
context
[
Logger
];
AndroidSdk
get
androidSdk
=>
context
[
AndroidSdk
];
Doctor
get
doctor
=>
context
[
Doctor
];
// Mac specific globals - will be null on other platforms.
XCode
get
xcode
=>
context
[
XCode
];
/// Display an error level message to the user. Commands should use this if they
/// fail in some way.
void
printError
(
String
message
,
[
StackTrace
stackTrace
])
=>
logger
.
printError
(
message
,
stackTrace
);
...
...
packages/flutter_tools/lib/src/ios/ios_workflow.dart
View file @
e9e7f44d
...
...
@@ -6,7 +6,6 @@ import 'dart:io';
import
'../base/process.dart'
;
import
'../doctor.dart'
;
import
'../globals.dart'
;
import
'mac.dart'
;
class
IOSWorkflow
extends
Workflow
{
...
...
@@ -15,11 +14,11 @@ class IOSWorkflow extends Workflow {
bool
get
appliesToHostPlatform
=>
Platform
.
isMacOS
;
// We need xcode (+simctl) to list simulator devices, and idevice_id to list real devices.
bool
get
canListDevices
=>
xcod
e
.
isInstalledAndMeetsVersionCheck
;
bool
get
canListDevices
=>
XCode
.
instanc
e
.
isInstalledAndMeetsVersionCheck
;
// We need xcode to launch simulator devices, and ideviceinstaller and ios-deploy
// for real devices.
bool
get
canLaunchDevices
=>
xcod
e
.
isInstalledAndMeetsVersionCheck
;
bool
get
canLaunchDevices
=>
XCode
.
instanc
e
.
isInstalledAndMeetsVersionCheck
;
ValidationResult
validate
()
{
Validator
iosValidator
=
new
Validator
(
...
...
@@ -28,15 +27,15 @@ class IOSWorkflow extends Workflow {
);
ValidationType
xcodeExists
()
{
return
xcod
e
.
isInstalled
?
ValidationType
.
installed
:
ValidationType
.
missing
;
return
XCode
.
instanc
e
.
isInstalled
?
ValidationType
.
installed
:
ValidationType
.
missing
;
};
ValidationType
xcodeVersionSatisfactory
()
{
return
xcod
e
.
isInstalledAndMeetsVersionCheck
?
ValidationType
.
installed
:
ValidationType
.
missing
;
return
XCode
.
instanc
e
.
isInstalledAndMeetsVersionCheck
?
ValidationType
.
installed
:
ValidationType
.
missing
;
};
ValidationType
xcodeEulaSigned
()
{
return
xcod
e
.
eulaSigned
?
ValidationType
.
installed
:
ValidationType
.
missing
;
return
XCode
.
instanc
e
.
eulaSigned
?
ValidationType
.
installed
:
ValidationType
.
missing
;
};
ValidationType
brewExists
()
{
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
e9e7f44d
...
...
@@ -18,15 +18,12 @@ import 'setup_xcodeproj.dart';
String
get
homeDirectory
=>
path
.
absolute
(
Platform
.
environment
[
'HOME'
]);
// TODO(devoncarew): Refactor functionality into XCode.
const
int
kXcodeRequiredVersionMajor
=
7
;
const
int
kXcodeRequiredVersionMinor
=
2
;
class
XCode
{
static
void
initGlobal
()
{
context
[
XCode
]
=
new
XCode
();
}
/// Returns [XCode] active in the current app context.
static
XCode
get
instance
=>
context
[
XCode
]
??
(
context
[
XCode
]
=
new
XCode
());
bool
get
isInstalledAndMeetsVersionCheck
=>
isInstalled
&&
xcodeVersionSatisfactory
;
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
e9e7f44d
...
...
@@ -38,7 +38,7 @@ class IOSSimulatorUtils {
}
List
<
IOSSimulator
>
getAttachedDevices
()
{
if
(!
xcod
e
.
isInstalledAndMeetsVersionCheck
)
if
(!
XCode
.
instanc
e
.
isInstalledAndMeetsVersionCheck
)
return
<
IOSSimulator
>[];
return
SimControl
.
instance
.
getConnectedDevices
().
map
((
SimDevice
device
)
{
...
...
@@ -320,7 +320,7 @@ class IOSSimulator extends Device {
if
(
clearLogs
)
this
.
clearLogs
();
if
(!(
await
_setupUpdatedApplicationBundle
(
app
,
toolchain
)))
if
(!(
await
_setupUpdatedApplicationBundle
(
app
,
toolchain
)))
return
false
;
// Prepare launch arguments.
...
...
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