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
c5056b95
Commit
c5056b95
authored
Feb 19, 2016
by
Chinmay Garde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iOS: In case Xcode is installed but the version is too old. Advise the user to update.
parent
a6f0c97a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
6 deletions
+71
-6
device_ios.dart
packages/flutter_tools/lib/src/ios/device_ios.dart
+1
-1
ios_workflow.dart
packages/flutter_tools/lib/src/ios/ios_workflow.dart
+30
-4
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+40
-1
No files found.
packages/flutter_tools/lib/src/ios/device_ios.dart
View file @
c5056b95
...
...
@@ -248,7 +248,7 @@ class IOSSimulator extends Device {
IOSSimulator
(
String
id
,
{
this
.
name
})
:
super
(
id
);
static
List
<
IOSSimulator
>
getAttachedDevices
()
{
if
(!
xcode
.
isInstalled
)
if
(!
xcode
.
isInstalled
AndMeetsVersionCheck
)
return
<
IOSSimulator
>[];
return
SimControl
.
getConnectedDevices
().
map
((
SimDevice
device
)
{
...
...
packages/flutter_tools/lib/src/ios/ios_workflow.dart
View file @
c5056b95
...
...
@@ -7,6 +7,7 @@ import 'dart:io';
import
'../base/process.dart'
;
import
'../doctor.dart'
;
import
'../globals.dart'
;
import
'mac.dart'
;
class
IOSWorkflow
extends
Workflow
{
IOSWorkflow
()
:
super
(
'iOS'
);
...
...
@@ -14,11 +15,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
=>
xcode
.
isInstalled
;
bool
get
canListDevices
=>
xcode
.
isInstalled
AndMeetsVersionCheck
;
// We need xcode to launch simulator devices, and ideviceinstaller and ios-deploy
// for real devices.
bool
get
canLaunchDevices
=>
xcode
.
isInstalled
;
bool
get
canLaunchDevices
=>
xcode
.
isInstalled
AndMeetsVersionCheck
;
ValidationResult
validate
()
{
Validator
iosValidator
=
new
Validator
(
...
...
@@ -27,7 +28,23 @@ class IOSWorkflow extends Workflow {
);
Function
_xcodeExists
=
()
{
return
xcode
.
isInstalled
?
ValidationType
.
installed
:
ValidationType
.
missing
;
if
(
xcode
.
isInstalledAndMeetsVersionCheck
)
{
return
ValidationType
.
installed
;
}
if
(
xcode
.
isInstalled
)
{
return
ValidationType
.
partial
;
}
return
ValidationType
.
missing
;
};
Function
_xcodeVersionSatisfacotry
=
()
{
if
(
xcode
.
isInstalledAndMeetsVersionCheck
)
{
return
ValidationType
.
installed
;
}
return
ValidationType
.
missing
;
};
Function
_brewExists
=
()
{
...
...
@@ -44,11 +61,20 @@ class IOSWorkflow extends Workflow {
return
hasIdeviceId
?
ValidationType
.
installed
:
ValidationType
.
missing
;
};
iosValidator
.
addValidator
(
new
Validator
(
Validator
xcodeValidator
=
new
Validator
(
'XCode'
,
description:
'enable development for iOS devices'
,
resolution:
'Download at https://developer.apple.com/xcode/download/'
,
validatorFunction:
_xcodeExists
);
iosValidator
.
addValidator
(
xcodeValidator
);
xcodeValidator
.
addValidator
(
new
Validator
(
'XCode'
,
description:
'Xcode version is at least
$kXcodeRequiredVersionMajor
.
$kXcodeRequiredVersionMinor
'
,
resolution:
'Download the latest version or update via the Mac App Store'
,
validatorFunction:
_xcodeVersionSatisfacotry
));
Validator
brewValidator
=
new
Validator
(
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
c5056b95
...
...
@@ -5,10 +5,49 @@
import
'../base/context.dart'
;
import
'../base/process.dart'
;
const
int
kXcodeRequiredVersionMajor
=
7
;
const
int
kXcodeRequiredVersionMinor
=
2
;
class
XCode
{
static
void
initGlobal
()
{
context
[
XCode
]
=
new
XCode
();
}
bool
get
isInstalled
=>
exitsHappy
(<
String
>[
'xcode-select'
,
'--print-path'
]);
bool
get
isInstalledAndMeetsVersionCheck
=>
isInstalled
&&
xcodeVersionSatisfactory
;
bool
_isInstalled
;
bool
get
isInstalled
{
if
(
_isInstalled
!=
null
)
{
return
_isInstalled
;
}
_isInstalled
=
exitsHappy
(<
String
>[
'xcode-select'
,
'--print-path'
]);
return
_isInstalled
;
}
bool
_xcodeVersionSatisfactory
;
bool
get
xcodeVersionSatisfactory
{
if
(
_xcodeVersionSatisfactory
!=
null
)
{
return
_xcodeVersionSatisfactory
;
}
try
{
String
output
=
runSync
(<
String
>[
'xcodebuild'
,
'-version'
]);
RegExp
regex
=
new
RegExp
(
r'Xcode ([0-9.]+)'
);
String
version
=
regex
.
firstMatch
(
output
).
group
(
1
);
List
<
String
>
components
=
version
.
split
(
'.'
);
int
major
=
int
.
parse
(
components
[
0
]);
int
minor
=
components
.
length
==
1
?
0
:
int
.
parse
(
components
[
1
]);
_xcodeVersionSatisfactory
=
major
>=
kXcodeRequiredVersionMajor
&&
minor
>=
kXcodeRequiredVersionMinor
;
return
_xcodeVersionSatisfactory
;
}
catch
(
error
)
{
_xcodeVersionSatisfactory
=
false
;
return
false
;
}
return
false
;
}
}
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