@@ -80,7 +80,7 @@ SnapshotGenerator.prototype.convertToAndroidArchName = function(archName) {
80
80
}
81
81
}
82
82
83
- SnapshotGenerator . prototype . runMksnapshotTool = function ( snapshotToolsPath , inputFile , v8Version , targetArchs , buildCSource ) {
83
+ SnapshotGenerator . prototype . runMksnapshotTool = function ( snapshotToolsPath , inputFile , v8Version , targetArchs , buildCSource , mksnapshotParams ) {
84
84
// Cleans the snapshot build folder
85
85
shelljs . rm ( "-rf" , join ( this . buildPath , "snapshots" ) ) ;
86
86
@@ -98,7 +98,12 @@ SnapshotGenerator.prototype.runMksnapshotTool = function(snapshotToolsPath, inpu
98
98
// Generate .blob file
99
99
const currentArchBlobOutputPath = join ( this . buildPath , "snapshots/blobs" , androidArch ) ;
100
100
shelljs . mkdir ( "-p" , currentArchBlobOutputPath ) ;
101
- const command = `${ currentArchMksnapshotToolPath } ${ inputFile } --startup_blob ${ join ( currentArchBlobOutputPath , `${ SNAPSHOT_BLOB_NAME } .blob` ) } --profile_deserialization` ;
101
+ var params = "--profile_deserialization" ;
102
+ if ( mksnapshotParams ) {
103
+ // Starting from android runtime 5.3.0, the parameters passed to mksnapshot are read from the settings.json file
104
+ params = mksnapshotParams ;
105
+ }
106
+ const command = `${ currentArchMksnapshotToolPath } ${ inputFile } --startup_blob ${ join ( currentArchBlobOutputPath , `${ SNAPSHOT_BLOB_NAME } .blob` ) } ${ params } ` ;
102
107
103
108
return new Promise ( ( resolve , reject ) => {
104
109
const child = child_process . exec ( command , { encoding : "utf8" } , ( error , stdout , stderr ) => {
@@ -167,7 +172,8 @@ SnapshotGenerator.prototype.generate = function(options) {
167
172
preprocessedInputFile ,
168
173
options . v8Version ,
169
174
options . targetArchs ,
170
- options . useLibs
175
+ options . useLibs ,
176
+ options . mksnapshotParams
171
177
) . then ( ( ) => {
172
178
this . buildIncludeGradle ( ) ;
173
179
if ( options . useLibs ) {
0 commit comments