@@ -3,6 +3,7 @@ const { dirname, relative, join, EOL } = require("path");
33const child_process = require ( "child_process" ) ;
44const { convertToUnixPath, warn } = require ( "../../lib/utils" ) ;
55const PropertiesReader = require ( 'properties-reader' ) ;
6+ const semver = require ( "semver" ) ;
67const shelljs = require ( "shelljs" ) ;
78
89const { createDirectory, downloadFile, getHostOS, getHostOSArch, CONSTANTS , has32BitArch, isMacOSCatalinaOrHigher, isSubPath } = require ( "./utils" ) ;
@@ -36,12 +37,16 @@ module.exports = SnapshotGenerator;
3637
3738SnapshotGenerator . SNAPSHOT_PACKAGE_NANE = "nativescript-android-snapshot" ;
3839
39- SnapshotGenerator . prototype . shouldSnapshotInDocker = function ( hostOS , targetArchs ) {
40+ SnapshotGenerator . prototype . shouldSnapshotInDocker = function ( hostOS , targetArchs , currentRuntimeVersion ) {
4041 let shouldSnapshotInDocker = false ;
42+ const minRuntimeWithoutMacOSSnapshotTools = "6.3.0" ;
4143 const generateInDockerMessage = "The snapshots will be generated in a docker container." ;
42- if ( hostOS == CONSTANTS . WIN_OS_NAME ) {
44+ if ( hostOS === CONSTANTS . WIN_OS_NAME ) {
4345 console . log ( `The V8 snapshot tools are not supported on Windows. ${ generateInDockerMessage } ` ) ;
4446 shouldSnapshotInDocker = true ;
47+ } else if ( hostOS === CONSTANTS . MAC_OS_NAME && semver . gte ( currentRuntimeVersion , minRuntimeWithoutMacOSSnapshotTools ) ) {
48+ console . log ( `Starting from Android Runtime 6.3.0, the Snapshot tools are no longer supported on macOS. ${ generateInDockerMessage } ` ) ;
49+ shouldSnapshotInDocker = true ;
4550 } else if ( isMacOSCatalinaOrHigher ( ) && has32BitArch ( targetArchs ) ) {
4651 console . log ( `Starting from macOS Catalina, the 32-bit processes are no longer supported. ${ generateInDockerMessage } ` ) ;
4752 shouldSnapshotInDocker = true ;
@@ -295,7 +300,7 @@ SnapshotGenerator.prototype.generate = function (options) {
295300
296301 this . preprocessInputFiles ( options . inputFiles , preprocessedInputFile ) ;
297302 const hostOS = getHostOS ( ) ;
298- const snapshotInDocker = options . snapshotInDocker || this . shouldSnapshotInDocker ( hostOS , options . targetArchs ) ;
303+ const snapshotInDocker = options . snapshotInDocker || this . shouldSnapshotInDocker ( hostOS , options . targetArchs , options . runtimeVersion ) ;
299304
300305 // generates the actual .blob and .c files
301306 return this . generateSnapshots (
0 commit comments