@@ -4,6 +4,7 @@ const child_process = require("child_process");
4
4
const { convertToUnixPath, warn } = require ( "../../lib/utils" ) ;
5
5
const { isWindows } = require ( "./utils" ) ;
6
6
const PropertiesReader = require ( 'properties-reader' ) ;
7
+ const semver = require ( "semver" ) ;
7
8
const shelljs = require ( "shelljs" ) ;
8
9
9
10
const { createDirectory, downloadFile, getHostOS, getHostOSArch, CONSTANTS , has32BitArch, isMacOSCatalinaOrHigher, isSubPath } = require ( "./utils" ) ;
@@ -37,12 +38,16 @@ module.exports = SnapshotGenerator;
37
38
38
39
SnapshotGenerator . SNAPSHOT_PACKAGE_NANE = "nativescript-android-snapshot" ;
39
40
40
- SnapshotGenerator . prototype . shouldSnapshotInDocker = function ( hostOS , targetArchs ) {
41
+ SnapshotGenerator . prototype . shouldSnapshotInDocker = function ( hostOS , targetArchs , currentRuntimeVersion ) {
41
42
let shouldSnapshotInDocker = false ;
43
+ const minRuntimeWithoutMacOSSnapshotTools = "6.3.0" ;
42
44
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 ) {
44
46
console . log ( `The V8 snapshot tools are not supported on Windows. ${ generateInDockerMessage } ` ) ;
45
47
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 ;
46
51
} else if ( isMacOSCatalinaOrHigher ( ) && has32BitArch ( targetArchs ) ) {
47
52
console . log ( `Starting from macOS Catalina, the 32-bit processes are no longer supported. ${ generateInDockerMessage } ` ) ;
48
53
shouldSnapshotInDocker = true ;
@@ -296,7 +301,7 @@ SnapshotGenerator.prototype.generate = function (options) {
296
301
297
302
this . preprocessInputFiles ( options . inputFiles , preprocessedInputFile ) ;
298
303
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 ) ;
300
305
301
306
// generates the actual .blob and .c files
302
307
return this . generateSnapshots (
0 commit comments