This repository was archived by the owner on Aug 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +36
-9
lines changed
plugins/NativeScriptSnapshotPlugin Expand file tree Collapse file tree 8 files changed +36
-9
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,11 @@ exports.NativeScriptSnapshotPlugin = (function () {
9797
9898 NativeScriptSnapshotPlugin . prototype . generate = function ( webpackChunks ) {
9999 const options = this . options ;
100+ if ( options . skipSnapshotTools ) {
101+ console . log ( `Skipping snapshot tools.` ) ;
102+ return Promise . resolve ( ) ;
103+ }
104+
100105 const inputFiles = webpackChunks . map ( chunk => join ( options . webpackConfig . output . path , chunk . files [ 0 ] ) ) ;
101106 const preprocessedInputFile = join (
102107 this . options . projectRoot ,
@@ -113,7 +118,8 @@ exports.NativeScriptSnapshotPlugin = (function () {
113118 useLibs : options . useLibs ,
114119 androidNdkPath : options . androidNdkPath ,
115120 v8Version : options . v8Version ,
116- snapshotInDocker : options . snapshotInDocker
121+ snapshotInDocker : options . snapshotInDocker ,
122+ skipSnapshotTools : options . skipSnapshotTools
117123 } ) . then ( ( ) => {
118124 // Make the original files empty
119125 inputFiles . forEach ( inputFile =>
Original file line number Diff line number Diff line change 4242 "snapshotInDocker" : {
4343 "type" : " boolean"
4444 },
45+ "skipSnapshotTools" : {
46+ "type" : " boolean" ,
47+ "default" : false
48+ },
4549 "v8Version" : {
4650 "type" : " string"
4751 },
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ module.exports = function parseProjectSnapshotGeneratorArgs() {
1313 result . snapshotInDocker = parseBool ( result . snapshotInDocker ) ;
1414 }
1515
16+ if ( result . skipSnapshotTools !== undefined ) {
17+ result . skipSnapshotTools = parseBool ( result . skipSnapshotTools ) ;
18+ }
19+
1620 if ( result . install !== undefined ) {
1721 result . install = parseBool ( result . install ) ;
1822 }
Original file line number Diff line number Diff line change @@ -210,6 +210,11 @@ ProjectSnapshotGenerator.prototype.validateAndroidRuntimeVersion = function () {
210210}
211211
212212ProjectSnapshotGenerator . prototype . generate = function ( generationOptions ) {
213+ if ( generationOptions . skipSnapshotTools ) {
214+ console . log ( "Running snapshot generation with the following arguments: " ) ;
215+ return Promise . resolve ( ) ;
216+ }
217+
213218 generationOptions = generationOptions || { } ;
214219
215220 console . log ( "Running snapshot generation with the following arguments: " ) ;
Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ module.exports = env => {
5050 hmr, // --env.hmr,
5151 unitTesting, // --env.unitTesting
5252 verbose, // --env.verbose
53- snapshotInDocker // --env.snapshotInDocker
53+ snapshotInDocker, // --env.snapshotInDocker
54+ skipSnapshotTools // --env.skipSnapshotTools
5455 } = env ;
5556
5657 const isAnySourceMapEnabled = ! ! sourceMap || ! ! hiddenSourceMap ;
@@ -309,7 +310,8 @@ module.exports = env => {
309310 ] ,
310311 projectRoot,
311312 webpackConfig : config ,
312- snapshotInDocker
313+ snapshotInDocker,
314+ skipSnapshotTools
313315 } ) ) ;
314316 }
315317
Original file line number Diff line number Diff line change @@ -44,7 +44,8 @@ module.exports = env => {
4444 hmr, // --env.hmr,
4545 unitTesting, // --env.unitTesting,
4646 verbose, // --env.verbose
47- snapshotInDocker // --env.snapshotInDocker
47+ snapshotInDocker, // --env.snapshotInDocker
48+ skipSnapshotTools // --env.skipSnapshotTools
4849 } = env ;
4950
5051 const isAnySourceMapEnabled = ! ! sourceMap || ! ! hiddenSourceMap ;
@@ -250,7 +251,8 @@ module.exports = env => {
250251 ] ,
251252 projectRoot,
252253 webpackConfig : config ,
253- snapshotInDocker
254+ snapshotInDocker,
255+ skipSnapshotTools
254256 } ) ) ;
255257 }
256258
Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ module.exports = env => {
4545 hmr, // --env.hmr,
4646 unitTesting, // --env.unitTesting,
4747 verbose, // --env.verbose
48- snapshotInDocker // --env.snapshotInDocker
48+ snapshotInDocker, // --env.snapshotInDocker
49+ skipSnapshotTools // --env.skipSnapshotTools
4950 } = env ;
5051 const isAnySourceMapEnabled = ! ! sourceMap || ! ! hiddenSourceMap ;
5152 const externals = nsWebpack . getConvertedExternals ( env . externals ) ;
@@ -278,7 +279,8 @@ module.exports = env => {
278279 ] ,
279280 projectRoot,
280281 webpackConfig : config ,
281- snapshotInDocker
282+ snapshotInDocker,
283+ skipSnapshotTools
282284 } ) ) ;
283285 }
284286
Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ module.exports = env => {
4747 hiddenSourceMap, // --env.hiddenSourceMap
4848 unitTesting, // --env.unitTesting
4949 verbose, // --env.verbose
50- snapshotInDocker // --env.snapshotInDocker
50+ snapshotInDocker, // --env.snapshotInDocker
51+ skipSnapshotTools // --env.skipSnapshotTools
5152 } = env ;
5253
5354 const isAnySourceMapEnabled = ! ! sourceMap || ! ! hiddenSourceMap ;
@@ -297,7 +298,8 @@ module.exports = env => {
297298 ] ,
298299 projectRoot,
299300 webpackConfig : config ,
300- snapshotInDocker
301+ snapshotInDocker,
302+ skipSnapshotTools
301303 } ) ) ;
302304 }
303305
You can’t perform that action at this time.
0 commit comments