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
be228eae
Commit
be228eae
authored
Jun 29, 2017
by
xster
Committed by
GitHub
Jun 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a dev mode doctor check (#11023)
parent
3045c289
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
ios_workflow.dart
packages/flutter_tools/lib/src/ios/ios_workflow.dart
+10
-0
ios_workflow_test.dart
packages/flutter_tools/test/ios/ios_workflow_test.dart
+20
-1
No files found.
packages/flutter_tools/lib/src/ios/ios_workflow.dart
View file @
be228eae
...
...
@@ -49,6 +49,8 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
Future
<
String
>
get
cocoaPodsVersionText
async
=>
(
await
runAsync
(<
String
>[
'pod'
,
'--version'
])).
processResult
.
stdout
.
trim
();
Future
<
String
>
get
macDevMode
async
=>
(
await
runAsync
(<
String
>[
'DevToolsSecurity'
,
'-status'
])).
processResult
.
stdout
;
Future
<
bool
>
get
_iosDeployIsInstalledAndMeetsVersionCheck
async
{
if
(!
await
hasIosDeploy
)
return
false
;
...
...
@@ -106,6 +108,14 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
'Xcode end user license agreement not signed; open Xcode or run the command
\'
sudo xcodebuild -license
\'
.'
));
}
if
((
await
macDevMode
).
contains
(
'disabled'
))
{
xcodeStatus
=
ValidationType
.
partial
;
messages
.
add
(
new
ValidationMessage
.
error
(
'Your Mac needs to enabled for developer mode before using Xcode for the first time.
\n
'
'Run
\'
sudo DevToolsSecurity -enable
\'
or open Xcode'
));
}
}
else
{
xcodeStatus
=
ValidationType
.
missing
;
if
(
xcode
.
xcodeSelectPath
==
null
||
xcode
.
xcodeSelectPath
.
isEmpty
)
{
...
...
packages/flutter_tools/test/ios/ios_workflow_test.dart
View file @
be228eae
...
...
@@ -96,6 +96,20 @@ void main() {
Xcode:
()
=>
xcode
,
});
testUsingContext
(
'Emits partial status when Mac dev mode was never enabled'
,
()
async
{
when
(
xcode
.
isInstalled
).
thenReturn
(
true
);
when
(
xcode
.
xcodeVersionText
)
.
thenReturn
(
'Xcode 8.2.1
\n
Build version 8C1002
\n
'
);
when
(
xcode
.
isInstalledAndMeetsVersionCheck
).
thenReturn
(
true
);
when
(
xcode
.
eulaSigned
).
thenReturn
(
true
);
final
IOSWorkflowTestTarget
workflow
=
new
IOSWorkflowTestTarget
(
macDevMode:
'Developer mode is currently disabled.'
);
final
ValidationResult
result
=
await
workflow
.
validate
();
expect
(
result
.
type
,
ValidationType
.
partial
);
},
overrides:
<
Type
,
Generator
>{
IMobileDevice:
()
=>
iMobileDevice
,
Xcode:
()
=>
xcode
,
});
testUsingContext
(
'Emits partial status when python six not installed'
,
()
async
{
when
(
xcode
.
isInstalled
).
thenReturn
(
true
);
when
(
xcode
.
xcodeVersionText
)
...
...
@@ -256,11 +270,13 @@ class IOSWorkflowTestTarget extends IOSWorkflow {
bool
hasIDeviceInstaller:
true
,
bool
hasCocoaPods:
true
,
String
cocoaPodsVersionText:
'1.2.0'
,
String
macDevMode:
'Developer mode is already enabled.'
,
})
:
hasIosDeploy
=
new
Future
<
bool
>.
value
(
hasIosDeploy
),
iosDeployVersionText
=
new
Future
<
String
>.
value
(
iosDeployVersionText
),
hasIDeviceInstaller
=
new
Future
<
bool
>.
value
(
hasIDeviceInstaller
),
hasCocoaPods
=
new
Future
<
bool
>.
value
(
hasCocoaPods
),
cocoaPodsVersionText
=
new
Future
<
String
>.
value
(
cocoaPodsVersionText
);
cocoaPodsVersionText
=
new
Future
<
String
>.
value
(
cocoaPodsVersionText
),
macDevMode
=
new
Future
<
String
>.
value
(
macDevMode
);
@override
final
bool
hasPythonSixModule
;
...
...
@@ -282,4 +298,7 @@ class IOSWorkflowTestTarget extends IOSWorkflow {
@override
final
Future
<
String
>
cocoaPodsVersionText
;
@override
final
Future
<
String
>
macDevMode
;
}
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