@@ -272,13 +272,11 @@ gulp.task("clean", function (done) {
272
272
273
273
function cloc ( ) {
274
274
var cmdLine ;
275
- var clocPath = path . join ( "node_modules" , "cloc" , "lib" , "cloc" ) ;
276
275
277
276
//Run cloc on primary Source files only
278
277
var source = new Promise ( function ( resolve , reject ) {
279
278
cmdLine =
280
- "perl " +
281
- clocPath +
279
+ "npx cloc" +
282
280
" --quiet --progress-rate=0" +
283
281
" Source/ --exclude-dir=Assets,ThirdParty,Workers --not-match-f=copyrightHeader.js" ;
284
282
@@ -297,8 +295,7 @@ function cloc() {
297
295
return source . then ( function ( ) {
298
296
return new Promise ( function ( resolve , reject ) {
299
297
cmdLine =
300
- "perl " +
301
- clocPath +
298
+ "npx cloc" +
302
299
" --quiet --progress-rate=0" +
303
300
" Specs/ --exclude-dir=Data" ;
304
301
child_process . exec ( cmdLine , function ( error , stdout , stderr ) {
@@ -341,30 +338,16 @@ gulp.task("combineRelease", gulp.series("build", combineRelease));
341
338
342
339
//Builds the documentation
343
340
function generateDocumentation ( ) {
344
- var envPathSeperator = os . platform ( ) === "win32" ? ";" : ":" ;
345
-
346
- return new Promise ( function ( resolve , reject ) {
347
- child_process . exec (
348
- "jsdoc --configure Tools/jsdoc/conf.json" ,
349
- {
350
- env : {
351
- PATH : process . env . PATH + envPathSeperator + "node_modules/.bin" ,
352
- CESIUM_VERSION : version ,
353
- } ,
354
- } ,
355
- function ( error , stdout , stderr ) {
356
- if ( error ) {
357
- console . log ( stderr ) ;
358
- return reject ( error ) ;
359
- }
360
- console . log ( stdout ) ;
361
- var stream = gulp
362
- . src ( "Documentation/Images/**" )
363
- . pipe ( gulp . dest ( "Build/Documentation/Images" ) ) ;
364
- return streamToPromise ( stream ) . then ( resolve ) ;
365
- }
366
- ) ;
341
+ child_process . execSync ( "npx jsdoc --configure Tools/jsdoc/conf.json" , {
342
+ stdio : "inherit" ,
343
+ env : Object . assign ( { } , process . env , { CESIUM_VERSION : version } ) ,
367
344
} ) ;
345
+
346
+ var stream = gulp
347
+ . src ( "Documentation/Images/**" )
348
+ . pipe ( gulp . dest ( "Build/Documentation/Images" ) ) ;
349
+
350
+ return streamToPromise ( stream ) ;
368
351
}
369
352
gulp . task ( "generateDocumentation" , generateDocumentation ) ;
370
353
@@ -1481,10 +1464,9 @@ function createCesiumJs() {
1481
1464
1482
1465
function createTypeScriptDefinitions ( ) {
1483
1466
// Run jsdoc with tsd-jsdoc to generate an initial Cesium.d.ts file.
1484
- child_process . execSync (
1485
- "node_modules/.bin/jsdoc --configure Tools/jsdoc/ts-conf.json" ,
1486
- { stdio : "inherit" }
1487
- ) ;
1467
+ child_process . execSync ( "npx jsdoc --configure Tools/jsdoc/ts-conf.json" , {
1468
+ stdio : "inherit" ,
1469
+ } ) ;
1488
1470
1489
1471
var source = fs . readFileSync ( "Source/Cesium.d.ts" ) . toString ( ) ;
1490
1472
@@ -1608,7 +1590,7 @@ ${source}
1608
1590
fs . writeFileSync ( "Source/Cesium.d.ts" , source ) ;
1609
1591
1610
1592
// Use tsc to compile it and make sure it is valid
1611
- child_process . execSync ( "node_modules/.bin/ tsc -p Tools/jsdoc/tsconfig.json" , {
1593
+ child_process . execSync ( "npx tsc -p Tools/jsdoc/tsconfig.json" , {
1612
1594
stdio : "inherit" ,
1613
1595
} ) ;
1614
1596
0 commit comments