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
d1459384
Unverified
Commit
d1459384
authored
Jun 25, 2021
by
Jenn Magder
Committed by
GitHub
Jun 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate flutter_cache to null safety (#85242)
parent
4bd47ce6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
51 deletions
+50
-51
flutter_cache.dart
packages/flutter_tools/lib/src/flutter_cache.dart
+36
-38
globals.dart
packages/flutter_tools/lib/src/globals.dart
+0
-3
globals_null_migrated.dart
packages/flutter_tools/lib/src/globals_null_migrated.dart
+2
-0
cache_test.dart
packages/flutter_tools/test/general.shard/cache_test.dart
+12
-10
No files found.
packages/flutter_tools/lib/src/flutter_cache.dart
View file @
d1459384
...
@@ -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:meta/meta.dart'
;
import
'package:meta/meta.dart'
;
...
@@ -20,17 +18,17 @@ import 'base/process.dart';
...
@@ -20,17 +18,17 @@ import 'base/process.dart';
import
'cache.dart'
;
import
'cache.dart'
;
import
'dart/package_map.dart'
;
import
'dart/package_map.dart'
;
import
'dart/pub.dart'
;
import
'dart/pub.dart'
;
import
'globals.dart'
as
globals
;
import
'globals
_null_migrated
.dart'
as
globals
;
/// An implementation of the [Cache] which provides all of Flutter's default artifacts.
/// An implementation of the [Cache] which provides all of Flutter's default artifacts.
class
FlutterCache
extends
Cache
{
class
FlutterCache
extends
Cache
{
/// [rootOverride] is configurable for testing.
/// [rootOverride] is configurable for testing.
/// [artifacts] is configurable for testing.
/// [artifacts] is configurable for testing.
FlutterCache
({
FlutterCache
({
@
required
Logger
logger
,
required
Logger
logger
,
@
required
FileSystem
fileSystem
,
required
FileSystem
fileSystem
,
@
required
Platform
platform
,
required
Platform
platform
,
@
required
OperatingSystemUtils
osUtils
,
required
OperatingSystemUtils
osUtils
,
})
:
super
(
logger:
logger
,
fileSystem:
fileSystem
,
platform:
platform
,
osUtils:
osUtils
,
artifacts:
<
ArtifactSet
>[])
{
})
:
super
(
logger:
logger
,
fileSystem:
fileSystem
,
platform:
platform
,
osUtils:
osUtils
,
artifacts:
<
ArtifactSet
>[])
{
registerArtifact
(
MaterialFonts
(
this
));
registerArtifact
(
MaterialFonts
(
this
));
registerArtifact
(
GradleWrapper
(
this
));
registerArtifact
(
GradleWrapper
(
this
));
...
@@ -55,7 +53,7 @@ class FlutterCache extends Cache {
...
@@ -55,7 +53,7 @@ class FlutterCache extends Cache {
logger:
logger
,
logger:
logger
,
// flutter root and pub must be lazily initialized to avoid accessing
// flutter root and pub must be lazily initialized to avoid accessing
// before the version is determined.
// before the version is determined.
flutterRoot:
()
=>
Cache
.
flutterRoot
,
flutterRoot:
()
=>
Cache
.
flutterRoot
!
,
pub:
()
=>
pub
,
pub:
()
=>
pub
,
));
));
}
}
...
@@ -70,9 +68,9 @@ class FlutterCache extends Cache {
...
@@ -70,9 +68,9 @@ class FlutterCache extends Cache {
class
PubDependencies
extends
ArtifactSet
{
class
PubDependencies
extends
ArtifactSet
{
PubDependencies
({
PubDependencies
({
// Needs to be lazy to avoid reading from the cache before the root is initialized.
// Needs to be lazy to avoid reading from the cache before the root is initialized.
@
required
String
Function
()
flutterRoot
,
required
String
Function
()
flutterRoot
,
@
required
Logger
logger
,
required
Logger
logger
,
@
required
Pub
Function
()
pub
,
required
Pub
Function
()
pub
,
})
:
_logger
=
logger
,
})
:
_logger
=
logger
,
_flutterRoot
=
flutterRoot
,
_flutterRoot
=
flutterRoot
,
_pub
=
pub
,
_pub
=
pub
,
...
@@ -139,8 +137,8 @@ class MaterialFonts extends CachedArtifact {
...
@@ -139,8 +137,8 @@ class MaterialFonts extends CachedArtifact {
ArtifactUpdater
artifactUpdater
,
ArtifactUpdater
artifactUpdater
,
FileSystem
fileSystem
,
FileSystem
fileSystem
,
OperatingSystemUtils
operatingSystemUtils
,
OperatingSystemUtils
operatingSystemUtils
,
)
{
)
async
{
final
Uri
archiveUri
=
_toStorageUri
(
version
);
final
Uri
archiveUri
=
_toStorageUri
(
version
!
);
return
artifactUpdater
.
downloadZipArchive
(
'Downloading Material fonts...'
,
archiveUri
,
location
);
return
artifactUpdater
.
downloadZipArchive
(
'Downloading Material fonts...'
,
archiveUri
,
location
);
}
}
...
@@ -152,7 +150,7 @@ class MaterialFonts extends CachedArtifact {
...
@@ -152,7 +150,7 @@ class MaterialFonts extends CachedArtifact {
///
///
/// This SDK references code within the regular Dart sdk to reduce download size.
/// This SDK references code within the regular Dart sdk to reduce download size.
class
FlutterWebSdk
extends
CachedArtifact
{
class
FlutterWebSdk
extends
CachedArtifact
{
FlutterWebSdk
(
Cache
cache
,
{
@
required
Platform
platform
})
FlutterWebSdk
(
Cache
cache
,
{
required
Platform
platform
})
:
_platform
=
platform
,
:
_platform
=
platform
,
super
(
super
(
'flutter_web_sdk'
,
'flutter_web_sdk'
,
...
@@ -166,7 +164,7 @@ class FlutterWebSdk extends CachedArtifact {
...
@@ -166,7 +164,7 @@ class FlutterWebSdk extends CachedArtifact {
Directory
get
location
=>
cache
.
getWebSdkDirectory
();
Directory
get
location
=>
cache
.
getWebSdkDirectory
();
@override
@override
String
get
version
=>
cache
.
getVersionFor
(
'engine'
);
String
?
get
version
=>
cache
.
getVersionFor
(
'engine'
);
@override
@override
Future
<
void
>
updateInner
(
Future
<
void
>
updateInner
(
...
@@ -205,7 +203,7 @@ class FlutterWebSdk extends CachedArtifact {
...
@@ -205,7 +203,7 @@ class FlutterWebSdk extends CachedArtifact {
/// A cached artifact containing the dart:ui source code.
/// A cached artifact containing the dart:ui source code.
class
FlutterSdk
extends
EngineCachedArtifact
{
class
FlutterSdk
extends
EngineCachedArtifact
{
FlutterSdk
(
Cache
cache
,
{
FlutterSdk
(
Cache
cache
,
{
@
required
Platform
platform
,
required
Platform
platform
,
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
super
(
'flutter_sdk'
,
'flutter_sdk'
,
...
@@ -245,7 +243,7 @@ class FlutterSdk extends EngineCachedArtifact {
...
@@ -245,7 +243,7 @@ class FlutterSdk extends EngineCachedArtifact {
class
MacOSEngineArtifacts
extends
EngineCachedArtifact
{
class
MacOSEngineArtifacts
extends
EngineCachedArtifact
{
MacOSEngineArtifacts
(
Cache
cache
,
{
MacOSEngineArtifacts
(
Cache
cache
,
{
@
required
Platform
platform
,
required
Platform
platform
,
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
super
(
'macos-sdk'
,
'macos-sdk'
,
...
@@ -273,7 +271,7 @@ class MacOSEngineArtifacts extends EngineCachedArtifact {
...
@@ -273,7 +271,7 @@ class MacOSEngineArtifacts extends EngineCachedArtifact {
/// Artifacts required for desktop Windows builds.
/// Artifacts required for desktop Windows builds.
class
WindowsEngineArtifacts
extends
EngineCachedArtifact
{
class
WindowsEngineArtifacts
extends
EngineCachedArtifact
{
WindowsEngineArtifacts
(
Cache
cache
,
{
WindowsEngineArtifacts
(
Cache
cache
,
{
@
required
Platform
platform
,
required
Platform
platform
,
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
super
(
'windows-sdk'
,
'windows-sdk'
,
...
@@ -300,7 +298,7 @@ class WindowsEngineArtifacts extends EngineCachedArtifact {
...
@@ -300,7 +298,7 @@ class WindowsEngineArtifacts extends EngineCachedArtifact {
class
WindowsUwpEngineArtifacts
extends
EngineCachedArtifact
{
class
WindowsUwpEngineArtifacts
extends
EngineCachedArtifact
{
WindowsUwpEngineArtifacts
(
Cache
cache
,
{
WindowsUwpEngineArtifacts
(
Cache
cache
,
{
@
required
Platform
platform
,
required
Platform
platform
,
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
super
(
'windows-uwp-sdk'
,
'windows-uwp-sdk'
,
...
@@ -328,7 +326,7 @@ class WindowsUwpEngineArtifacts extends EngineCachedArtifact {
...
@@ -328,7 +326,7 @@ class WindowsUwpEngineArtifacts extends EngineCachedArtifact {
/// Artifacts required for desktop Linux builds.
/// Artifacts required for desktop Linux builds.
class
LinuxEngineArtifacts
extends
EngineCachedArtifact
{
class
LinuxEngineArtifacts
extends
EngineCachedArtifact
{
LinuxEngineArtifacts
(
Cache
cache
,
{
LinuxEngineArtifacts
(
Cache
cache
,
{
@
required
Platform
platform
required
Platform
platform
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
super
(
'linux-sdk'
,
'linux-sdk'
,
...
@@ -361,7 +359,7 @@ class LinuxEngineArtifacts extends EngineCachedArtifact {
...
@@ -361,7 +359,7 @@ class LinuxEngineArtifacts extends EngineCachedArtifact {
/// The artifact used to generate snapshots for Android builds.
/// The artifact used to generate snapshots for Android builds.
class
AndroidGenSnapshotArtifacts
extends
EngineCachedArtifact
{
class
AndroidGenSnapshotArtifacts
extends
EngineCachedArtifact
{
AndroidGenSnapshotArtifacts
(
Cache
cache
,
{
AndroidGenSnapshotArtifacts
(
Cache
cache
,
{
@
required
Platform
platform
,
required
Platform
platform
,
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
super
(
'android-sdk'
,
'android-sdk'
,
...
@@ -400,7 +398,7 @@ class AndroidGenSnapshotArtifacts extends EngineCachedArtifact {
...
@@ -400,7 +398,7 @@ class AndroidGenSnapshotArtifacts extends EngineCachedArtifact {
/// This is a no-op if the android SDK is not available.
/// This is a no-op if the android SDK is not available.
class
AndroidMavenArtifacts
extends
ArtifactSet
{
class
AndroidMavenArtifacts
extends
ArtifactSet
{
AndroidMavenArtifacts
(
this
.
cache
,
{
AndroidMavenArtifacts
(
this
.
cache
,
{
@
required
Platform
platform
,
required
Platform
platform
,
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
DevelopmentArtifact
.
androidMaven
);
super
(
DevelopmentArtifact
.
androidMaven
);
...
@@ -418,7 +416,7 @@ class AndroidMavenArtifacts extends ArtifactSet {
...
@@ -418,7 +416,7 @@ class AndroidMavenArtifacts extends ArtifactSet {
return
;
return
;
}
}
final
Directory
tempDir
=
cache
.
getRoot
().
createTempSync
(
'flutter_gradle_wrapper.'
);
final
Directory
tempDir
=
cache
.
getRoot
().
createTempSync
(
'flutter_gradle_wrapper.'
);
globals
.
gradleUtils
.
injectGradleWrapperIfNeeded
(
tempDir
);
globals
.
gradleUtils
?
.
injectGradleWrapperIfNeeded
(
tempDir
);
final
Status
status
=
logger
.
startProgress
(
'Downloading Android Maven dependencies...'
);
final
Status
status
=
logger
.
startProgress
(
'Downloading Android Maven dependencies...'
);
final
File
gradle
=
tempDir
.
childFile
(
final
File
gradle
=
tempDir
.
childFile
(
...
@@ -426,7 +424,7 @@ class AndroidMavenArtifacts extends ArtifactSet {
...
@@ -426,7 +424,7 @@ class AndroidMavenArtifacts extends ArtifactSet {
);
);
try
{
try
{
final
String
gradleExecutable
=
gradle
.
absolute
.
path
;
final
String
gradleExecutable
=
gradle
.
absolute
.
path
;
final
String
flutterSdk
=
globals
.
fsUtils
.
escapePath
(
Cache
.
flutterRoot
);
final
String
flutterSdk
=
globals
.
fsUtils
.
escapePath
(
Cache
.
flutterRoot
!
);
final
RunResult
processResult
=
await
globals
.
processUtils
.
run
(
final
RunResult
processResult
=
await
globals
.
processUtils
.
run
(
<
String
>[
<
String
>[
gradleExecutable
,
gradleExecutable
,
...
@@ -436,7 +434,7 @@ class AndroidMavenArtifacts extends ArtifactSet {
...
@@ -436,7 +434,7 @@ class AndroidMavenArtifacts extends ArtifactSet {
],
],
environment:
<
String
,
String
>{
environment:
<
String
,
String
>{
if
(
javaPath
!=
null
)
if
(
javaPath
!=
null
)
'JAVA_HOME'
:
javaPath
,
'JAVA_HOME'
:
javaPath
!
,
},
},
);
);
if
(
processResult
.
exitCode
!=
0
)
{
if
(
processResult
.
exitCode
!=
0
)
{
...
@@ -484,7 +482,7 @@ class AndroidInternalBuildArtifacts extends EngineCachedArtifact {
...
@@ -484,7 +482,7 @@ class AndroidInternalBuildArtifacts extends EngineCachedArtifact {
class
IOSEngineArtifacts
extends
EngineCachedArtifact
{
class
IOSEngineArtifacts
extends
EngineCachedArtifact
{
IOSEngineArtifacts
(
Cache
cache
,
{
IOSEngineArtifacts
(
Cache
cache
,
{
@
required
Platform
platform
,
required
Platform
platform
,
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
super
(
'ios-sdk'
,
'ios-sdk'
,
...
@@ -537,7 +535,7 @@ class GradleWrapper extends CachedArtifact {
...
@@ -537,7 +535,7 @@ class GradleWrapper extends CachedArtifact {
FileSystem
fileSystem
,
FileSystem
fileSystem
,
OperatingSystemUtils
operatingSystemUtils
,
OperatingSystemUtils
operatingSystemUtils
,
)
async
{
)
async
{
final
Uri
archiveUri
=
_toStorageUri
(
version
);
final
Uri
archiveUri
=
_toStorageUri
(
version
!
);
await
artifactUpdater
.
downloadZippedTarball
(
'Downloading Gradle Wrapper...'
,
archiveUri
,
location
);
await
artifactUpdater
.
downloadZippedTarball
(
'Downloading Gradle Wrapper...'
,
archiveUri
,
location
);
// Delete property file, allowing templates to provide it.
// Delete property file, allowing templates to provide it.
// Remove NOTICE file. Should not be part of the template.
// Remove NOTICE file. Should not be part of the template.
...
@@ -597,7 +595,7 @@ abstract class _FuchsiaSDKArtifacts extends CachedArtifact {
...
@@ -597,7 +595,7 @@ abstract class _FuchsiaSDKArtifacts extends CachedArtifact {
/// The pre-built flutter runner for Fuchsia development.
/// The pre-built flutter runner for Fuchsia development.
class
FlutterRunnerSDKArtifacts
extends
CachedArtifact
{
class
FlutterRunnerSDKArtifacts
extends
CachedArtifact
{
FlutterRunnerSDKArtifacts
(
Cache
cache
,
{
FlutterRunnerSDKArtifacts
(
Cache
cache
,
{
@
required
Platform
platform
,
required
Platform
platform
,
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
super
(
'flutter_runner'
,
'flutter_runner'
,
...
@@ -611,7 +609,7 @@ class FlutterRunnerSDKArtifacts extends CachedArtifact {
...
@@ -611,7 +609,7 @@ class FlutterRunnerSDKArtifacts extends CachedArtifact {
Directory
get
location
=>
cache
.
getArtifactDirectory
(
'flutter_runner'
);
Directory
get
location
=>
cache
.
getArtifactDirectory
(
'flutter_runner'
);
@override
@override
String
get
version
=>
cache
.
getVersionFor
(
'engine'
);
String
?
get
version
=>
cache
.
getVersionFor
(
'engine'
);
@override
@override
Future
<
void
>
updateInner
(
Future
<
void
>
updateInner
(
...
@@ -650,7 +648,7 @@ class CipdArchiveResolver extends VersionedPackageResolver {
...
@@ -650,7 +648,7 @@ class CipdArchiveResolver extends VersionedPackageResolver {
/// The debug symbols for flutter runner for Fuchsia development.
/// The debug symbols for flutter runner for Fuchsia development.
class
FlutterRunnerDebugSymbols
extends
CachedArtifact
{
class
FlutterRunnerDebugSymbols
extends
CachedArtifact
{
FlutterRunnerDebugSymbols
(
Cache
cache
,
{
FlutterRunnerDebugSymbols
(
Cache
cache
,
{
@
required
Platform
platform
,
required
Platform
platform
,
this
.
packageResolver
=
const
CipdArchiveResolver
(),
this
.
packageResolver
=
const
CipdArchiveResolver
(),
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
'flutter_runner_debug_symbols'
,
cache
,
DevelopmentArtifact
.
flutterRunner
);
super
(
'flutter_runner_debug_symbols'
,
cache
,
DevelopmentArtifact
.
flutterRunner
);
...
@@ -662,11 +660,11 @@ class FlutterRunnerDebugSymbols extends CachedArtifact {
...
@@ -662,11 +660,11 @@ class FlutterRunnerDebugSymbols extends CachedArtifact {
Directory
get
location
=>
cache
.
getArtifactDirectory
(
name
);
Directory
get
location
=>
cache
.
getArtifactDirectory
(
name
);
@override
@override
String
get
version
=>
cache
.
getVersionFor
(
'engine'
);
String
?
get
version
=>
cache
.
getVersionFor
(
'engine'
);
Future
<
void
>
_downloadDebugSymbols
(
String
targetArch
,
ArtifactUpdater
artifactUpdater
)
async
{
Future
<
void
>
_downloadDebugSymbols
(
String
targetArch
,
ArtifactUpdater
artifactUpdater
)
async
{
final
String
packageName
=
'fuchsia-debug-symbols-
$targetArch
'
;
final
String
packageName
=
'fuchsia-debug-symbols-
$targetArch
'
;
final
String
url
=
packageResolver
.
resolveUrl
(
packageName
,
version
);
final
String
url
=
packageResolver
.
resolveUrl
(
packageName
,
version
!
);
await
artifactUpdater
.
downloadZipArchive
(
await
artifactUpdater
.
downloadZipArchive
(
'Downloading debug symbols for flutter runner - arch:
$targetArch
...'
,
'Downloading debug symbols for flutter runner - arch:
$targetArch
...'
,
Uri
.
parse
(
url
),
Uri
.
parse
(
url
),
...
@@ -691,7 +689,7 @@ class FlutterRunnerDebugSymbols extends CachedArtifact {
...
@@ -691,7 +689,7 @@ class FlutterRunnerDebugSymbols extends CachedArtifact {
/// The Fuchsia core SDK for Linux.
/// The Fuchsia core SDK for Linux.
class
LinuxFuchsiaSDKArtifacts
extends
_FuchsiaSDKArtifacts
{
class
LinuxFuchsiaSDKArtifacts
extends
_FuchsiaSDKArtifacts
{
LinuxFuchsiaSDKArtifacts
(
Cache
cache
,
{
LinuxFuchsiaSDKArtifacts
(
Cache
cache
,
{
@
required
Platform
platform
,
required
Platform
platform
,
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
cache
,
'linux'
);
super
(
cache
,
'linux'
);
...
@@ -713,7 +711,7 @@ class LinuxFuchsiaSDKArtifacts extends _FuchsiaSDKArtifacts {
...
@@ -713,7 +711,7 @@ class LinuxFuchsiaSDKArtifacts extends _FuchsiaSDKArtifacts {
/// The Fuchsia core SDK for MacOS.
/// The Fuchsia core SDK for MacOS.
class
MacOSFuchsiaSDKArtifacts
extends
_FuchsiaSDKArtifacts
{
class
MacOSFuchsiaSDKArtifacts
extends
_FuchsiaSDKArtifacts
{
MacOSFuchsiaSDKArtifacts
(
Cache
cache
,
{
MacOSFuchsiaSDKArtifacts
(
Cache
cache
,
{
@
required
Platform
platform
,
required
Platform
platform
,
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
cache
,
'mac'
);
super
(
cache
,
'mac'
);
...
@@ -735,7 +733,7 @@ class MacOSFuchsiaSDKArtifacts extends _FuchsiaSDKArtifacts {
...
@@ -735,7 +733,7 @@ class MacOSFuchsiaSDKArtifacts extends _FuchsiaSDKArtifacts {
/// Cached artifacts for font subsetting.
/// Cached artifacts for font subsetting.
class
FontSubsetArtifacts
extends
EngineCachedArtifact
{
class
FontSubsetArtifacts
extends
EngineCachedArtifact
{
FontSubsetArtifacts
(
Cache
cache
,
{
FontSubsetArtifacts
(
Cache
cache
,
{
@
required
Platform
platform
,
required
Platform
platform
,
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
artifactName
,
cache
,
DevelopmentArtifact
.
universal
);
super
(
artifactName
,
cache
,
DevelopmentArtifact
.
universal
);
...
@@ -755,7 +753,7 @@ class FontSubsetArtifacts extends EngineCachedArtifact {
...
@@ -755,7 +753,7 @@ class FontSubsetArtifacts extends EngineCachedArtifact {
if
(
cache
.
includeAllPlatforms
)
{
if
(
cache
.
includeAllPlatforms
)
{
return
artifacts
.
values
.
toList
();
return
artifacts
.
values
.
toList
();
}
else
{
}
else
{
final
List
<
String
>
binaryDirs
=
artifacts
[
_platform
.
operatingSystem
];
final
List
<
String
>
?
binaryDirs
=
artifacts
[
_platform
.
operatingSystem
];
if
(
binaryDirs
==
null
)
{
if
(
binaryDirs
==
null
)
{
throwToolExit
(
'Unsupported operating system:
${_platform.operatingSystem}
'
);
throwToolExit
(
'Unsupported operating system:
${_platform.operatingSystem}
'
);
}
}
...
@@ -773,7 +771,7 @@ class FontSubsetArtifacts extends EngineCachedArtifact {
...
@@ -773,7 +771,7 @@ class FontSubsetArtifacts extends EngineCachedArtifact {
/// Cached iOS/USB binary artifacts.
/// Cached iOS/USB binary artifacts.
class
IosUsbArtifacts
extends
CachedArtifact
{
class
IosUsbArtifacts
extends
CachedArtifact
{
IosUsbArtifacts
(
String
name
,
Cache
cache
,
{
IosUsbArtifacts
(
String
name
,
Cache
cache
,
{
@
required
Platform
platform
,
required
Platform
platform
,
})
:
_platform
=
platform
,
})
:
_platform
=
platform
,
super
(
super
(
name
,
name
,
...
@@ -814,7 +812,7 @@ class IosUsbArtifacts extends CachedArtifact {
...
@@ -814,7 +812,7 @@ class IosUsbArtifacts extends CachedArtifact {
@override
@override
bool
isUpToDateInner
(
FileSystem
fileSystem
)
{
bool
isUpToDateInner
(
FileSystem
fileSystem
)
{
final
List
<
String
>
executables
=
_kExecutables
[
name
];
final
List
<
String
>
?
executables
=
_kExecutables
[
name
];
if
(
executables
==
null
)
{
if
(
executables
==
null
)
{
return
true
;
return
true
;
}
}
...
...
packages/flutter_tools/lib/src/globals.dart
View file @
d1459384
...
@@ -11,15 +11,12 @@ import 'fuchsia/fuchsia_sdk.dart';
...
@@ -11,15 +11,12 @@ import 'fuchsia/fuchsia_sdk.dart';
import
'ios/simulators.dart'
;
import
'ios/simulators.dart'
;
import
'macos/xcdevice.dart'
;
import
'macos/xcdevice.dart'
;
import
'reporting/crash_reporting.dart'
;
import
'reporting/crash_reporting.dart'
;
import
'runner/local_engine.dart'
;
export
'globals_null_migrated.dart'
;
export
'globals_null_migrated.dart'
;
CrashReporter
get
crashReporter
=>
context
.
get
<
CrashReporter
>();
CrashReporter
get
crashReporter
=>
context
.
get
<
CrashReporter
>();
Doctor
get
doctor
=>
context
.
get
<
Doctor
>();
Doctor
get
doctor
=>
context
.
get
<
Doctor
>();
DeviceManager
get
deviceManager
=>
context
.
get
<
DeviceManager
>();
DeviceManager
get
deviceManager
=>
context
.
get
<
DeviceManager
>();
LocalEngineLocator
get
localEngineLocator
=>
context
.
get
<
LocalEngineLocator
>();
FuchsiaArtifacts
get
fuchsiaArtifacts
=>
context
.
get
<
FuchsiaArtifacts
>();
FuchsiaArtifacts
get
fuchsiaArtifacts
=>
context
.
get
<
FuchsiaArtifacts
>();
IOSSimulatorUtils
get
iosSimulatorUtils
=>
context
.
get
<
IOSSimulatorUtils
>();
IOSSimulatorUtils
get
iosSimulatorUtils
=>
context
.
get
<
IOSSimulatorUtils
>();
...
...
packages/flutter_tools/lib/src/globals_null_migrated.dart
View file @
d1459384
...
@@ -35,6 +35,7 @@ import 'macos/xcode.dart';
...
@@ -35,6 +35,7 @@ import 'macos/xcode.dart';
import
'persistent_tool_state.dart'
;
import
'persistent_tool_state.dart'
;
import
'project.dart'
;
import
'project.dart'
;
import
'reporting/reporting.dart'
;
import
'reporting/reporting.dart'
;
import
'runner/local_engine.dart'
;
import
'version.dart'
;
import
'version.dart'
;
/// The flutter GitHub repository.
/// The flutter GitHub repository.
...
@@ -56,6 +57,7 @@ Usage get flutterUsage => context.get<Usage>()!;
...
@@ -56,6 +57,7 @@ Usage get flutterUsage => context.get<Usage>()!;
XcodeProjectInterpreter
?
get
xcodeProjectInterpreter
=>
context
.
get
<
XcodeProjectInterpreter
>();
XcodeProjectInterpreter
?
get
xcodeProjectInterpreter
=>
context
.
get
<
XcodeProjectInterpreter
>();
Xcode
?
get
xcode
=>
context
.
get
<
Xcode
>();
Xcode
?
get
xcode
=>
context
.
get
<
Xcode
>();
IOSWorkflow
?
get
iosWorkflow
=>
context
.
get
<
IOSWorkflow
>();
IOSWorkflow
?
get
iosWorkflow
=>
context
.
get
<
IOSWorkflow
>();
LocalEngineLocator
?
get
localEngineLocator
=>
context
.
get
<
LocalEngineLocator
>();
PersistentToolState
?
get
persistentToolState
=>
PersistentToolState
.
instance
;
PersistentToolState
?
get
persistentToolState
=>
PersistentToolState
.
instance
;
...
...
packages/flutter_tools/test/general.shard/cache_test.dart
View file @
d1459384
...
@@ -159,7 +159,11 @@ void main() {
...
@@ -159,7 +159,11 @@ void main() {
testWithoutContext
(
'Gradle wrapper will delete .properties/NOTICES if they exist'
,
()
async
{
testWithoutContext
(
'Gradle wrapper will delete .properties/NOTICES if they exist'
,
()
async
{
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
Cache
cache
=
Cache
.
test
(
fileSystem:
fileSystem
,
processManager:
FakeProcessManager
.
any
());
final
Directory
artifactDir
=
fileSystem
.
systemTempDirectory
.
createTempSync
(
'flutter_cache_test_artifact.'
);
final
FakeSecondaryCache
cache
=
FakeSecondaryCache
()
..
artifactDirectory
=
artifactDir
..
version
=
'123456'
;
final
OperatingSystemUtils
operatingSystemUtils
=
OperatingSystemUtils
(
final
OperatingSystemUtils
operatingSystemUtils
=
OperatingSystemUtils
(
processManager:
FakeProcessManager
.
any
(),
processManager:
FakeProcessManager
.
any
(),
platform:
FakePlatform
(),
platform:
FakePlatform
(),
...
@@ -167,10 +171,9 @@ void main() {
...
@@ -167,10 +171,9 @@ void main() {
fileSystem:
fileSystem
,
fileSystem:
fileSystem
,
);
);
final
GradleWrapper
gradleWrapper
=
GradleWrapper
(
cache
);
final
GradleWrapper
gradleWrapper
=
GradleWrapper
(
cache
);
final
Directory
directory
=
cache
.
getCacheDir
(
fileSystem
.
path
.
join
(
'artifacts'
,
'gradle_wrapper'
));
final
File
propertiesFile
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
artifactDir
.
path
,
'gradle'
,
'wrapper'
,
'gradle-wrapper.properties'
))
final
File
propertiesFile
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
directory
.
path
,
'gradle'
,
'wrapper'
,
'gradle-wrapper.properties'
))
..
createSync
(
recursive:
true
);
..
createSync
(
recursive:
true
);
final
File
noticeFile
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
directory
.
path
,
'NOTICE'
))
final
File
noticeFile
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
artifactDir
.
path
,
'NOTICE'
))
..
createSync
(
recursive:
true
);
..
createSync
(
recursive:
true
);
await
gradleWrapper
.
updateInner
(
FakeArtifactUpdater
(),
fileSystem
,
operatingSystemUtils
);
await
gradleWrapper
.
updateInner
(
FakeArtifactUpdater
(),
fileSystem
,
operatingSystemUtils
);
...
@@ -429,10 +432,9 @@ void main() {
...
@@ -429,10 +432,9 @@ void main() {
testWithoutContext
(
'FlutterRunnerDebugSymbols downloads Flutter runner debug symbols'
,
()
async
{
testWithoutContext
(
'FlutterRunnerDebugSymbols downloads Flutter runner debug symbols'
,
()
async
{
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
Cache
cache
=
Cache
.
test
(
final
Cache
cache
=
FakeSecondaryCache
()
fileSystem:
fileSystem
,
..
version
=
'123456'
;
processManager:
FakeProcessManager
.
any
(),
);
final
FakeVersionedPackageResolver
packageResolver
=
FakeVersionedPackageResolver
();
final
FakeVersionedPackageResolver
packageResolver
=
FakeVersionedPackageResolver
();
final
FlutterRunnerDebugSymbols
flutterRunnerDebugSymbols
=
FlutterRunnerDebugSymbols
(
final
FlutterRunnerDebugSymbols
flutterRunnerDebugSymbols
=
FlutterRunnerDebugSymbols
(
cache
,
cache
,
...
@@ -443,8 +445,8 @@ void main() {
...
@@ -443,8 +445,8 @@ void main() {
await
flutterRunnerDebugSymbols
.
updateInner
(
FakeArtifactUpdater
(),
fileSystem
,
FakeOperatingSystemUtils
());
await
flutterRunnerDebugSymbols
.
updateInner
(
FakeArtifactUpdater
(),
fileSystem
,
FakeOperatingSystemUtils
());
expect
(
packageResolver
.
resolved
,
<
List
<
String
>>[
expect
(
packageResolver
.
resolved
,
<
List
<
String
>>[
<
String
>[
'fuchsia-debug-symbols-x64'
,
null
],
<
String
>[
'fuchsia-debug-symbols-x64'
,
'123456'
],
<
String
>[
'fuchsia-debug-symbols-arm64'
,
null
],
<
String
>[
'fuchsia-debug-symbols-arm64'
,
'123456'
],
]);
]);
});
});
...
...
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