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
d04a057e
Unverified
Commit
d04a057e
authored
Sep 04, 2018
by
Chris Bracken
Committed by
GitHub
Sep 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate BuildInfo.previewDart2 (now always true) (#21392)
Dart 1 is no longer supported in Flutter.
parent
5b5a5b82
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
13 additions
and
82 deletions
+13
-82
build_info.dart
packages/flutter_tools/lib/src/build_info.dart
+0
-5
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+1
-1
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+1
-1
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+0
-1
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+1
-4
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+1
-40
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+0
-1
flutter_tester.dart
packages/flutter_tools/lib/src/tester/flutter_tester.dart
+2
-6
xcodeproj_test.dart
packages/flutter_tools/test/ios/xcodeproj_test.dart
+4
-17
flutter_tester_test.dart
packages/flutter_tools/test/tester/flutter_tester_test.dart
+3
-6
No files found.
packages/flutter_tools/lib/src/build_info.dart
View file @
d04a057e
...
...
@@ -11,7 +11,6 @@ import 'globals.dart';
/// Information about a build to be performed or used.
class
BuildInfo
{
const
BuildInfo
(
this
.
mode
,
this
.
flavor
,
{
this
.
previewDart2
=
true
,
this
.
trackWidgetCreation
=
false
,
this
.
compilationTraceFilePath
,
this
.
extraFrontEndOptions
,
...
...
@@ -34,9 +33,6 @@ class BuildInfo {
/// Mode-Flavor (e.g. Release-Paid).
final
String
flavor
;
/// Whether build should be done using Dart2 Frontend parser.
final
bool
previewDart2
;
final
List
<
String
>
fileSystemRoots
;
final
String
fileSystemScheme
;
...
...
@@ -99,7 +95,6 @@ class BuildInfo {
BuildInfo
withTargetPlatform
(
TargetPlatform
targetPlatform
)
=>
new
BuildInfo
(
mode
,
flavor
,
previewDart2:
previewDart2
,
trackWidgetCreation:
trackWidgetCreation
,
compilationTraceFilePath:
compilationTraceFilePath
,
extraFrontEndOptions:
extraFrontEndOptions
,
...
...
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
d04a057e
...
...
@@ -344,7 +344,7 @@ class AppDomain extends Domain {
final
FlutterDevice
flutterDevice
=
new
FlutterDevice
(
device
,
previewDart2:
options
.
buildInfo
.
previewDart2
,
previewDart2:
true
,
trackWidgetCreation:
trackWidgetCreation
,
dillOutputPath:
dillOutputPath
,
);
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
d04a057e
...
...
@@ -236,7 +236,7 @@ Future<XcodeBuildResult> buildXcodeProject({
await
updateGeneratedXcodeProperties
(
project:
project
,
targetOverride:
targetOverride
,
previewDart2:
buildInfo
.
previewDart2
,
previewDart2:
true
,
buildInfo:
buildInfo
,
);
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
d04a057e
...
...
@@ -358,7 +358,6 @@ class IOSSimulator extends Device {
// The build mode for the simulator is always debug.
final
BuildInfo
debugBuildInfo
=
new
BuildInfo
(
BuildMode
.
debug
,
buildInfo
.
flavor
,
previewDart2:
buildInfo
.
previewDart2
,
trackWidgetCreation:
buildInfo
.
trackWidgetCreation
,
extraFrontEndOptions:
buildInfo
.
extraFrontEndOptions
,
extraGenSnapshotOptions:
buildInfo
.
extraGenSnapshotOptions
,
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
d04a057e
...
...
@@ -453,10 +453,7 @@ abstract class ResidentRunner {
String
get
projectRootPath
=>
_projectRootPath
;
String
_mainPath
;
String
get
mainPath
=>
_mainPath
;
String
getReloadPath
({
bool
fullRestart
})
=>
debuggingOptions
.
buildInfo
.
previewDart2
?
mainPath
+
(
fullRestart
?
''
:
'.incremental'
)
+
'.dill'
:
mainPath
;
String
getReloadPath
({
bool
fullRestart
})
=>
mainPath
+
(
fullRestart
?
''
:
'.incremental'
)
+
'.dill'
;
AssetBundle
_assetBundle
;
AssetBundle
get
assetBundle
=>
_assetBundle
;
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
d04a057e
...
...
@@ -436,10 +436,7 @@ class HotRunner extends ResidentRunner {
}
// We are now running from source.
_runningFromSnapshot
=
false
;
final
String
launchPath
=
debuggingOptions
.
buildInfo
.
previewDart2
?
mainPath
+
'.dill'
:
mainPath
;
await
_launchFromDevFS
(
launchPath
);
await
_launchFromDevFS
(
mainPath
+
'.dill'
);
restartTimer
.
stop
();
printTrace
(
'Hot restart performed in
${getElapsedAsMilliseconds(restartTimer.elapsed)}
.'
);
// We are now running from sources.
...
...
@@ -529,14 +526,6 @@ class HotRunner extends ResidentRunner {
}
}
String
_uriToRelativePath
(
Uri
uri
)
{
final
String
path
=
uri
.
toString
();
final
String
base
=
new
Uri
.
file
(
projectRootPath
).
toString
();
if
(
path
.
startsWith
(
base
))
return
path
.
substring
(
base
.
length
+
1
);
return
path
;
}
Future
<
OperationResult
>
_reloadSources
({
bool
pause
=
false
})
async
{
for
(
FlutterDevice
device
in
flutterDevices
)
{
for
(
FlutterView
view
in
device
.
views
)
{
...
...
@@ -556,7 +545,6 @@ class HotRunner extends ResidentRunner {
// change from host path to a device path). Subsequent reloads will
// not be affected, so we resume reporting reload times on the second
// reload.
final
bool
reportUnused
=
!
debuggingOptions
.
buildInfo
.
previewDart2
;
final
bool
shouldReportReloadTime
=
!
_runningFromSnapshot
;
final
Stopwatch
reloadTimer
=
new
Stopwatch
()..
start
();
...
...
@@ -726,36 +714,9 @@ class HotRunner extends ResidentRunner {
shouldReportReloadTime
)
flutterUsage
.
sendTiming
(
'hot'
,
'reload'
,
reloadTimer
.
elapsed
);
String
unusedElementMessage
;
if
(
reportUnused
&&
!
reassembleAndScheduleErrors
&&
!
reassembleTimedOut
)
{
final
List
<
Future
<
List
<
ProgramElement
>>>
unusedReports
=
<
Future
<
List
<
ProgramElement
>>>[];
for
(
FlutterDevice
device
in
flutterDevices
)
unusedReports
.
add
(
device
.
unusedChangesInLastReload
());
final
List
<
ProgramElement
>
unusedElements
=
<
ProgramElement
>[];
for
(
Future
<
List
<
ProgramElement
>>
unusedReport
in
unusedReports
)
unusedElements
.
addAll
(
await
unusedReport
);
if
(
unusedElements
.
isNotEmpty
)
{
final
String
restartCommand
=
hostIsIde
?
''
:
' (by pressing "R")'
;
unusedElementMessage
=
'Some program elements were changed during reload but did not run when the view was reassembled;
\n
'
'you may need to restart the app
$restartCommand
for the changes to have an effect.'
;
for
(
ProgramElement
unusedElement
in
unusedElements
)
{
final
String
name
=
unusedElement
.
qualifiedName
;
final
String
path
=
_uriToRelativePath
(
unusedElement
.
uri
);
final
int
line
=
unusedElement
.
line
;
final
String
description
=
line
==
null
?
'
$name
(
$path
)'
:
'
$name
(
$path
:
$line
)'
;
unusedElementMessage
+=
'
\n
•
$description
'
;
}
}
}
return
new
OperationResult
(
reassembleAndScheduleErrors
?
1
:
OperationResult
.
ok
.
code
,
reloadMessage
,
hintMessage:
unusedElementMessage
,
hintId:
unusedElementMessage
!=
null
?
'restartRecommended'
:
null
,
);
}
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
d04a057e
...
...
@@ -239,7 +239,6 @@ abstract class FlutterCommand extends Command<Null> {
argParser
.
options
.
containsKey
(
'flavor'
)
?
argResults
[
'flavor'
]
:
null
,
previewDart2:
true
,
trackWidgetCreation:
trackWidgetCreation
,
compilationTraceFilePath:
argParser
.
options
.
containsKey
(
'precompile'
)
?
argResults
[
'precompile'
]
...
...
packages/flutter_tools/lib/src/tester/flutter_tester.dart
View file @
d04a057e
...
...
@@ -136,15 +136,11 @@ class FlutterTesterDevice extends Device {
precompiledSnapshot:
false
,
trackWidgetCreation:
buildInfo
.
trackWidgetCreation
,
);
if
(
buildInfo
.
previewDart2
)
{
mainPath
=
applicationKernelFilePath
;
}
command
.
add
(
'--flutter-assets-dir=
$assetDirPath
'
);
// TODO(scheglov): Either remove the check, or make it fail earlier.
if
(
main
Path
!=
null
)
{
command
.
add
(
main
Path
);
if
(
applicationKernelFile
Path
!=
null
)
{
command
.
add
(
applicationKernelFile
Path
);
}
try
{
...
...
packages/flutter_tools/test/ios/xcodeproj_test.dart
View file @
d04a057e
...
...
@@ -285,10 +285,7 @@ Information about project "Runner":
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
any
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile_arm'
));
const
BuildInfo
buildInfo
=
BuildInfo
(
BuildMode
.
debug
,
null
,
previewDart2:
true
,
targetPlatform:
TargetPlatform
.
ios
,
);
const
BuildInfo
buildInfo
=
BuildInfo
(
BuildMode
.
debug
,
null
,
targetPlatform:
TargetPlatform
.
ios
);
final
FlutterProject
project
=
await
FlutterProject
.
fromPath
(
'path/to/project'
);
await
updateGeneratedXcodeProperties
(
project:
project
,
...
...
@@ -306,11 +303,7 @@ Information about project "Runner":
testUsingOsxContext
(
'sets TRACK_WIDGET_CREATION=true when trackWidgetCreation is true'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
any
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile_arm'
));
const
BuildInfo
buildInfo
=
BuildInfo
(
BuildMode
.
debug
,
null
,
previewDart2:
true
,
trackWidgetCreation:
true
,
targetPlatform:
TargetPlatform
.
ios
,
);
const
BuildInfo
buildInfo
=
BuildInfo
(
BuildMode
.
debug
,
null
,
trackWidgetCreation:
true
,
targetPlatform:
TargetPlatform
.
ios
);
final
FlutterProject
project
=
await
FlutterProject
.
fromPath
(
'path/to/project'
);
await
updateGeneratedXcodeProperties
(
project:
project
,
...
...
@@ -328,10 +321,7 @@ Information about project "Runner":
testUsingOsxContext
(
'does not set TRACK_WIDGET_CREATION when trackWidgetCreation is false'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
any
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile_arm'
));
const
BuildInfo
buildInfo
=
BuildInfo
(
BuildMode
.
debug
,
null
,
previewDart2:
true
,
targetPlatform:
TargetPlatform
.
ios
,
);
const
BuildInfo
buildInfo
=
BuildInfo
(
BuildMode
.
debug
,
null
,
targetPlatform:
TargetPlatform
.
ios
);
final
FlutterProject
project
=
await
FlutterProject
.
fromPath
(
'path/to/project'
);
await
updateGeneratedXcodeProperties
(
project:
project
,
...
...
@@ -349,10 +339,7 @@ Information about project "Runner":
testUsingOsxContext
(
'sets ARCHS=armv7 when armv7 local engine is set'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
any
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile'
));
const
BuildInfo
buildInfo
=
BuildInfo
(
BuildMode
.
debug
,
null
,
previewDart2:
true
,
targetPlatform:
TargetPlatform
.
ios
,
);
const
BuildInfo
buildInfo
=
BuildInfo
(
BuildMode
.
debug
,
null
,
targetPlatform:
TargetPlatform
.
ios
);
final
FlutterProject
project
=
await
FlutterProject
.
fromPath
(
'path/to/project'
);
await
updateGeneratedXcodeProperties
(
...
...
packages/flutter_tools/test/tester/flutter_tester_test.dart
View file @
d04a057e
...
...
@@ -140,8 +140,7 @@ void main() {
testUsingContext
(
'not debug'
,
()
async
{
final
LaunchResult
result
=
await
device
.
startApp
(
null
,
mainPath:
mainPath
,
debuggingOptions:
new
DebuggingOptions
.
disabled
(
const
BuildInfo
(
BuildMode
.
release
,
null
,
previewDart2:
true
)));
debuggingOptions:
new
DebuggingOptions
.
disabled
(
const
BuildInfo
(
BuildMode
.
release
,
null
)));
expect
(
result
.
started
,
isFalse
);
},
overrides:
startOverrides
);
...
...
@@ -150,8 +149,7 @@ void main() {
expect
(()
async
{
await
device
.
startApp
(
null
,
mainPath:
mainPath
,
debuggingOptions:
new
DebuggingOptions
.
disabled
(
const
BuildInfo
(
BuildMode
.
debug
,
null
,
previewDart2:
true
)));
debuggingOptions:
new
DebuggingOptions
.
disabled
(
const
BuildInfo
(
BuildMode
.
debug
,
null
)));
},
throwsToolExit
());
},
overrides:
startOverrides
);
...
...
@@ -184,8 +182,7 @@ Hello!
final
LaunchResult
result
=
await
device
.
startApp
(
null
,
mainPath:
mainPath
,
debuggingOptions:
new
DebuggingOptions
.
enabled
(
const
BuildInfo
(
BuildMode
.
debug
,
null
,
previewDart2:
true
)));
debuggingOptions:
new
DebuggingOptions
.
enabled
(
const
BuildInfo
(
BuildMode
.
debug
,
null
)));
expect
(
result
.
started
,
isTrue
);
expect
(
result
.
observatoryUri
,
observatoryUri
);
...
...
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