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
14016523
Commit
14016523
authored
Sep 07, 2017
by
Mikkel Nygaard Ravn
Committed by
GitHub
Sep 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure snapshot rebuild logic takes main path into account (#11924)
parent
39680ebf
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
244 additions
and
212 deletions
+244
-212
build.dart
packages/flutter_tools/lib/src/base/build.dart
+65
-69
build_aot.dart
packages/flutter_tools/lib/src/commands/build_aot.dart
+13
-13
build_test.dart
packages/flutter_tools/test/base/build_test.dart
+166
-130
No files found.
packages/flutter_tools/lib/src/base/build.dart
View file @
14016523
This diff is collapsed.
Click to expand it.
packages/flutter_tools/lib/src/commands/build_aot.dart
View file @
14016523
...
...
@@ -286,25 +286,25 @@ Future<String> _buildAotSnapshot(
genSnapshotCmd
.
add
(
mainPath
);
final
SnapshotType
snapshotType
=
new
SnapshotType
(
platform
,
buildMode
);
final
File
checksumFile
=
fs
.
file
(
'
$dependencies
.checksum
'
);
final
List
<
File
>
checksumFiles
=
<
File
>[
checksum
File
,
fs
.
file
(
dependencies
)]
final
File
fingerprintFile
=
fs
.
file
(
'
$dependencies
.fingerprint
'
);
final
List
<
File
>
fingerprintFiles
=
<
File
>[
fingerprint
File
,
fs
.
file
(
dependencies
)]
..
addAll
(
inputPaths
.
map
(
fs
.
file
))
..
addAll
(
outputPaths
.
map
(
fs
.
file
));
if
(
checksum
Files
.
every
((
File
file
)
=>
file
.
existsSync
()))
{
if
(
fingerprint
Files
.
every
((
File
file
)
=>
file
.
existsSync
()))
{
try
{
final
String
json
=
await
checksum
File
.
readAsString
();
final
Checksum
oldChecksum
=
new
Checksum
.
fromJson
(
json
);
final
String
json
=
await
fingerprint
File
.
readAsString
();
final
Fingerprint
oldFingerprint
=
new
Fingerprint
.
fromJson
(
json
);
final
Set
<
String
>
snapshotInputPaths
=
await
readDepfile
(
dependencies
)
..
add
(
mainPath
)
..
addAll
(
outputPaths
);
final
Checksum
newChecksum
=
new
Checksum
.
fromFiles
(
snapshotType
,
mainPath
,
snapshotInputPaths
);
if
(
old
Checksum
==
newChecksum
)
{
print
Trace
(
'Skipping AOT snapshot build. Checksums
match.'
);
final
Fingerprint
newFingerprint
=
Snapshotter
.
createFingerprint
(
snapshotType
,
mainPath
,
snapshotInputPaths
);
if
(
old
Fingerprint
==
newFingerprint
)
{
print
Status
(
'Skipping AOT snapshot build. Fingerprint
match.'
);
return
outputPath
;
}
}
catch
(
e
)
{
// Log exception and continue, this step is a performance improvement only.
printTrace
(
'Rebuilding snapshot due to
checksum validation
error:
$e
'
);
printTrace
(
'Rebuilding snapshot due to
fingerprint check
error:
$e
'
);
}
}
...
...
@@ -370,16 +370,16 @@ Future<String> _buildAotSnapshot(
await
runCheckedAsync
(
linkCommand
);
}
// Compute and record
checksums
.
// Compute and record
build fingerprint
.
try
{
final
Set
<
String
>
snapshotInputPaths
=
await
readDepfile
(
dependencies
)
..
add
(
mainPath
)
..
addAll
(
outputPaths
);
final
Checksum
checksum
=
new
Checksum
.
fromFiles
(
snapshotType
,
mainPath
,
snapshotInputPaths
);
await
checksumFile
.
writeAsString
(
checksum
.
toJson
());
final
Fingerprint
fingerprint
=
Snapshotter
.
createFingerprint
(
snapshotType
,
mainPath
,
snapshotInputPaths
);
await
fingerprintFile
.
writeAsString
(
fingerprint
.
toJson
());
}
catch
(
e
,
s
)
{
// Log exception and continue, this step is a performance improvement only.
print
Trace
(
'Error during AOT snapshot checksum output
:
$e
\n
$s
'
);
print
Status
(
'Error during AOT snapshot fingerprinting
:
$e
\n
$s
'
);
}
return
outputPath
;
...
...
packages/flutter_tools/test/base/build_test.dart
View file @
14016523
This diff is collapsed.
Click to expand it.
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