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
5a41374a
Unverified
Commit
5a41374a
authored
Oct 10, 2019
by
Lau Ching Jun
Committed by
GitHub
Oct 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to precache unsigned mac binaries. (#42376)
parent
02470fe2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
cache.dart
packages/flutter_tools/lib/src/cache.dart
+7
-2
precache.dart
packages/flutter_tools/lib/src/commands/precache.dart
+5
-0
cache_test.dart
packages/flutter_tools/test/general.shard/cache_test.dart
+26
-0
No files found.
packages/flutter_tools/lib/src/cache.dart
View file @
5a41374a
...
...
@@ -128,6 +128,9 @@ class Cache {
// artifacts for the current platform.
bool
includeAllPlatforms
=
false
;
// Whether to cache the unsigned mac binaries. Defaults to caching the signed binaries.
bool
useUnsignedMacBinaries
=
false
;
static
RandomAccessFile
_lock
;
static
bool
_lockEnabled
=
true
;
...
...
@@ -1101,12 +1104,14 @@ class IosUsbArtifacts extends CachedArtifact {
@override
Future
<
void
>
updateInner
()
{
if
(!
platform
.
isMacOS
)
{
if
(!
platform
.
isMacOS
&&
!
cache
.
includeAllPlatforms
)
{
return
Future
<
void
>.
value
();
}
final
Uri
archiveUri
=
Uri
.
parse
(
'
$_storageBaseUrl
/flutter_infra/ios-usb-dependencies/
$name
/
$version
/
$name
.zip'
);
return
_downloadZipArchive
(
'Downloading
$name
...'
,
archiveUri
,
location
);
}
@visibleForTesting
Uri
get
archiveUri
=>
Uri
.
parse
(
'
$_storageBaseUrl
/flutter_infra/ios-usb-dependencies
${cache.useUnsignedMacBinaries ? '/unsigned' : ''}
/
$name
/
$version
/
$name
.zip'
);
}
// Many characters are problematic in filenames, especially on Windows.
...
...
packages/flutter_tools/lib/src/commands/precache.dart
View file @
5a41374a
...
...
@@ -44,6 +44,8 @@ class PrecacheCommand extends FlutterCommand {
help:
'Precache artifacts required for any development platform.'
);
argParser
.
addFlag
(
'flutter_runner'
,
negatable:
true
,
defaultsTo:
false
,
help:
'Precache the flutter runner artifacts.'
,
hide:
true
);
argParser
.
addFlag
(
'use-unsigned-mac-binaries'
,
negatable:
true
,
defaultsTo:
false
,
help:
'Precache the unsigned mac binaries when available.'
,
hide:
true
);
}
@override
...
...
@@ -60,6 +62,9 @@ class PrecacheCommand extends FlutterCommand {
if
(
argResults
[
'all-platforms'
])
{
cache
.
includeAllPlatforms
=
true
;
}
if
(
argResults
[
'use-unsigned-mac-binaries'
])
{
cache
.
useUnsignedMacBinaries
=
true
;
}
final
Set
<
DevelopmentArtifact
>
requiredArtifacts
=
<
DevelopmentArtifact
>{};
for
(
DevelopmentArtifact
artifact
in
DevelopmentArtifact
.
values
)
{
// Don't include unstable artifacts on stable branches.
...
...
packages/flutter_tools/test/general.shard/cache_test.dart
View file @
5a41374a
...
...
@@ -310,6 +310,32 @@ void main() {
ProcessManager:
()
=>
processManager
,
});
});
group
(
'Unsigned mac artifacts'
,
()
{
MockCache
mockCache
;
setUp
(()
{
mockCache
=
MockCache
();
});
testUsingContext
(
'use unsigned when specified'
,
()
async
{
when
(
mockCache
.
useUnsignedMacBinaries
).
thenReturn
(
true
);
final
IosUsbArtifacts
iosUsbArtifacts
=
IosUsbArtifacts
(
'name'
,
mockCache
);
expect
(
iosUsbArtifacts
.
archiveUri
.
toString
(),
contains
(
'/unsigned/'
));
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
mockCache
,
});
testUsingContext
(
'not use unsigned when not specified'
,
()
async
{
when
(
mockCache
.
useUnsignedMacBinaries
).
thenReturn
(
false
);
final
IosUsbArtifacts
iosUsbArtifacts
=
IosUsbArtifacts
(
'name'
,
mockCache
);
expect
(
iosUsbArtifacts
.
archiveUri
.
toString
(),
isNot
(
contains
(
'/unsigned/'
)));
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
mockCache
,
});
});
}
class
FakeCachedArtifact
extends
EngineCachedArtifact
{
...
...
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