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
50da3bd0
Unverified
Commit
50da3bd0
authored
Oct 30, 2019
by
Jonah Williams
Committed by
GitHub
Oct 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check if libimobiledevice executables exist (#43767)
parent
28a214ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
1 deletion
+61
-1
cache.dart
packages/flutter_tools/lib/src/cache.dart
+28
-0
cache_test.dart
packages/flutter_tools/test/general.shard/cache_test.dart
+33
-1
No files found.
packages/flutter_tools/lib/src/cache.dart
View file @
50da3bd0
...
...
@@ -1103,6 +1103,17 @@ class IosUsbArtifacts extends CachedArtifact {
'libzip'
,
];
// For unknown reasons, users are getting into bad states where libimobiledevice is
// downloaded but some executables are missing from the zip. The names here are
// used for additional download checks below, so we can redownload if they are
// missing.
static
const
Map
<
String
,
List
<
String
>>
_kExecutables
=
<
String
,
List
<
String
>>{
'libimobiledevice'
:
<
String
>[
'idevice_id'
,
'ideviceinfo'
,
],
};
@override
Map
<
String
,
String
>
get
environment
{
return
<
String
,
String
>{
...
...
@@ -1110,11 +1121,28 @@ class IosUsbArtifacts extends CachedArtifact {
};
}
@override
bool
isUpToDateInner
()
{
final
List
<
String
>
executables
=
_kExecutables
[
name
];
if
(
executables
==
null
)
{
return
true
;
}
for
(
String
executable
in
executables
)
{
if
(!
location
.
childFile
(
executable
).
existsSync
())
{
return
false
;
}
}
return
true
;
}
@override
Future
<
void
>
updateInner
()
{
if
(!
platform
.
isMacOS
&&
!
cache
.
includeAllPlatforms
)
{
return
Future
<
void
>.
value
();
}
if
(
location
.
existsSync
())
{
location
.
deleteSync
(
recursive:
true
);
}
return
_downloadZipArchive
(
'Downloading
$name
...'
,
archiveUri
,
location
);
}
...
...
packages/flutter_tools/test/general.shard/cache_test.dart
View file @
50da3bd0
...
...
@@ -330,13 +330,45 @@ void main() {
});
});
group
(
'
Unsigned mac
artifacts'
,
()
{
group
(
'
macOS
artifacts'
,
()
{
MockCache
mockCache
;
setUp
(()
{
mockCache
=
MockCache
();
});
testUsingContext
(
'verifies executables for libimobiledevice in isUpToDateInner'
,
()
async
{
final
IosUsbArtifacts
iosUsbArtifacts
=
IosUsbArtifacts
(
'libimobiledevice'
,
mockCache
);
when
(
mockCache
.
getArtifactDirectory
(
any
)).
thenReturn
(
fs
.
currentDirectory
);
iosUsbArtifacts
.
location
.
createSync
();
final
File
ideviceIdFile
=
iosUsbArtifacts
.
location
.
childFile
(
'idevice_id'
)
..
createSync
();
iosUsbArtifacts
.
location
.
childFile
(
'ideviceinfo'
)
..
createSync
();
expect
(
iosUsbArtifacts
.
isUpToDateInner
(),
true
);
ideviceIdFile
.
deleteSync
();
expect
(
iosUsbArtifacts
.
isUpToDateInner
(),
false
);
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
mockCache
,
FileSystem:
()
=>
MemoryFileSystem
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'Does not verify executables for openssl in isUpToDateInner'
,
()
async
{
final
IosUsbArtifacts
iosUsbArtifacts
=
IosUsbArtifacts
(
'openssl'
,
mockCache
);
when
(
mockCache
.
getArtifactDirectory
(
any
)).
thenReturn
(
fs
.
currentDirectory
);
iosUsbArtifacts
.
location
.
createSync
();
expect
(
iosUsbArtifacts
.
isUpToDateInner
(),
true
);
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
mockCache
,
FileSystem:
()
=>
MemoryFileSystem
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'use unsigned when specified'
,
()
async
{
when
(
mockCache
.
useUnsignedMacBinaries
).
thenReturn
(
true
);
...
...
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