@@ -4,6 +4,7 @@ const child_process = require("child_process");
44const { convertToUnixPath, warn } = require ( "../../lib/utils" ) ;
55const { isWindows } = require ( "./utils" ) ;
66const PropertiesReader = require ( 'properties-reader' ) ;
7+ const semver = require ( "semver" ) ;
78const shelljs = require ( "shelljs" ) ;
89
910const { createDirectory, downloadFile, getHostOS, getHostOSArch, CONSTANTS , has32BitArch, isMacOSCatalinaOrHigher, isSubPath } = require ( "./utils" ) ;
@@ -37,12 +38,16 @@ module.exports = SnapshotGenerator;
3738
3839SnapshotGenerator . SNAPSHOT_PACKAGE_NANE = "nativescript-android-snapshot" ;
3940
40- SnapshotGenerator . prototype . shouldSnapshotInDocker = function ( hostOS , targetArchs ) {
41+ SnapshotGenerator . prototype . shouldSnapshotInDocker = function ( hostOS , targetArchs , currentRuntimeVersion ) {
4142 let shouldSnapshotInDocker = false ;
43+ const minRuntimeWithoutMacOSSnapshotTools = "6.3.0" ;
4244 const generateInDockerMessage = "The snapshots will be generated in a docker container." ;
43- if ( hostOS == CONSTANTS . WIN_OS_NAME ) {
45+ if ( hostOS === CONSTANTS . WIN_OS_NAME ) {
4446 console . log ( `The V8 snapshot tools are not supported on Windows. ${ generateInDockerMessage } ` ) ;
4547 shouldSnapshotInDocker = true ;
48+ } else if ( hostOS === CONSTANTS . MAC_OS_NAME && semver . gte ( currentRuntimeVersion , minRuntimeWithoutMacOSSnapshotTools ) ) {
49+ console . log ( `Starting from Android Runtime 6.3.0, the Snapshot tools are no longer supported on macOS. ${ generateInDockerMessage } ` ) ;
50+ shouldSnapshotInDocker = true ;
4651 } else if ( isMacOSCatalinaOrHigher ( ) && has32BitArch ( targetArchs ) ) {
4752 console . log ( `Starting from macOS Catalina, the 32-bit processes are no longer supported. ${ generateInDockerMessage } ` ) ;
4853 shouldSnapshotInDocker = true ;
@@ -296,7 +301,7 @@ SnapshotGenerator.prototype.generate = function (options) {
296301
297302 this . preprocessInputFiles ( options . inputFiles , preprocessedInputFile ) ;
298303 const hostOS = getHostOS ( ) ;
299- const snapshotInDocker = options . snapshotInDocker || this . shouldSnapshotInDocker ( hostOS , options . targetArchs ) ;
304+ const snapshotInDocker = options . snapshotInDocker || this . shouldSnapshotInDocker ( hostOS , options . targetArchs , options . runtimeVersion ) ;
300305
301306 // generates the actual .blob and .c files
302307 return this . generateSnapshots (
0 commit comments