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
dbed10bb
Unverified
Commit
dbed10bb
authored
Mar 09, 2022
by
Lau Ching Jun
Committed by
GitHub
Mar 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass 'assume-initialize-from-dill-up-to-date' flag to the frontend server (#99791)
parent
f0524d54
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
0 deletions
+65
-0
build_info.dart
packages/flutter_tools/lib/src/build_info.dart
+5
-0
compile.dart
packages/flutter_tools/lib/src/compile.dart
+4
-0
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+2
-0
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+8
-0
resident_runner_test.dart
...lutter_tools/test/general.shard/resident_runner_test.dart
+24
-0
flutter_command_test.dart
...tools/test/general.shard/runner/flutter_command_test.dart
+22
-0
No files found.
packages/flutter_tools/lib/src/build_info.dart
View file @
dbed10bb
...
...
@@ -42,6 +42,7 @@ class BuildInfo {
this
.
androidGradleDaemon
=
true
,
this
.
packageConfig
=
PackageConfig
.
empty
,
this
.
initializeFromDill
,
this
.
assumeInitializeFromDillUpToDate
=
false
,
})
:
extraFrontEndOptions
=
extraFrontEndOptions
??
const
<
String
>[],
extraGenSnapshotOptions
=
extraGenSnapshotOptions
??
const
<
String
>[],
fileSystemRoots
=
fileSystemRoots
??
const
<
String
>[],
...
...
@@ -159,6 +160,10 @@ class BuildInfo {
/// If this is null, it will be initialized from the default cached location.
final
String
?
initializeFromDill
;
/// If set, assumes that the file passed in [initializeFromDill] is up to date
/// and skips the check and potential invalidation of files.
final
bool
assumeInitializeFromDillUpToDate
;
static
const
BuildInfo
debug
=
BuildInfo
(
BuildMode
.
debug
,
null
,
treeShakeIcons:
false
);
static
const
BuildInfo
profile
=
BuildInfo
(
BuildMode
.
profile
,
null
,
treeShakeIcons:
kIconTreeShakerEnabledDefault
);
static
const
BuildInfo
jitRelease
=
BuildInfo
(
BuildMode
.
jitRelease
,
null
,
treeShakeIcons:
kIconTreeShakerEnabledDefault
);
...
...
packages/flutter_tools/lib/src/compile.dart
View file @
dbed10bb
...
...
@@ -451,6 +451,7 @@ abstract class ResidentCompiler {
List
<
String
>
fileSystemRoots
,
String
?
fileSystemScheme
,
String
initializeFromDill
,
bool
assumeInitializeFromDillUpToDate
,
TargetModel
targetModel
,
bool
unsafePackageSerialization
,
List
<
String
>
extraFrontEndOptions
,
...
...
@@ -559,6 +560,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
List
<
String
>
fileSystemRoots
=
const
<
String
>[],
this
.
fileSystemScheme
,
this
.
initializeFromDill
,
this
.
assumeInitializeFromDillUpToDate
=
false
,
this
.
targetModel
=
TargetModel
.
flutter
,
this
.
unsafePackageSerialization
=
false
,
this
.
extraFrontEndOptions
,
...
...
@@ -591,6 +593,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
final
List
<
String
>
fileSystemRoots
;
final
String
?
fileSystemScheme
;
final
String
?
initializeFromDill
;
final
bool
assumeInitializeFromDillUpToDate
;
final
bool
unsafePackageSerialization
;
final
List
<
String
>?
extraFrontEndOptions
;
final
List
<
String
>
dartDefines
;
...
...
@@ -768,6 +771,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
'--initialize-from-dill'
,
initializeFromDill
!,
],
if
(
assumeInitializeFromDillUpToDate
)
'--assume-initialize-from-dill-up-to-date'
,
if
(
additionalSource
!=
null
)
...<
String
>[
'--source'
,
additionalSource
,
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
dbed10bb
...
...
@@ -126,6 +126,7 @@ class FlutterDevice {
dartDefines:
buildInfo
.
dartDefines
,
extraFrontEndOptions:
extraFrontEndOptions
,
),
assumeInitializeFromDillUpToDate:
buildInfo
.
assumeInitializeFromDillUpToDate
,
targetModel:
TargetModel
.
dartdevc
,
extraFrontEndOptions:
extraFrontEndOptions
,
platformDill:
globals
.
fs
.
file
(
globals
.
artifacts
...
...
@@ -168,6 +169,7 @@ class FlutterDevice {
dartDefines:
buildInfo
.
dartDefines
,
extraFrontEndOptions:
extraFrontEndOptions
,
),
assumeInitializeFromDillUpToDate:
buildInfo
.
assumeInitializeFromDillUpToDate
,
packagesPath:
buildInfo
.
packagesPath
,
artifacts:
globals
.
artifacts
,
processManager:
globals
.
processManager
,
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
dbed10bb
...
...
@@ -115,6 +115,7 @@ class FlutterOptions {
static
const
String
kDeferredComponents
=
'deferred-components'
;
static
const
String
kAndroidProjectArgs
=
'android-project-arg'
;
static
const
String
kInitializeFromDill
=
'initialize-from-dill'
;
static
const
String
kAssumeInitializeFromDillUpToDate
=
'assume-initialize-from-dill-up-to-date'
;
static
const
String
kFatalWarnings
=
'fatal-warnings'
;
}
...
...
@@ -829,6 +830,11 @@ abstract class FlutterCommand extends Command<void> {
'the default cached location.'
,
hide:
hide
,
);
argParser
.
addFlag
(
FlutterOptions
.
kAssumeInitializeFromDillUpToDate
,
help:
'If set, assumes that the file passed in initialize-from-dill is up '
'to date and skip the check and potential invalidation of files.'
,
hide:
hide
,
);
}
void
addMultidexOption
({
bool
hide
=
false
})
{
...
...
@@ -1113,6 +1119,8 @@ abstract class FlutterCommand extends Command<void> {
initializeFromDill:
argParser
.
options
.
containsKey
(
FlutterOptions
.
kInitializeFromDill
)
?
stringArg
(
FlutterOptions
.
kInitializeFromDill
)
:
null
,
assumeInitializeFromDillUpToDate:
argParser
.
options
.
containsKey
(
FlutterOptions
.
kAssumeInitializeFromDillUpToDate
)
&&
boolArg
(
FlutterOptions
.
kAssumeInitializeFromDillUpToDate
),
);
}
...
...
packages/flutter_tools/test/general.shard/resident_runner_test.dart
View file @
dbed10bb
...
...
@@ -1882,6 +1882,30 @@ flutter:
)).
generator
as
DefaultResidentCompiler
;
expect
(
residentCompiler
.
initializeFromDill
,
'/foo/bar.dill'
);
expect
(
residentCompiler
.
assumeInitializeFromDillUpToDate
,
false
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
FileSystem:
()
=>
MemoryFileSystem
.
test
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'FlutterDevice passes assumeInitializeFromDillUpToDate parameter if specified'
,
()
async
{
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
final
FakeDevice
device
=
FakeDevice
();
final
DefaultResidentCompiler
residentCompiler
=
(
await
FlutterDevice
.
create
(
device
,
buildInfo:
const
BuildInfo
(
BuildMode
.
debug
,
''
,
treeShakeIcons:
false
,
extraFrontEndOptions:
<
String
>[],
assumeInitializeFromDillUpToDate:
true
,
),
target:
null
,
platform:
null
,
)).
generator
as
DefaultResidentCompiler
;
expect
(
residentCompiler
.
assumeInitializeFromDillUpToDate
,
true
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
FileSystem:
()
=>
MemoryFileSystem
.
test
(),
...
...
packages/flutter_tools/test/general.shard/runner/flutter_command_test.dart
View file @
dbed10bb
...
...
@@ -588,6 +588,28 @@ void main() {
ProcessManager:
()
=>
processManager
,
});
testUsingContext
(
'includes assumeInitializeFromDillUpToDate in BuildInfo'
,
()
async
{
final
DummyFlutterCommand
flutterCommand
=
DummyFlutterCommand
()..
usesInitializeFromDillOption
(
hide:
false
);
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
flutterCommand
);
await
runner
.
run
(<
String
>[
'dummy'
,
'--assume-initialize-from-dill-up-to-date'
]);
final
BuildInfo
buildInfo
=
await
flutterCommand
.
getBuildInfo
(
forcedBuildMode:
BuildMode
.
debug
);
expect
(
buildInfo
.
assumeInitializeFromDillUpToDate
,
isTrue
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
});
testUsingContext
(
'unsets assumeInitializeFromDillUpToDate in BuildInfo when disabled'
,
()
async
{
final
DummyFlutterCommand
flutterCommand
=
DummyFlutterCommand
()..
usesInitializeFromDillOption
(
hide:
false
);
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
flutterCommand
);
await
runner
.
run
(<
String
>[
'dummy'
,
'--no-assume-initialize-from-dill-up-to-date'
]);
final
BuildInfo
buildInfo
=
await
flutterCommand
.
getBuildInfo
(
forcedBuildMode:
BuildMode
.
debug
);
expect
(
buildInfo
.
assumeInitializeFromDillUpToDate
,
isFalse
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
});
testUsingContext
(
'dds options'
,
()
async
{
final
FakeDdsCommand
ddsCommand
=
FakeDdsCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
ddsCommand
);
...
...
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