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
0a59698e
Unverified
Commit
0a59698e
authored
Apr 06, 2021
by
Jonah Williams
Committed by
GitHub
Apr 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] migrate cache to null safety (#79864)
parent
4d1b74a0
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
140 additions
and
95 deletions
+140
-95
cache.dart
packages/flutter_tools/lib/src/cache.dart
+82
-67
build_ios_framework_test.dart
...est/commands.shard/hermetic/build_ios_framework_test.dart
+1
-0
devices_test.dart
...tter_tools/test/commands.shard/hermetic/devices_test.dart
+1
-1
install_test.dart
...tter_tools/test/commands.shard/hermetic/install_test.dart
+3
-3
run_test.dart
.../flutter_tools/test/commands.shard/hermetic/run_test.dart
+1
-1
cache_test.dart
packages/flutter_tools/test/general.shard/cache_test.dart
+37
-16
devices_test.dart
...es/flutter_tools/test/general.shard/ios/devices_test.dart
+5
-3
ios_deploy_test.dart
...flutter_tools/test/general.shard/ios/ios_deploy_test.dart
+1
-0
ios_device_install_test.dart
...tools/test/general.shard/ios/ios_device_install_test.dart
+1
-0
ios_device_logger_test.dart
..._tools/test/general.shard/ios/ios_device_logger_test.dart
+1
-1
ios_device_start_nonprebuilt_test.dart
.../general.shard/ios/ios_device_start_nonprebuilt_test.dart
+1
-0
ios_device_start_prebuilt_test.dart
...est/general.shard/ios/ios_device_start_prebuilt_test.dart
+1
-0
mac_test.dart
packages/flutter_tools/test/general.shard/ios/mac_test.dart
+3
-1
xcode_test.dart
...es/flutter_tools/test/general.shard/macos/xcode_test.dart
+2
-2
No files found.
packages/flutter_tools/lib/src/cache.dart
View file @
0a59698e
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'dart:async'
;
import
'dart:async'
;
import
'package:crypto/crypto.dart'
;
import
'package:crypto/crypto.dart'
;
...
@@ -41,7 +39,7 @@ class DevelopmentArtifact {
...
@@ -41,7 +39,7 @@ class DevelopmentArtifact {
final
String
name
;
final
String
name
;
/// A feature to control the visibility of this artifact.
/// A feature to control the visibility of this artifact.
final
Feature
feature
;
final
Feature
?
feature
;
/// Artifacts required for Android development.
/// Artifacts required for Android development.
static
const
DevelopmentArtifact
androidGenSnapshot
=
DevelopmentArtifact
.
_
(
'android_gen_snapshot'
,
feature:
flutterAndroidFeature
);
static
const
DevelopmentArtifact
androidGenSnapshot
=
DevelopmentArtifact
.
_
(
'android_gen_snapshot'
,
feature:
flutterAndroidFeature
);
...
@@ -104,12 +102,12 @@ class Cache {
...
@@ -104,12 +102,12 @@ class Cache {
/// [rootOverride] is configurable for testing.
/// [rootOverride] is configurable for testing.
/// [artifacts] is configurable for testing.
/// [artifacts] is configurable for testing.
Cache
({
Cache
({
@protected
Directory
rootOverride
,
@protected
Directory
?
rootOverride
,
@protected
List
<
ArtifactSet
>
artifacts
,
@protected
List
<
ArtifactSet
>
?
artifacts
,
@
required
Logger
logger
,
required
Logger
logger
,
@
required
FileSystem
fileSystem
,
required
FileSystem
fileSystem
,
@
required
Platform
platform
,
required
Platform
platform
,
@
required
OperatingSystemUtils
osUtils
,
required
OperatingSystemUtils
osUtils
,
})
:
_rootOverride
=
rootOverride
,
})
:
_rootOverride
=
rootOverride
,
_logger
=
logger
,
_logger
=
logger
,
_fileSystem
=
fileSystem
,
_fileSystem
=
fileSystem
,
...
@@ -117,7 +115,7 @@ class Cache {
...
@@ -117,7 +115,7 @@ class Cache {
_osUtils
=
osUtils
,
_osUtils
=
osUtils
,
_net
=
Net
(
logger:
logger
,
platform:
platform
),
_net
=
Net
(
logger:
logger
,
platform:
platform
),
_fsUtils
=
FileSystemUtils
(
fileSystem:
fileSystem
,
platform:
platform
),
_fsUtils
=
FileSystemUtils
(
fileSystem:
fileSystem
,
platform:
platform
),
_artifacts
=
artifacts
;
_artifacts
=
artifacts
??
<
ArtifactSet
>[]
;
/// Create a [Cache] for testing.
/// Create a [Cache] for testing.
///
///
...
@@ -126,12 +124,12 @@ class Cache {
...
@@ -126,12 +124,12 @@ class Cache {
/// By default, the root cache directory path is "cache".
/// By default, the root cache directory path is "cache".
@visibleForTesting
@visibleForTesting
factory
Cache
.
test
({
factory
Cache
.
test
({
Directory
rootOverride
,
Directory
?
rootOverride
,
List
<
ArtifactSet
>
artifacts
,
List
<
ArtifactSet
>
?
artifacts
,
Logger
logger
,
Logger
?
logger
,
FileSystem
fileSystem
,
FileSystem
?
fileSystem
,
Platform
platform
,
Platform
?
platform
,
ProcessManager
processManager
,
required
ProcessManager
processManager
,
})
{
})
{
fileSystem
??=
rootOverride
?.
fileSystem
??
MemoryFileSystem
.
test
();
fileSystem
??=
rootOverride
?.
fileSystem
??
MemoryFileSystem
.
test
();
platform
??=
FakePlatform
(
environment:
<
String
,
String
>{});
platform
??=
FakePlatform
(
environment:
<
String
,
String
>{});
...
@@ -155,13 +153,13 @@ class Cache {
...
@@ -155,13 +153,13 @@ class Cache {
final
Platform
_platform
;
final
Platform
_platform
;
final
FileSystem
_fileSystem
;
final
FileSystem
_fileSystem
;
final
OperatingSystemUtils
_osUtils
;
final
OperatingSystemUtils
_osUtils
;
final
Directory
_rootOverride
;
final
Directory
?
_rootOverride
;
final
List
<
ArtifactSet
>
_artifacts
;
final
List
<
ArtifactSet
>
_artifacts
;
final
Net
_net
;
final
Net
_net
;
final
FileSystemUtils
_fsUtils
;
final
FileSystemUtils
_fsUtils
;
ArtifactUpdater
get
_artifactUpdater
=>
__artifactUpdater
??=
_createUpdater
();
ArtifactUpdater
get
_artifactUpdater
=>
__artifactUpdater
??=
_createUpdater
();
ArtifactUpdater
__artifactUpdater
;
ArtifactUpdater
?
__artifactUpdater
;
@protected
@protected
void
registerArtifact
(
ArtifactSet
artifactSet
)
{
void
registerArtifact
(
ArtifactSet
artifactSet
)
{
...
@@ -185,7 +183,8 @@ class Cache {
...
@@ -185,7 +183,8 @@ class Cache {
];
];
// Initialized by FlutterCommandRunner on startup.
// Initialized by FlutterCommandRunner on startup.
static
String
flutterRoot
;
// Explore making this field lazy to catch non-initialized access.
static
String
?
flutterRoot
;
/// Determine the absolute and normalized path for the root of the current
/// Determine the absolute and normalized path for the root of the current
/// Flutter checkout.
/// Flutter checkout.
...
@@ -208,15 +207,15 @@ class Cache {
...
@@ -208,15 +207,15 @@ class Cache {
/// If an exception is thrown during any of these checks, an error message is
/// If an exception is thrown during any of these checks, an error message is
/// printed and `.` is returned by default (6).
/// printed and `.` is returned by default (6).
static
String
defaultFlutterRoot
({
static
String
defaultFlutterRoot
({
@
required
Platform
platform
,
required
Platform
platform
,
@
required
FileSystem
fileSystem
,
required
FileSystem
fileSystem
,
@
required
UserMessages
userMessages
,
required
UserMessages
userMessages
,
})
{
})
{
String
normalize
(
String
path
)
{
String
normalize
(
String
path
)
{
return
fileSystem
.
path
.
normalize
(
fileSystem
.
path
.
absolute
(
path
));
return
fileSystem
.
path
.
normalize
(
fileSystem
.
path
.
absolute
(
path
));
}
}
if
(
platform
.
environment
.
containsKey
(
kFlutterRootEnvironmentVariableName
))
{
if
(
platform
.
environment
.
containsKey
(
kFlutterRootEnvironmentVariableName
))
{
return
normalize
(
platform
.
environment
[
kFlutterRootEnvironmentVariableName
]);
return
normalize
(
platform
.
environment
[
kFlutterRootEnvironmentVariableName
]
!
);
}
}
try
{
try
{
if
(
platform
.
script
.
scheme
==
'data'
)
{
if
(
platform
.
script
.
scheme
==
'data'
)
{
...
@@ -225,7 +224,7 @@ class Cache {
...
@@ -225,7 +224,7 @@ class Cache {
final
String
Function
(
String
)
dirname
=
fileSystem
.
path
.
dirname
;
final
String
Function
(
String
)
dirname
=
fileSystem
.
path
.
dirname
;
if
(
platform
.
script
.
scheme
==
'package'
)
{
if
(
platform
.
script
.
scheme
==
'package'
)
{
final
String
packageConfigPath
=
Uri
.
parse
(
platform
.
packageConfig
).
toFilePath
(
final
String
packageConfigPath
=
Uri
.
parse
(
platform
.
packageConfig
!
).
toFilePath
(
windows:
platform
.
isWindows
,
windows:
platform
.
isWindows
,
);
);
return
normalize
(
dirname
(
dirname
(
dirname
(
packageConfigPath
))));
return
normalize
(
dirname
(
dirname
(
dirname
(
packageConfigPath
))));
...
@@ -255,12 +254,12 @@ class Cache {
...
@@ -255,12 +254,12 @@ class Cache {
// Names of artifacts which should be cached even if they would normally
// Names of artifacts which should be cached even if they would normally
// be filtered out for the current platform.
// be filtered out for the current platform.
Set
<
String
>
platformOverrideArtifacts
;
Set
<
String
>
?
platformOverrideArtifacts
;
// Whether to cache the unsigned mac binaries. Defaults to caching the signed binaries.
// Whether to cache the unsigned mac binaries. Defaults to caching the signed binaries.
bool
useUnsignedMacBinaries
=
false
;
bool
useUnsignedMacBinaries
=
false
;
static
RandomAccessFile
_lock
;
static
RandomAccessFile
?
_lock
;
static
bool
_lockEnabled
=
true
;
static
bool
_lockEnabled
=
true
;
/// Turn off the [lock]/[releaseLock] mechanism.
/// Turn off the [lock]/[releaseLock] mechanism.
...
@@ -300,7 +299,7 @@ class Cache {
...
@@ -300,7 +299,7 @@ class Cache {
}
}
assert
(
_lock
==
null
);
assert
(
_lock
==
null
);
final
File
lockFile
=
final
File
lockFile
=
_fileSystem
.
file
(
_fileSystem
.
path
.
join
(
flutterRoot
,
'bin'
,
'cache'
,
'lockfile'
));
_fileSystem
.
file
(
_fileSystem
.
path
.
join
(
flutterRoot
!
,
'bin'
,
'cache'
,
'lockfile'
));
try
{
try
{
_lock
=
lockFile
.
openSync
(
mode:
FileMode
.
write
);
_lock
=
lockFile
.
openSync
(
mode:
FileMode
.
write
);
}
on
FileSystemException
catch
(
e
)
{
}
on
FileSystemException
catch
(
e
)
{
...
@@ -312,11 +311,11 @@ class Cache {
...
@@ -312,11 +311,11 @@ class Cache {
bool
printed
=
false
;
bool
printed
=
false
;
while
(!
locked
)
{
while
(!
locked
)
{
try
{
try
{
_lock
.
lockSync
();
_lock
!
.
lockSync
();
locked
=
true
;
locked
=
true
;
}
on
FileSystemException
{
}
on
FileSystemException
{
if
(!
printed
)
{
if
(!
printed
)
{
_logger
.
printTrace
(
'Waiting to be able to obtain lock of Flutter binary artifacts directory:
${_lock.path}
'
);
_logger
.
printTrace
(
'Waiting to be able to obtain lock of Flutter binary artifacts directory:
${_lock
!
.path}
'
);
_logger
.
printStatus
(
'Waiting for another flutter command to release the startup lock...'
);
_logger
.
printStatus
(
'Waiting for another flutter command to release the startup lock...'
);
printed
=
true
;
printed
=
true
;
}
}
...
@@ -333,7 +332,7 @@ class Cache {
...
@@ -333,7 +332,7 @@ class Cache {
if
(!
_lockEnabled
||
_lock
==
null
)
{
if
(!
_lockEnabled
||
_lock
==
null
)
{
return
;
return
;
}
}
_lock
.
closeSync
();
_lock
!
.
closeSync
();
_lock
=
null
;
_lock
=
null
;
}
}
...
@@ -354,23 +353,26 @@ class Cache {
...
@@ -354,23 +353,26 @@ class Cache {
// Changes '2.1.0-dev.8.0.flutter-4312ae32' to '2.1.0 (build 2.1.0-dev.8.0 4312ae32)'
// Changes '2.1.0-dev.8.0.flutter-4312ae32' to '2.1.0 (build 2.1.0-dev.8.0 4312ae32)'
final
String
justVersion
=
_platform
.
version
.
split
(
' '
)[
0
];
final
String
justVersion
=
_platform
.
version
.
split
(
' '
)[
0
];
_dartSdkVersion
=
justVersion
.
replaceFirstMapped
(
RegExp
(
r'(\d+\.\d+\.\d+)(.+)'
),
(
Match
match
)
{
_dartSdkVersion
=
justVersion
.
replaceFirstMapped
(
RegExp
(
r'(\d+\.\d+\.\d+)(.+)'
),
(
Match
match
)
{
final
String
noFlutter
=
match
[
2
].
replaceAll
(
'.flutter-'
,
' '
);
final
String
noFlutter
=
match
[
2
]
!
.
replaceAll
(
'.flutter-'
,
' '
);
return
'
${match[1]}
(build
${match[1]}$noFlutter
)'
;
return
'
${match[1]}
(build
${match[1]}$noFlutter
)'
;
});
});
}
}
return
_dartSdkVersion
;
return
_dartSdkVersion
!
;
}
}
String
_dartSdkVersion
;
String
?
_dartSdkVersion
;
/// The current version of the Flutter engine the flutter tool will download.
/// The current version of the Flutter engine the flutter tool will download.
String
get
engineRevision
{
String
get
engineRevision
{
_engineRevision
??=
getVersionFor
(
'engine'
);
_engineRevision
??=
getVersionFor
(
'engine'
);
return
_engineRevision
;
if
(
_engineRevision
==
null
)
{
throwToolExit
(
'Could not determine engine revision.'
);
}
return
_engineRevision
!;
}
}
String
_engineRevision
;
String
?
_engineRevision
;
String
get
storageBaseUrl
{
String
get
storageBaseUrl
{
final
String
overrideUrl
=
_platform
.
environment
[
'FLUTTER_STORAGE_BASE_URL'
];
final
String
?
overrideUrl
=
_platform
.
environment
[
'FLUTTER_STORAGE_BASE_URL'
];
if
(
overrideUrl
==
null
)
{
if
(
overrideUrl
==
null
)
{
return
'https://storage.googleapis.com'
;
return
'https://storage.googleapis.com'
;
}
}
...
@@ -400,9 +402,9 @@ class Cache {
...
@@ -400,9 +402,9 @@ class Cache {
/// Return the top-level directory in the cache; this is `bin/cache`.
/// Return the top-level directory in the cache; this is `bin/cache`.
Directory
getRoot
()
{
Directory
getRoot
()
{
if
(
_rootOverride
!=
null
)
{
if
(
_rootOverride
!=
null
)
{
return
_fileSystem
.
directory
(
_fileSystem
.
path
.
join
(
_rootOverride
.
path
,
'bin'
,
'cache'
));
return
_fileSystem
.
directory
(
_fileSystem
.
path
.
join
(
_rootOverride
!
.
path
,
'bin'
,
'cache'
));
}
else
{
}
else
{
return
_fileSystem
.
directory
(
_fileSystem
.
path
.
join
(
flutterRoot
,
'bin'
,
'cache'
));
return
_fileSystem
.
directory
(
_fileSystem
.
path
.
join
(
flutterRoot
!
,
'bin'
,
'cache'
));
}
}
}
}
...
@@ -427,7 +429,7 @@ class Cache {
...
@@ -427,7 +429,7 @@ class Cache {
Directory
getCacheArtifacts
()
=>
getCacheDir
(
'artifacts'
);
Directory
getCacheArtifacts
()
=>
getCacheDir
(
'artifacts'
);
/// Location of LICENSE file.
/// Location of LICENSE file.
File
getLicenseFile
()
=>
_fileSystem
.
file
(
_fileSystem
.
path
.
join
(
flutterRoot
,
'LICENSE'
));
File
getLicenseFile
()
=>
_fileSystem
.
file
(
_fileSystem
.
path
.
join
(
flutterRoot
!
,
'LICENSE'
));
/// Get a named directory from with the cache's artifact directory; for example,
/// Get a named directory from with the cache's artifact directory; for example,
/// `material_fonts` would return `bin/cache/artifacts/material_fonts`.
/// `material_fonts` would return `bin/cache/artifacts/material_fonts`.
...
@@ -437,7 +439,7 @@ class Cache {
...
@@ -437,7 +439,7 @@ class Cache {
MapEntry
<
String
,
String
>
get
dyLdLibEntry
{
MapEntry
<
String
,
String
>
get
dyLdLibEntry
{
if
(
_dyLdLibEntry
!=
null
)
{
if
(
_dyLdLibEntry
!=
null
)
{
return
_dyLdLibEntry
;
return
_dyLdLibEntry
!
;
}
}
final
List
<
String
>
paths
=
<
String
>[];
final
List
<
String
>
paths
=
<
String
>[];
for
(
final
ArtifactSet
artifact
in
_artifacts
)
{
for
(
final
ArtifactSet
artifact
in
_artifacts
)
{
...
@@ -445,16 +447,16 @@ class Cache {
...
@@ -445,16 +447,16 @@ class Cache {
if
(
env
==
null
||
!
env
.
containsKey
(
'DYLD_LIBRARY_PATH'
))
{
if
(
env
==
null
||
!
env
.
containsKey
(
'DYLD_LIBRARY_PATH'
))
{
continue
;
continue
;
}
}
final
String
path
=
env
[
'DYLD_LIBRARY_PATH'
];
final
String
path
=
env
[
'DYLD_LIBRARY_PATH'
]
!
;
if
(
path
.
isEmpty
)
{
if
(
path
.
isEmpty
)
{
continue
;
continue
;
}
}
paths
.
add
(
path
);
paths
.
add
(
path
);
}
}
_dyLdLibEntry
=
MapEntry
<
String
,
String
>(
'DYLD_LIBRARY_PATH'
,
paths
.
join
(
':'
));
_dyLdLibEntry
=
MapEntry
<
String
,
String
>(
'DYLD_LIBRARY_PATH'
,
paths
.
join
(
':'
));
return
_dyLdLibEntry
;
return
_dyLdLibEntry
!
;
}
}
MapEntry
<
String
,
String
>
_dyLdLibEntry
;
MapEntry
<
String
,
String
>
?
_dyLdLibEntry
;
/// The web sdk has to be co-located with the dart-sdk so that they can share source
/// The web sdk has to be co-located with the dart-sdk so that they can share source
/// code.
/// code.
...
@@ -462,9 +464,9 @@ class Cache {
...
@@ -462,9 +464,9 @@ class Cache {
return
getRoot
().
childDirectory
(
'flutter_web_sdk'
);
return
getRoot
().
childDirectory
(
'flutter_web_sdk'
);
}
}
String
getVersionFor
(
String
artifactName
)
{
String
?
getVersionFor
(
String
artifactName
)
{
final
File
versionFile
=
_fileSystem
.
file
(
_fileSystem
.
path
.
join
(
final
File
versionFile
=
_fileSystem
.
file
(
_fileSystem
.
path
.
join
(
_rootOverride
?.
path
??
flutterRoot
,
_rootOverride
?.
path
??
flutterRoot
!
,
'bin'
,
'bin'
,
'internal'
,
'internal'
,
'
$artifactName
.version'
,
'
$artifactName
.version'
,
...
@@ -488,7 +490,7 @@ class Cache {
...
@@ -488,7 +490,7 @@ class Cache {
/// Read the stamp for [artifactName].
/// Read the stamp for [artifactName].
///
///
/// If the file is missing or cannot be parsed, returns `null`.
/// If the file is missing or cannot be parsed, returns `null`.
String
getStampFor
(
String
artifactName
)
{
String
?
getStampFor
(
String
artifactName
)
{
final
File
stampFile
=
getStampFileFor
(
artifactName
);
final
File
stampFile
=
getStampFileFor
(
artifactName
);
if
(!
stampFile
.
existsSync
())
{
if
(!
stampFile
.
existsSync
())
{
return
null
;
return
null
;
...
@@ -557,7 +559,7 @@ class Cache {
...
@@ -557,7 +559,7 @@ class Cache {
}
}
Future
<
bool
>
areRemoteArtifactsAvailable
({
Future
<
bool
>
areRemoteArtifactsAvailable
({
String
engineVersion
,
String
?
engineVersion
,
bool
includeAllPlatforms
=
true
,
bool
includeAllPlatforms
=
true
,
})
async
{
})
async
{
final
bool
includeAllPlatformsState
=
this
.
includeAllPlatforms
;
final
bool
includeAllPlatformsState
=
this
.
includeAllPlatforms
;
...
@@ -634,12 +636,13 @@ abstract class CachedArtifact extends ArtifactSet {
...
@@ -634,12 +636,13 @@ abstract class CachedArtifact extends ArtifactSet {
String
get
stampName
=>
name
;
String
get
stampName
=>
name
;
Directory
get
location
=>
cache
.
getArtifactDirectory
(
name
);
Directory
get
location
=>
cache
.
getArtifactDirectory
(
name
);
String
get
version
=>
cache
.
getVersionFor
(
name
);
String
?
get
version
=>
cache
.
getVersionFor
(
name
);
// Whether or not to bypass normal platform filtering for this artifact.
// Whether or not to bypass normal platform filtering for this artifact.
bool
get
ignorePlatformFiltering
{
bool
get
ignorePlatformFiltering
{
return
cache
.
includeAllPlatforms
||
return
cache
.
includeAllPlatforms
||
(
cache
.
platformOverrideArtifacts
!=
null
&&
cache
.
platformOverrideArtifacts
.
contains
(
developmentArtifact
.
name
));
(
cache
.
platformOverrideArtifacts
!=
null
&&
cache
.
platformOverrideArtifacts
!
.
contains
(
developmentArtifact
.
name
));
}
}
@override
@override
...
@@ -673,7 +676,15 @@ abstract class CachedArtifact extends ArtifactSet {
...
@@ -673,7 +676,15 @@ abstract class CachedArtifact extends ArtifactSet {
}
}
await
updateInner
(
artifactUpdater
,
fileSystem
,
operatingSystemUtils
);
await
updateInner
(
artifactUpdater
,
fileSystem
,
operatingSystemUtils
);
try
{
try
{
cache
.
setStampFor
(
stampName
,
version
);
if
(
version
==
null
)
{
logger
.
printError
(
'No known version for the artifact name "
$name
". '
'Flutter can continue, but the artifact may be re-downloaded on '
'subsequent invocations until the problem is resolved.'
,
);
}
else
{
cache
.
setStampFor
(
stampName
,
version
!);
}
}
on
FileSystemException
catch
(
err
)
{
}
on
FileSystemException
catch
(
err
)
{
logger
.
printError
(
logger
.
printError
(
'The new artifact "
$name
" was downloaded, but Flutter failed to update '
'The new artifact "
$name
" was downloaded, but Flutter failed to update '
...
@@ -781,7 +792,7 @@ abstract class EngineCachedArtifact extends CachedArtifact {
...
@@ -781,7 +792,7 @@ abstract class EngineCachedArtifact extends CachedArtifact {
}
}
}
}
Future
<
bool
>
checkForArtifacts
(
String
engineVersion
)
async
{
Future
<
bool
>
checkForArtifacts
(
String
?
engineVersion
)
async
{
engineVersion
??=
version
;
engineVersion
??=
version
;
final
String
url
=
'
${cache.storageBaseUrl}
/flutter_infra_release/flutter/
$engineVersion
/'
;
final
String
url
=
'
${cache.storageBaseUrl}
/flutter_infra_release/flutter/
$engineVersion
/'
;
...
@@ -822,12 +833,12 @@ abstract class EngineCachedArtifact extends CachedArtifact {
...
@@ -822,12 +833,12 @@ abstract class EngineCachedArtifact extends CachedArtifact {
/// additional source code.
/// additional source code.
class
ArtifactUpdater
{
class
ArtifactUpdater
{
ArtifactUpdater
({
ArtifactUpdater
({
@
required
OperatingSystemUtils
operatingSystemUtils
,
required
OperatingSystemUtils
operatingSystemUtils
,
@
required
Logger
logger
,
required
Logger
logger
,
@
required
FileSystem
fileSystem
,
required
FileSystem
fileSystem
,
@
required
Directory
tempStorage
,
required
Directory
tempStorage
,
@
required
HttpClient
httpClient
,
required
HttpClient
httpClient
,
@
required
Platform
platform
,
required
Platform
platform
,
})
:
_operatingSystemUtils
=
operatingSystemUtils
,
})
:
_operatingSystemUtils
=
operatingSystemUtils
,
_httpClient
=
httpClient
,
_httpClient
=
httpClient
,
_logger
=
logger
,
_logger
=
logger
,
...
@@ -912,7 +923,7 @@ class ArtifactUpdater {
...
@@ -912,7 +923,7 @@ class ArtifactUpdater {
}
}
continue
;
continue
;
}
on
ArgumentError
catch
(
error
)
{
}
on
ArgumentError
catch
(
error
)
{
final
String
overrideUrl
=
_platform
.
environment
[
'FLUTTER_STORAGE_BASE_URL'
];
final
String
?
overrideUrl
=
_platform
.
environment
[
'FLUTTER_STORAGE_BASE_URL'
];
if
(
overrideUrl
!=
null
&&
url
.
toString
().
contains
(
overrideUrl
))
{
if
(
overrideUrl
!=
null
&&
url
.
toString
().
contains
(
overrideUrl
))
{
_logger
.
printError
(
error
.
toString
());
_logger
.
printError
(
error
.
toString
());
throwToolExit
(
throwToolExit
(
...
@@ -944,7 +955,7 @@ class ArtifactUpdater {
...
@@ -944,7 +955,7 @@ class ArtifactUpdater {
// cannot be deleted. For the cache, this is either the analyzer reading
// cannot be deleted. For the cache, this is either the analyzer reading
// the sky_engine package or a running flutter_tester device.
// the sky_engine package or a running flutter_tester device.
const
int
kSharingViolation
=
32
;
const
int
kSharingViolation
=
32
;
if
(
_platform
.
isWindows
&&
error
.
osError
.
errorCode
==
kSharingViolation
)
{
if
(
_platform
.
isWindows
&&
error
.
osError
?
.
errorCode
==
kSharingViolation
)
{
throwToolExit
(
throwToolExit
(
'Failed to delete
${destination.path}
because the local file/directory is in use '
'Failed to delete
${destination.path}
because the local file/directory is in use '
'by another process. Try closing any running IDEs or editors and trying '
'by another process. Try closing any running IDEs or editors and trying '
...
@@ -987,9 +998,9 @@ class ArtifactUpdater {
...
@@ -987,9 +998,9 @@ class ArtifactUpdater {
throw
Exception
(
response
.
statusCode
);
throw
Exception
(
response
.
statusCode
);
}
}
final
String
md5Hash
=
_expectedMd5
(
response
.
headers
);
final
String
?
md5Hash
=
_expectedMd5
(
response
.
headers
);
ByteConversionSink
inputSink
;
ByteConversionSink
?
inputSink
;
StreamController
<
Digest
>
digests
;
late
StreamController
<
Digest
>
digests
;
if
(
md5Hash
!=
null
)
{
if
(
md5Hash
!=
null
)
{
_logger
.
printTrace
(
'Content
$url
md5 hash:
$md5Hash
'
);
_logger
.
printTrace
(
'Content
$url
md5 hash:
$md5Hash
'
);
digests
=
StreamController
<
Digest
>();
digests
=
StreamController
<
Digest
>();
...
@@ -1016,14 +1027,18 @@ class ArtifactUpdater {
...
@@ -1016,14 +1027,18 @@ class ArtifactUpdater {
}
}
}
}
String
_expectedMd5
(
HttpHeaders
httpHeaders
)
{
String
?
_expectedMd5
(
HttpHeaders
httpHeaders
)
{
final
List
<
String
>
values
=
httpHeaders
[
'x-goog-hash'
];
final
List
<
String
>
?
values
=
httpHeaders
[
'x-goog-hash'
];
if
(
values
==
null
)
{
if
(
values
==
null
)
{
return
null
;
return
null
;
}
}
final
String
rawMd5Hash
=
values
.
firstWhere
((
String
value
)
{
String
?
rawMd5Hash
;
return
value
.
startsWith
(
'md5='
);
for
(
final
String
value
in
values
)
{
},
orElse:
()
=>
null
);
if
(
value
.
startsWith
(
'md5='
))
{
rawMd5Hash
=
value
;
break
;
}
}
if
(
rawMd5Hash
==
null
)
{
if
(
rawMd5Hash
==
null
)
{
return
null
;
return
null
;
}
}
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_ios_framework_test.dart
View file @
0a59698e
...
@@ -53,6 +53,7 @@ void main() {
...
@@ -53,6 +53,7 @@ void main() {
rootOverride:
rootOverride
,
rootOverride:
rootOverride
,
platform:
fakePlatform
,
platform:
fakePlatform
,
fileSystem:
memoryFileSystem
,
fileSystem:
memoryFileSystem
,
processManager:
FakeProcessManager
.
any
(),
);
);
rootOverride
.
childDirectory
(
'bin'
).
childDirectory
(
'internal'
).
childFile
(
'engine.version'
)
rootOverride
.
childDirectory
(
'bin'
).
childDirectory
(
'internal'
).
childFile
(
'engine.version'
)
..
createSync
(
recursive:
true
)
..
createSync
(
recursive:
true
)
...
...
packages/flutter_tools/test/commands.shard/hermetic/devices_test.dart
View file @
0a59698e
...
@@ -26,7 +26,7 @@ void main() {
...
@@ -26,7 +26,7 @@ void main() {
Cache
cache
;
Cache
cache
;
setUp
(()
{
setUp
(()
{
cache
=
Cache
.
test
();
cache
=
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
);
});
});
testUsingContext
(
'returns 0 when called'
,
()
async
{
testUsingContext
(
'returns 0 when called'
,
()
async
{
...
...
packages/flutter_tools/test/commands.shard/hermetic/install_test.dart
View file @
0a59698e
...
@@ -37,7 +37,7 @@ void main() {
...
@@ -37,7 +37,7 @@ void main() {
await
createTestCommandRunner
(
command
).
run
(<
String
>[
'install'
]);
await
createTestCommandRunner
(
command
).
run
(<
String
>[
'install'
]);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
Cache
.
test
(),
Cache:
()
=>
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
),
});
});
testUsingContext
(
'returns 1 when targeted device is not Android with --device-user'
,
()
async
{
testUsingContext
(
'returns 1 when targeted device is not Android with --device-user'
,
()
async
{
...
@@ -54,7 +54,7 @@ void main() {
...
@@ -54,7 +54,7 @@ void main() {
expect
(()
async
=>
createTestCommandRunner
(
command
).
run
(<
String
>[
'install'
,
'--device-user'
,
'10'
]),
expect
(()
async
=>
createTestCommandRunner
(
command
).
run
(<
String
>[
'install'
,
'--device-user'
,
'10'
]),
throwsToolExit
(
message:
'--device-user is only supported for Android'
));
throwsToolExit
(
message:
'--device-user is only supported for Android'
));
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
Cache
.
test
(),
Cache:
()
=>
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
),
});
});
testUsingContext
(
'returns 0 when iOS is connected and ready for an install'
,
()
async
{
testUsingContext
(
'returns 0 when iOS is connected and ready for an install'
,
()
async
{
...
@@ -68,7 +68,7 @@ void main() {
...
@@ -68,7 +68,7 @@ void main() {
await
createTestCommandRunner
(
command
).
run
(<
String
>[
'install'
]);
await
createTestCommandRunner
(
command
).
run
(<
String
>[
'install'
]);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
Cache
.
test
(),
Cache:
()
=>
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
),
});
});
});
});
}
}
...
...
packages/flutter_tools/test/commands.shard/hermetic/run_test.dart
View file @
0a59698e
...
@@ -382,7 +382,7 @@ void main() {
...
@@ -382,7 +382,7 @@ void main() {
)));
)));
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
artifacts
,
Artifacts:
()
=>
artifacts
,
Cache:
()
=>
Cache
.
test
(),
Cache:
()
=>
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
),
DeviceManager:
()
=>
mockDeviceManager
,
DeviceManager:
()
=>
mockDeviceManager
,
FileSystem:
()
=>
fs
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
packages/flutter_tools/test/general.shard/cache_test.dart
View file @
0a59698e
...
@@ -65,13 +65,13 @@ void main() {
...
@@ -65,13 +65,13 @@ void main() {
});
});
testWithoutContext
(
'should throw when locking is not acquired'
,
()
{
testWithoutContext
(
'should throw when locking is not acquired'
,
()
{
final
Cache
cache
=
Cache
.
test
();
final
Cache
cache
=
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
);
expect
(
cache
.
checkLockAcquired
,
throwsStateError
);
expect
(
cache
.
checkLockAcquired
,
throwsStateError
);
});
});
testWithoutContext
(
'should not throw when locking is disabled'
,
()
{
testWithoutContext
(
'should not throw when locking is disabled'
,
()
{
final
Cache
cache
=
Cache
.
test
();
final
Cache
cache
=
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
);
Cache
.
disableLocking
();
Cache
.
disableLocking
();
expect
(
cache
.
checkLockAcquired
,
returnsNormally
);
expect
(
cache
.
checkLockAcquired
,
returnsNormally
);
...
@@ -80,7 +80,7 @@ void main() {
...
@@ -80,7 +80,7 @@ void main() {
testWithoutContext
(
'should not throw when lock is acquired'
,
()
async
{
testWithoutContext
(
'should not throw when lock is acquired'
,
()
async
{
Cache
.
flutterRoot
=
''
;
Cache
.
flutterRoot
=
''
;
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
Cache
cache
=
Cache
.
test
(
fileSystem:
fileSystem
);
final
Cache
cache
=
Cache
.
test
(
fileSystem:
fileSystem
,
processManager:
FakeProcessManager
.
any
()
);
fileSystem
.
file
(
fileSystem
.
path
.
join
(
'bin'
,
'cache'
,
'lockfile'
))
fileSystem
.
file
(
fileSystem
.
path
.
join
(
'bin'
,
'cache'
,
'lockfile'
))
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
...
@@ -92,7 +92,7 @@ void main() {
...
@@ -92,7 +92,7 @@ void main() {
testWithoutContext
(
'throws tool exit when lockfile open fails'
,
()
async
{
testWithoutContext
(
'throws tool exit when lockfile open fails'
,
()
async
{
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
Cache
cache
=
Cache
.
test
(
fileSystem:
fileSystem
);
final
Cache
cache
=
Cache
.
test
(
fileSystem:
fileSystem
,
processManager:
FakeProcessManager
.
any
()
);
fileSystem
.
file
(
fileSystem
.
path
.
join
(
'bin'
,
'cache'
,
'lockfile'
))
fileSystem
.
file
(
fileSystem
.
path
.
join
(
'bin'
,
'cache'
,
'lockfile'
))
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
...
@@ -100,9 +100,12 @@ void main() {
...
@@ -100,9 +100,12 @@ void main() {
},
skip:
true
);
// TODO(jonahwilliams): implement support for lock so this can be tested with the memory file system.
},
skip:
true
);
// TODO(jonahwilliams): implement support for lock so this can be tested with the memory file system.
testWithoutContext
(
'should not throw when FLUTTER_ALREADY_LOCKED is set'
,
()
{
testWithoutContext
(
'should not throw when FLUTTER_ALREADY_LOCKED is set'
,
()
{
final
Cache
cache
=
Cache
.
test
(
platform:
FakePlatform
(
environment:
<
String
,
String
>{
final
Cache
cache
=
Cache
.
test
(
platform:
FakePlatform
(
environment:
<
String
,
String
>{
'FLUTTER_ALREADY_LOCKED'
:
'true'
,
'FLUTTER_ALREADY_LOCKED'
:
'true'
,
}));
}),
processManager:
FakeProcessManager
.
any
(),
);
expect
(
cache
.
checkLockAcquired
,
returnsNormally
);
expect
(
cache
.
checkLockAcquired
,
returnsNormally
);
});
});
...
@@ -116,6 +119,7 @@ void main() {
...
@@ -116,6 +119,7 @@ void main() {
final
Directory
artifactDir
=
fileSystem
.
systemTempDirectory
.
createTempSync
(
'flutter_cache_test_artifact.'
);
final
Directory
artifactDir
=
fileSystem
.
systemTempDirectory
.
createTempSync
(
'flutter_cache_test_artifact.'
);
final
Directory
downloadDir
=
fileSystem
.
systemTempDirectory
.
createTempSync
(
'flutter_cache_test_download.'
);
final
Directory
downloadDir
=
fileSystem
.
systemTempDirectory
.
createTempSync
(
'flutter_cache_test_download.'
);
when
(
mockCache
.
getVersionFor
(
any
)).
thenReturn
(
'asdasd'
);
when
(
mockCache
.
getArtifactDirectory
(
any
)).
thenReturn
(
artifactDir
);
when
(
mockCache
.
getArtifactDirectory
(
any
)).
thenReturn
(
artifactDir
);
when
(
mockCache
.
getDownloadDir
()).
thenReturn
(
downloadDir
);
when
(
mockCache
.
getDownloadDir
()).
thenReturn
(
downloadDir
);
when
(
mockCache
.
setStampFor
(
any
,
any
)).
thenAnswer
((
_
)
{
when
(
mockCache
.
setStampFor
(
any
,
any
)).
thenAnswer
((
_
)
{
...
@@ -127,6 +131,22 @@ void main() {
...
@@ -127,6 +131,22 @@ void main() {
expect
(
logger
.
errorText
,
contains
(
'stamp write failed'
));
expect
(
logger
.
errorText
,
contains
(
'stamp write failed'
));
});
});
testWithoutContext
(
'Continues on missing version file'
,
()
async
{
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
Cache
mockCache
=
MockCache
();
final
Directory
artifactDir
=
fileSystem
.
systemTempDirectory
.
createTempSync
(
'flutter_cache_test_artifact.'
);
final
Directory
downloadDir
=
fileSystem
.
systemTempDirectory
.
createTempSync
(
'flutter_cache_test_download.'
);
when
(
mockCache
.
getVersionFor
(
any
)).
thenReturn
(
null
);
// version is missing.
when
(
mockCache
.
getArtifactDirectory
(
any
)).
thenReturn
(
artifactDir
);
when
(
mockCache
.
getDownloadDir
()).
thenReturn
(
downloadDir
);
final
FakeSimpleArtifact
artifact
=
FakeSimpleArtifact
(
mockCache
);
await
artifact
.
update
(
MockArtifactUpdater
(),
logger
,
fileSystem
,
MockOperatingSystemUtils
());
expect
(
logger
.
errorText
,
contains
(
'No known version for the artifact name "fake"'
));
});
testWithoutContext
(
'Gradle wrapper should not be up to date, if some cached artifact is not available'
,
()
{
testWithoutContext
(
'Gradle wrapper should not be up to date, if some cached artifact is not available'
,
()
{
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
Cache
cache
=
Cache
.
test
(
fileSystem:
fileSystem
,
processManager:
FakeProcessManager
.
any
());
final
Cache
cache
=
Cache
.
test
(
fileSystem:
fileSystem
,
processManager:
FakeProcessManager
.
any
());
...
@@ -288,8 +308,9 @@ void main() {
...
@@ -288,8 +308,9 @@ void main() {
final
Cache
cache
=
Cache
.
test
(
final
Cache
cache
=
Cache
.
test
(
platform:
FakePlatform
(
environment:
<
String
,
String
>{
platform:
FakePlatform
(
environment:
<
String
,
String
>{
'FLUTTER_STORAGE_BASE_URL'
:
' http://foo'
,
'FLUTTER_STORAGE_BASE_URL'
:
' http://foo'
,
},
}),
));
processManager:
FakeProcessManager
.
any
(),
);
expect
(()
=>
cache
.
storageBaseUrl
,
throwsToolExit
());
expect
(()
=>
cache
.
storageBaseUrl
,
throwsToolExit
());
});
});
...
@@ -400,7 +421,7 @@ void main() {
...
@@ -400,7 +421,7 @@ void main() {
});
});
testWithoutContext
(
'IosUsbArtifacts uses unsigned when specified'
,
()
async
{
testWithoutContext
(
'IosUsbArtifacts uses unsigned when specified'
,
()
async
{
final
Cache
cache
=
Cache
.
test
();
final
Cache
cache
=
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
);
cache
.
useUnsignedMacBinaries
=
true
;
cache
.
useUnsignedMacBinaries
=
true
;
final
IosUsbArtifacts
iosUsbArtifacts
=
IosUsbArtifacts
(
'name'
,
cache
,
platform:
FakePlatform
(
operatingSystem:
'macos'
));
final
IosUsbArtifacts
iosUsbArtifacts
=
IosUsbArtifacts
(
'name'
,
cache
,
platform:
FakePlatform
(
operatingSystem:
'macos'
));
...
@@ -408,7 +429,7 @@ void main() {
...
@@ -408,7 +429,7 @@ void main() {
});
});
testWithoutContext
(
'IosUsbArtifacts does not use unsigned when not specified'
,
()
async
{
testWithoutContext
(
'IosUsbArtifacts does not use unsigned when not specified'
,
()
async
{
final
Cache
cache
=
Cache
.
test
();
final
Cache
cache
=
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
);
final
IosUsbArtifacts
iosUsbArtifacts
=
IosUsbArtifacts
(
'name'
,
cache
,
platform:
FakePlatform
(
operatingSystem:
'macos'
));
final
IosUsbArtifacts
iosUsbArtifacts
=
IosUsbArtifacts
(
'name'
,
cache
,
platform:
FakePlatform
(
operatingSystem:
'macos'
));
expect
(
iosUsbArtifacts
.
archiveUri
.
toString
(),
isNot
(
contains
(
'/unsigned/'
)));
expect
(
iosUsbArtifacts
.
archiveUri
.
toString
(),
isNot
(
contains
(
'/unsigned/'
)));
...
@@ -437,7 +458,7 @@ void main() {
...
@@ -437,7 +458,7 @@ void main() {
});
});
testWithoutContext
(
'FontSubset in universal artifacts'
,
()
{
testWithoutContext
(
'FontSubset in universal artifacts'
,
()
{
final
Cache
cache
=
Cache
.
test
();
final
Cache
cache
=
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
);
final
FontSubsetArtifacts
artifacts
=
FontSubsetArtifacts
(
cache
,
platform:
FakePlatform
(
operatingSystem:
'linux'
));
final
FontSubsetArtifacts
artifacts
=
FontSubsetArtifacts
(
cache
,
platform:
FakePlatform
(
operatingSystem:
'linux'
));
expect
(
artifacts
.
developmentArtifact
,
DevelopmentArtifact
.
universal
);
expect
(
artifacts
.
developmentArtifact
,
DevelopmentArtifact
.
universal
);
...
@@ -535,7 +556,7 @@ void main() {
...
@@ -535,7 +556,7 @@ void main() {
});
});
testWithoutContext
(
'macOS desktop artifacts ignore filtering when requested'
,
()
{
testWithoutContext
(
'macOS desktop artifacts ignore filtering when requested'
,
()
{
final
Cache
cache
=
Cache
.
test
();
final
Cache
cache
=
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
);
final
MacOSEngineArtifacts
artifacts
=
MacOSEngineArtifacts
(
cache
,
platform:
FakePlatform
(
operatingSystem:
'linux'
));
final
MacOSEngineArtifacts
artifacts
=
MacOSEngineArtifacts
(
cache
,
platform:
FakePlatform
(
operatingSystem:
'linux'
));
cache
.
includeAllPlatforms
=
false
;
cache
.
includeAllPlatforms
=
false
;
cache
.
platformOverrideArtifacts
=
<
String
>{
'macos'
};
cache
.
platformOverrideArtifacts
=
<
String
>{
'macos'
};
...
@@ -544,7 +565,7 @@ void main() {
...
@@ -544,7 +565,7 @@ void main() {
});
});
testWithoutContext
(
'Windows desktop artifacts ignore filtering when requested'
,
()
{
testWithoutContext
(
'Windows desktop artifacts ignore filtering when requested'
,
()
{
final
Cache
cache
=
Cache
.
test
();
final
Cache
cache
=
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
);
final
WindowsEngineArtifacts
artifacts
=
WindowsEngineArtifacts
(
final
WindowsEngineArtifacts
artifacts
=
WindowsEngineArtifacts
(
cache
,
cache
,
platform:
FakePlatform
(
operatingSystem:
'linux'
),
platform:
FakePlatform
(
operatingSystem:
'linux'
),
...
@@ -556,7 +577,7 @@ void main() {
...
@@ -556,7 +577,7 @@ void main() {
});
});
testWithoutContext
(
'Windows desktop artifacts include profile and release artifacts'
,
()
{
testWithoutContext
(
'Windows desktop artifacts include profile and release artifacts'
,
()
{
final
Cache
cache
=
Cache
.
test
();
final
Cache
cache
=
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
);
final
WindowsEngineArtifacts
artifacts
=
WindowsEngineArtifacts
(
final
WindowsEngineArtifacts
artifacts
=
WindowsEngineArtifacts
(
cache
,
cache
,
platform:
FakePlatform
(
operatingSystem:
'windows'
),
platform:
FakePlatform
(
operatingSystem:
'windows'
),
...
...
packages/flutter_tools/test/general.shard/ios/devices_test.dart
View file @
0a59698e
...
@@ -45,7 +45,7 @@ void main() {
...
@@ -45,7 +45,7 @@ void main() {
setUp
(()
{
setUp
(()
{
final
Artifacts
artifacts
=
Artifacts
.
test
();
final
Artifacts
artifacts
=
Artifacts
.
test
();
cache
=
Cache
.
test
();
cache
=
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
);
logger
=
BufferLogger
.
test
();
logger
=
BufferLogger
.
test
();
iosDeploy
=
IOSDeploy
(
iosDeploy
=
IOSDeploy
(
artifacts:
artifacts
,
artifacts:
artifacts
,
...
@@ -248,7 +248,9 @@ void main() {
...
@@ -248,7 +248,9 @@ void main() {
mockProcess2
=
MockProcess
();
mockProcess2
=
MockProcess
();
mockProcess3
=
MockProcess
();
mockProcess3
=
MockProcess
();
forwardedPort
=
ForwardedPort
.
withContext
(
123
,
456
,
mockProcess3
);
forwardedPort
=
ForwardedPort
.
withContext
(
123
,
456
,
mockProcess3
);
cache
=
Cache
.
test
();
cache
=
Cache
.
test
(
processManager:
FakeProcessManager
.
any
(),
);
iosDeploy
=
IOSDeploy
(
iosDeploy
=
IOSDeploy
(
artifacts:
Artifacts
.
test
(),
artifacts:
Artifacts
.
test
(),
cache:
cache
,
cache:
cache
,
...
@@ -302,7 +304,7 @@ void main() {
...
@@ -302,7 +304,7 @@ void main() {
setUp
(()
{
setUp
(()
{
mockXcdevice
=
MockXcdevice
();
mockXcdevice
=
MockXcdevice
();
final
Artifacts
artifacts
=
Artifacts
.
test
();
final
Artifacts
artifacts
=
Artifacts
.
test
();
cache
=
Cache
.
test
();
cache
=
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
);
logger
=
BufferLogger
.
test
();
logger
=
BufferLogger
.
test
();
mockIosWorkflow
=
MockIOSWorkflow
();
mockIosWorkflow
=
MockIOSWorkflow
();
fakeProcessManager
=
FakeProcessManager
.
any
();
fakeProcessManager
=
FakeProcessManager
.
any
();
...
...
packages/flutter_tools/test/general.shard/ios/ios_deploy_test.dart
View file @
0a59698e
...
@@ -336,6 +336,7 @@ IOSDeploy setUpIOSDeploy(ProcessManager processManager, {
...
@@ -336,6 +336,7 @@ IOSDeploy setUpIOSDeploy(ProcessManager processManager, {
artifacts:
<
ArtifactSet
>[
artifacts:
<
ArtifactSet
>[
FakeDyldEnvironmentArtifact
(),
FakeDyldEnvironmentArtifact
(),
],
],
processManager:
FakeProcessManager
.
any
(),
);
);
return
IOSDeploy
(
return
IOSDeploy
(
...
...
packages/flutter_tools/test/general.shard/ios/ios_device_install_test.dart
View file @
0a59698e
...
@@ -288,6 +288,7 @@ IOSDevice setUpIOSDevice({
...
@@ -288,6 +288,7 @@ IOSDevice setUpIOSDevice({
artifacts:
<
ArtifactSet
>[
artifacts:
<
ArtifactSet
>[
FakeDyldEnvironmentArtifact
(),
FakeDyldEnvironmentArtifact
(),
],
],
processManager:
FakeProcessManager
.
any
(),
);
);
return
IOSDevice
(
return
IOSDevice
(
'1234'
,
'1234'
,
...
...
packages/flutter_tools/test/general.shard/ios/ios_device_logger_test.dart
View file @
0a59698e
...
@@ -31,7 +31,7 @@ void main() {
...
@@ -31,7 +31,7 @@ void main() {
setUp
(()
{
setUp
(()
{
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[]);
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[]);
fakeCache
=
Cache
.
test
();
fakeCache
=
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
);
artifacts
=
Artifacts
.
test
();
artifacts
=
Artifacts
.
test
();
logger
=
BufferLogger
.
test
();
logger
=
BufferLogger
.
test
();
ideviceSyslogPath
=
artifacts
.
getArtifactPath
(
Artifact
.
idevicesyslog
,
platform:
TargetPlatform
.
ios
);
ideviceSyslogPath
=
artifacts
.
getArtifactPath
(
Artifact
.
idevicesyslog
,
platform:
TargetPlatform
.
ios
);
...
...
packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart
View file @
0a59698e
...
@@ -351,6 +351,7 @@ IOSDevice setUpIOSDevice({
...
@@ -351,6 +351,7 @@ IOSDevice setUpIOSDevice({
artifacts:
<
ArtifactSet
>[
artifacts:
<
ArtifactSet
>[
FakeDyldEnvironmentArtifact
(),
FakeDyldEnvironmentArtifact
(),
],
],
processManager:
FakeProcessManager
.
any
(),
);
);
logger
??=
BufferLogger
.
test
();
logger
??=
BufferLogger
.
test
();
...
...
packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart
View file @
0a59698e
...
@@ -313,6 +313,7 @@ IOSDevice setUpIOSDevice({
...
@@ -313,6 +313,7 @@ IOSDevice setUpIOSDevice({
artifacts:
<
ArtifactSet
>[
artifacts:
<
ArtifactSet
>[
FakeDyldEnvironmentArtifact
(),
FakeDyldEnvironmentArtifact
(),
],
],
processManager:
FakeProcessManager
.
any
(),
);
);
return
IOSDevice
(
'123'
,
return
IOSDevice
(
'123'
,
...
...
packages/flutter_tools/test/general.shard/ios/mac_test.dart
View file @
0a59698e
...
@@ -46,7 +46,9 @@ void main() {
...
@@ -46,7 +46,9 @@ void main() {
cache
=
Cache
.
test
(
cache
=
Cache
.
test
(
artifacts:
<
ArtifactSet
>[
artifacts:
<
ArtifactSet
>[
FakeDyldEnvironmentArtifact
(),
FakeDyldEnvironmentArtifact
(),
]);
],
processManager:
FakeProcessManager
.
any
(),
);
});
});
group
(
'screenshot'
,
()
{
group
(
'screenshot'
,
()
{
...
...
packages/flutter_tools/test/general.shard/macos/xcode_test.dart
View file @
0a59698e
...
@@ -354,7 +354,7 @@ void main() {
...
@@ -354,7 +354,7 @@ void main() {
xcode:
xcode
,
xcode:
xcode
,
platform:
null
,
platform:
null
,
artifacts:
Artifacts
.
test
(),
artifacts:
Artifacts
.
test
(),
cache:
Cache
.
test
(),
cache:
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
),
iproxy:
IProxy
.
test
(
logger:
logger
,
processManager:
fakeProcessManager
),
iproxy:
IProxy
.
test
(
logger:
logger
,
processManager:
fakeProcessManager
),
);
);
});
});
...
@@ -382,7 +382,7 @@ void main() {
...
@@ -382,7 +382,7 @@ void main() {
xcode:
xcode
,
xcode:
xcode
,
platform:
null
,
platform:
null
,
artifacts:
Artifacts
.
test
(),
artifacts:
Artifacts
.
test
(),
cache:
Cache
.
test
(),
cache:
Cache
.
test
(
processManager:
FakeProcessManager
.
any
()
),
iproxy:
IProxy
.
test
(
logger:
logger
,
processManager:
fakeProcessManager
),
iproxy:
IProxy
.
test
(
logger:
logger
,
processManager:
fakeProcessManager
),
);
);
});
});
...
...
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