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