@@ -80,7 +80,7 @@ SnapshotGenerator.prototype.convertToAndroidArchName = function(archName) {
8080 }
8181}
8282
83- SnapshotGenerator . prototype . runMksnapshotTool = function ( snapshotToolsPath , inputFile , v8Version , targetArchs , buildCSource ) {
83+ SnapshotGenerator . prototype . runMksnapshotTool = function ( snapshotToolsPath , inputFile , v8Version , targetArchs , buildCSource , mksnapshotParams ) {
8484 // Cleans the snapshot build folder
8585 shelljs . rm ( "-rf" , join ( this . buildPath , "snapshots" ) ) ;
8686
@@ -98,7 +98,12 @@ SnapshotGenerator.prototype.runMksnapshotTool = function(snapshotToolsPath, inpu
9898 // Generate .blob file
9999 const currentArchBlobOutputPath = join ( this . buildPath , "snapshots/blobs" , androidArch ) ;
100100 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 } ` ;
102107
103108 return new Promise ( ( resolve , reject ) => {
104109 const child = child_process . exec ( command , { encoding : "utf8" } , ( error , stdout , stderr ) => {
@@ -167,7 +172,8 @@ SnapshotGenerator.prototype.generate = function(options) {
167172 preprocessedInputFile ,
168173 options . v8Version ,
169174 options . targetArchs ,
170- options . useLibs
175+ options . useLibs ,
176+ options . mksnapshotParams
171177 ) . then ( ( ) => {
172178 this . buildIncludeGradle ( ) ;
173179 if ( options . useLibs ) {
0 commit comments