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
Expand all
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
This diff is collapsed.
Click to expand it.
packages/flutter_tools/lib/src/globals.dart
View file @
d1459384
...
...
@@ -11,15 +11,12 @@ import 'fuchsia/fuchsia_sdk.dart';
import
'ios/simulators.dart'
;
import
'macos/xcdevice.dart'
;
import
'reporting/crash_reporting.dart'
;
import
'runner/local_engine.dart'
;
export
'globals_null_migrated.dart'
;
CrashReporter
get
crashReporter
=>
context
.
get
<
CrashReporter
>();
Doctor
get
doctor
=>
context
.
get
<
Doctor
>();
DeviceManager
get
deviceManager
=>
context
.
get
<
DeviceManager
>();
LocalEngineLocator
get
localEngineLocator
=>
context
.
get
<
LocalEngineLocator
>();
FuchsiaArtifacts
get
fuchsiaArtifacts
=>
context
.
get
<
FuchsiaArtifacts
>();
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';
import
'persistent_tool_state.dart'
;
import
'project.dart'
;
import
'reporting/reporting.dart'
;
import
'runner/local_engine.dart'
;
import
'version.dart'
;
/// The flutter GitHub repository.
...
...
@@ -56,6 +57,7 @@ Usage get flutterUsage => context.get<Usage>()!;
XcodeProjectInterpreter
?
get
xcodeProjectInterpreter
=>
context
.
get
<
XcodeProjectInterpreter
>();
Xcode
?
get
xcode
=>
context
.
get
<
Xcode
>();
IOSWorkflow
?
get
iosWorkflow
=>
context
.
get
<
IOSWorkflow
>();
LocalEngineLocator
?
get
localEngineLocator
=>
context
.
get
<
LocalEngineLocator
>();
PersistentToolState
?
get
persistentToolState
=>
PersistentToolState
.
instance
;
...
...
packages/flutter_tools/test/general.shard/cache_test.dart
View file @
d1459384
...
...
@@ -159,7 +159,11 @@ void main() {
testWithoutContext
(
'Gradle wrapper will delete .properties/NOTICES if they exist'
,
()
async
{
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
(
processManager:
FakeProcessManager
.
any
(),
platform:
FakePlatform
(),
...
...
@@ -167,10 +171,9 @@ void main() {
fileSystem:
fileSystem
,
);
final
GradleWrapper
gradleWrapper
=
GradleWrapper
(
cache
);
final
Directory
directory
=
cache
.
getCacheDir
(
fileSystem
.
path
.
join
(
'artifacts'
,
'gradle_wrapper'
));
final
File
propertiesFile
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
directory
.
path
,
'gradle'
,
'wrapper'
,
'gradle-wrapper.properties'
))
final
File
propertiesFile
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
artifactDir
.
path
,
'gradle'
,
'wrapper'
,
'gradle-wrapper.properties'
))
..
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
);
await
gradleWrapper
.
updateInner
(
FakeArtifactUpdater
(),
fileSystem
,
operatingSystemUtils
);
...
...
@@ -429,10 +432,9 @@ void main() {
testWithoutContext
(
'FlutterRunnerDebugSymbols downloads Flutter runner debug symbols'
,
()
async
{
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
Cache
cache
=
Cache
.
test
(
fileSystem:
fileSystem
,
processManager:
FakeProcessManager
.
any
(),
);
final
Cache
cache
=
FakeSecondaryCache
()
..
version
=
'123456'
;
final
FakeVersionedPackageResolver
packageResolver
=
FakeVersionedPackageResolver
();
final
FlutterRunnerDebugSymbols
flutterRunnerDebugSymbols
=
FlutterRunnerDebugSymbols
(
cache
,
...
...
@@ -443,8 +445,8 @@ void main() {
await
flutterRunnerDebugSymbols
.
updateInner
(
FakeArtifactUpdater
(),
fileSystem
,
FakeOperatingSystemUtils
());
expect
(
packageResolver
.
resolved
,
<
List
<
String
>>[
<
String
>[
'fuchsia-debug-symbols-x64'
,
null
],
<
String
>[
'fuchsia-debug-symbols-arm64'
,
null
],
<
String
>[
'fuchsia-debug-symbols-x64'
,
'123456'
],
<
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