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
34371372
Unverified
Commit
34371372
authored
Apr 11, 2022
by
Yang Chao
Committed by
GitHub
Apr 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable track widget creation when generating Generated.xcconfig (#101123)
parent
ff5e27f0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
6 deletions
+101
-6
build_info.dart
packages/flutter_tools/lib/src/build_info.dart
+1
-1
build_info_test.dart
...ges/flutter_tools/test/general.shard/build_info_test.dart
+11
-0
xcodeproj_test.dart
.../flutter_tools/test/general.shard/ios/xcodeproj_test.dart
+2
-2
resident_runner_test.dart
...lutter_tools/test/general.shard/resident_runner_test.dart
+30
-1
resident_web_runner_test.dart
...er_tools/test/general.shard/resident_web_runner_test.dart
+24
-2
flutter_tester_test.dart
..._tools/test/general.shard/tester/flutter_tester_test.dart
+33
-0
No files found.
packages/flutter_tools/lib/src/build_info.dart
View file @
34371372
...
...
@@ -164,7 +164,7 @@ class BuildInfo {
/// 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
debug
=
BuildInfo
(
BuildMode
.
debug
,
null
,
tr
ackWidgetCreation:
true
,
tr
eeShakeIcons:
false
);
static
const
BuildInfo
profile
=
BuildInfo
(
BuildMode
.
profile
,
null
,
treeShakeIcons:
kIconTreeShakerEnabledDefault
);
static
const
BuildInfo
jitRelease
=
BuildInfo
(
BuildMode
.
jitRelease
,
null
,
treeShakeIcons:
kIconTreeShakerEnabledDefault
);
static
const
BuildInfo
release
=
BuildInfo
(
BuildMode
.
release
,
null
,
treeShakeIcons:
kIconTreeShakerEnabledDefault
);
...
...
packages/flutter_tools/test/general.shard/build_info_test.dart
View file @
34371372
...
...
@@ -107,6 +107,17 @@ void main() {
expect
(()
=>
getIOSArchForName
(
'bogus'
),
throwsException
);
});
testWithoutContext
(
'named BuildInfo has correct defaults'
,
()
{
expect
(
BuildInfo
.
debug
.
mode
,
BuildMode
.
debug
);
expect
(
BuildInfo
.
debug
.
trackWidgetCreation
,
true
);
expect
(
BuildInfo
.
profile
.
mode
,
BuildMode
.
profile
);
expect
(
BuildInfo
.
profile
.
trackWidgetCreation
,
false
);
expect
(
BuildInfo
.
release
.
mode
,
BuildMode
.
release
);
expect
(
BuildInfo
.
release
.
trackWidgetCreation
,
false
);
});
testWithoutContext
(
'toBuildSystemEnvironment encoding of standard values'
,
()
{
const
BuildInfo
buildInfo
=
BuildInfo
(
BuildMode
.
debug
,
''
,
treeShakeIcons:
true
,
...
...
packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart
View file @
34371372
...
...
@@ -956,7 +956,7 @@ Build settings for action build and target plugin2:
});
testUsingOsxContext
(
'sets TRACK_WIDGET_CREATION=true when trackWidgetCreation is true'
,
()
async
{
const
BuildInfo
buildInfo
=
BuildInfo
(
BuildMode
.
debug
,
null
,
trackWidgetCreation:
true
,
treeShakeIcons:
false
)
;
const
BuildInfo
buildInfo
=
BuildInfo
.
debug
;
final
FlutterProject
project
=
FlutterProject
.
fromDirectoryTest
(
fs
.
directory
(
'path/to/project'
));
await
updateGeneratedXcodeProperties
(
project:
project
,
...
...
@@ -977,7 +977,7 @@ Build settings for action build and target plugin2:
});
testUsingOsxContext
(
'does not set TRACK_WIDGET_CREATION when trackWidgetCreation is false'
,
()
async
{
const
BuildInfo
buildInfo
=
BuildInfo
.
debug
;
const
BuildInfo
buildInfo
=
BuildInfo
(
BuildMode
.
debug
,
null
,
treeShakeIcons:
false
)
;
final
FlutterProject
project
=
FlutterProject
.
fromDirectoryTest
(
fs
.
directory
(
'path/to/project'
));
await
updateGeneratedXcodeProperties
(
project:
project
,
...
...
packages/flutter_tools/test/general.shard/resident_runner_test.dart
View file @
34371372
...
...
@@ -1570,7 +1570,13 @@ flutter:
flutterDevice
,
],
stayResident:
false
,
debuggingOptions:
DebuggingOptions
.
enabled
(
BuildInfo
.
debug
),
debuggingOptions:
DebuggingOptions
.
enabled
(
const
BuildInfo
(
BuildMode
.
debug
,
null
,
treeShakeIcons:
false
,
)
),
target:
'main.dart'
,
devtoolsHandler:
createNoOpHandler
,
);
...
...
@@ -1641,6 +1647,29 @@ flutter:
'build'
,
'cache.dill'
)).
readAsString
(),
'ABC'
);
}));
testUsingContext
(
'HotRunner copies compiled app.dill to cache during startup with track-widget-creation'
,
()
=>
testbed
.
run
(()
async
{
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[
listViews
,
listViews
,
],
wsAddress:
testUri
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'lib'
,
'main.dart'
)).
createSync
(
recursive:
true
);
residentRunner
=
HotRunner
(
<
FlutterDevice
>[
flutterDevice
,
],
stayResident:
false
,
debuggingOptions:
DebuggingOptions
.
enabled
(
BuildInfo
.
debug
),
target:
'main.dart'
,
devtoolsHandler:
createNoOpHandler
,
);
residentRunner
.
artifactDirectory
.
childFile
(
'app.dill'
).
writeAsStringSync
(
'ABC'
);
await
residentRunner
.
run
(
enableDevTools:
true
);
expect
(
await
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'build'
,
'cache.dill.track.dill'
)).
readAsString
(),
'ABC'
);
}));
testUsingContext
(
'HotRunner does not copy app.dill if a dillOutputPath is given'
,
()
=>
testbed
.
run
(()
async
{
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[
listViews
,
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_test.dart
View file @
34371372
...
...
@@ -256,7 +256,10 @@ void main() {
});
testUsingContext
(
'WebRunner copies compiled app.dill to cache during startup'
,
()
async
{
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
flutterDevice
);
final
DebuggingOptions
debuggingOptions
=
DebuggingOptions
.
enabled
(
const
BuildInfo
(
BuildMode
.
debug
,
null
,
treeShakeIcons:
false
),
);
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
flutterDevice
,
debuggingOptions:
debuggingOptions
);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
kAttachExpectations
.
toList
());
_setupMocks
();
...
...
@@ -273,6 +276,24 @@ void main() {
ProcessManager:
()
=>
processManager
,
});
testUsingContext
(
'WebRunner copies compiled app.dill to cache during startup with track-widget-creation'
,
()
async
{
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
flutterDevice
);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
kAttachExpectations
.
toList
());
_setupMocks
();
residentWebRunner
.
artifactDirectory
.
childFile
(
'app.dill'
).
writeAsStringSync
(
'ABC'
);
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
unawaited
(
residentWebRunner
.
run
(
connectionInfoCompleter:
connectionInfoCompleter
,
));
await
connectionInfoCompleter
.
future
;
expect
(
await
fileSystem
.
file
(
fileSystem
.
path
.
join
(
'build'
,
'cache.dill.track.dill'
)).
readAsString
(),
'ABC'
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
});
// Regression test for https://github.com/flutter/flutter/issues/60613
testUsingContext
(
'ResidentWebRunner calls appFailedToStart if initial compilation fails'
,
()
async
{
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
kAttachExpectations
.
toList
());
...
...
@@ -1048,11 +1069,12 @@ void main() {
ResidentRunner
setUpResidentRunner
(
FlutterDevice
flutterDevice
,
{
Logger
logger
,
SystemClock
systemClock
,
DebuggingOptions
debuggingOptions
,
})
{
return
ResidentWebRunner
(
flutterDevice
,
flutterProject:
FlutterProject
.
fromDirectoryTest
(
globals
.
fs
.
currentDirectory
),
debuggingOptions:
DebuggingOptions
.
enabled
(
BuildInfo
.
debug
),
debuggingOptions:
debuggingOptions
??
DebuggingOptions
.
enabled
(
BuildInfo
.
debug
),
ipv6:
true
,
urlTunneller:
null
,
usage:
globals
.
flutterUsage
,
...
...
packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart
View file @
34371372
...
...
@@ -159,6 +159,39 @@ Hello!
'''
,
));
final
LaunchResult
result
=
await
device
.
startApp
(
app
,
mainPath:
mainPath
,
debuggingOptions:
DebuggingOptions
.
enabled
(
const
BuildInfo
(
BuildMode
.
debug
,
null
,
treeShakeIcons:
false
)),
);
expect
(
result
.
started
,
isTrue
);
expect
(
result
.
observatoryUri
,
observatoryUri
);
expect
(
logLines
.
last
,
'Hello!'
);
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
},
overrides:
startOverrides
);
testUsingContext
(
'performs a build and starts in debug mode with track-widget-creation'
,
()
async
{
final
FlutterTesterApp
app
=
FlutterTesterApp
.
fromCurrentDirectory
(
fileSystem
);
final
Uri
observatoryUri
=
Uri
.
parse
(
'http://127.0.0.1:6666/'
);
final
Completer
<
void
>
completer
=
Completer
<
void
>();
fakeProcessManager
.
addCommand
(
FakeCommand
(
command:
const
<
String
>[
'Artifact.flutterTester'
,
'--run-forever'
,
'--non-interactive'
,
'--enable-dart-profiling'
,
'--packages=.dart_tool/package_config.json'
,
'--flutter-assets-dir=/.tmp_rand0/flutter_tester.rand0'
,
'/.tmp_rand0/flutter_tester.rand0/flutter-tester-app.dill.track.dill'
,
],
completer:
completer
,
stdout:
'''
The Dart VM service is listening on
$observatoryUri
Hello!
'''
,
));
final
LaunchResult
result
=
await
device
.
startApp
(
app
,
mainPath:
mainPath
,
debuggingOptions:
DebuggingOptions
.
enabled
(
BuildInfo
.
debug
),
...
...
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