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
63e6a7ad
Unverified
Commit
63e6a7ad
authored
Feb 09, 2019
by
Stanislav Baranov
Committed by
GitHub
Feb 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for building dynamic patches in AOT mode. (#27672)
parent
7cdb30fb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
13 deletions
+32
-13
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+23
-5
build.dart
packages/flutter_tools/lib/src/base/build.dart
+9
-0
user_messages.dart
packages/flutter_tools/lib/src/base/user_messages.dart
+0
-2
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+0
-6
No files found.
packages/flutter_tools/lib/src/android/gradle.dart
View file @
63e6a7ad
...
...
@@ -503,13 +503,21 @@ Future<void> _buildGradleProjectV2(
final
Archive
update
=
Archive
();
for
(
ArchiveFile
newFile
in
newApk
)
{
if
(!
newFile
.
isFile
||
!
newFile
.
name
.
startsWith
(
'assets/flutter_assets/'
))
if
(!
newFile
.
isFile
)
continue
;
// Ignore changes to signature manifests.
if
(
newFile
.
name
.
startsWith
(
'META-INF/'
))
continue
;
final
ArchiveFile
oldFile
=
oldApk
.
findFile
(
newFile
.
name
);
if
(
oldFile
!=
null
&&
oldFile
.
crc32
==
newFile
.
crc32
)
continue
;
// Only allow changes under assets/.
if
(!
newFile
.
name
.
startsWith
(
'assets/'
))
throwToolExit
(
"Error: Dynamic patching doesn't support changes to
${newFile.name}
."
);
final
String
name
=
fs
.
path
.
relative
(
newFile
.
name
,
from:
'assets/'
);
update
.
addFile
(
ArchiveFile
(
name
,
newFile
.
content
.
length
,
newFile
.
content
));
}
...
...
@@ -527,11 +535,21 @@ Future<void> _buildGradleProjectV2(
printStatus
(
'No changes detected, creating rollback patch.'
);
}
final
ArchiveFile
oldFile
=
oldApk
.
findFile
(
'assets/flutter_assets/isolate_snapshot_data'
);
if
(
oldFile
==
null
)
throwToolExit
(
'Error: Could not find baseline assets/flutter_assets/isolate_snapshot_data.'
);
final
List
<
String
>
checksumFiles
=
<
String
>[
'assets/isolate_snapshot_data'
,
'assets/isolate_snapshot_instr'
,
'assets/flutter_assets/isolate_snapshot_data'
,
];
int
baselineChecksum
=
0
;
for
(
String
fn
in
checksumFiles
)
{
final
ArchiveFile
oldFile
=
oldApk
.
findFile
(
fn
);
if
(
oldFile
!=
null
)
baselineChecksum
=
getCrc32
(
oldFile
.
content
,
baselineChecksum
);
}
if
(
baselineChecksum
==
0
)
throwToolExit
(
'Error: Could not find baseline VM snapshot.'
);
final
int
baselineChecksum
=
getCrc32
(
oldFile
.
content
);
final
Map
<
String
,
dynamic
>
manifest
=
<
String
,
dynamic
>{
'baselineChecksum'
:
baselineChecksum
,
'buildNumber'
:
package
.
versionCode
,
...
...
packages/flutter_tools/lib/src/base/build.dart
View file @
63e6a7ad
...
...
@@ -440,6 +440,15 @@ class JITSnapshotter {
}
}
}
{
final
ArchiveFile
af
=
baselinePkg
.
findFile
(
fs
.
path
.
join
(
'assets/flutter_assets/vm_snapshot_instr'
));
if
(
af
!=
null
)
{
printError
(
'Error: Invalid baseline package
${baselineApk.path}
.'
);
return
1
;
}
}
}
final
String
depfilePath
=
fs
.
path
.
join
(
outputDir
.
path
,
'snapshot.d'
);
...
...
packages/flutter_tools/lib/src/base/user_messages.dart
View file @
63e6a7ad
...
...
@@ -229,9 +229,7 @@ class UserMessages {
'https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/pubspec.yaml
\n
'
;
String
flutterTargetFileMissing
(
String
path
)
=>
'Target file "
$path
" not found.'
;
String
get
flutterBasePatchFlagsExclusive
=>
'Error: Only one of --baseline, --patch is allowed.'
;
String
get
flutterBaselineRequiresDynamic
=>
'Error: --baseline is allowed only when --dynamic is specified.'
;
String
get
flutterBaselineRequiresTraceFile
=>
'Error: --baseline requires --compilation-trace-file to be specified.'
;
String
get
flutterPatchRequiresDynamic
=>
'Error: --patch is allowed only when --dynamic is specified.'
;
String
get
flutterPatchRequiresTraceFile
=>
'Error: --patch requires --compilation-trace-file to be specified.'
;
// Messages used in FlutterCommandRunner
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
63e6a7ad
...
...
@@ -647,8 +647,6 @@ abstract class FlutterCommand extends Command<void> {
throw
ToolExit
(
userMessages
.
flutterTargetFileMissing
(
targetPath
));
}
final
bool
dynamicFlag
=
argParser
.
options
.
containsKey
(
'dynamic'
)
?
argResults
[
'dynamic'
]
:
false
;
final
String
compilationTraceFilePath
=
argParser
.
options
.
containsKey
(
'compilation-trace-file'
)
?
argResults
[
'compilation-trace-file'
]
:
null
;
final
bool
createBaseline
=
argParser
.
options
.
containsKey
(
'baseline'
)
...
...
@@ -658,12 +656,8 @@ abstract class FlutterCommand extends Command<void> {
if
(
createBaseline
&&
createPatch
)
throw
ToolExit
(
userMessages
.
flutterBasePatchFlagsExclusive
);
if
(
createBaseline
&&
!
dynamicFlag
)
throw
ToolExit
(
userMessages
.
flutterBaselineRequiresDynamic
);
if
(
createBaseline
&&
compilationTraceFilePath
==
null
)
throw
ToolExit
(
userMessages
.
flutterBaselineRequiresTraceFile
);
if
(
createPatch
&&
!
dynamicFlag
)
throw
ToolExit
(
userMessages
.
flutterPatchRequiresDynamic
);
if
(
createPatch
&&
compilationTraceFilePath
==
null
)
throw
ToolExit
(
userMessages
.
flutterPatchRequiresTraceFile
);
}
...
...
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