@@ -365,7 +365,7 @@ module.exports = function(grunt) {
365
365
} ,
366
366
shell : {
367
367
generate_dataJSON : {
368
- command : ' npm ci && npm run grunt yui' ,
368
+ command : `git checkout ${ grunt . option ( 'target' ) } && npm ci && npm run grunt yui build` ,
369
369
options : {
370
370
execOptions : {
371
371
cwd : 'tmp/p5.js'
@@ -378,7 +378,7 @@ module.exports = function(grunt) {
378
378
grunt . registerTask ( 'update-version' , function ( ) {
379
379
const done = this . async ( ) ;
380
380
381
- const version = require ( './src/templates/pages/reference/data.json ') . project . version ;
381
+ const version = grunt . option ( 'target ') . substring ( 1 ) ;
382
382
383
383
fs . readFile ( './src/data/data.yml' )
384
384
. then ( str => {
@@ -436,6 +436,14 @@ module.exports = function(grunt) {
436
436
// move the data.json files from the cloned p5.js repository to the p5.js-website repository
437
437
fse . moveSync ( dataJSON_p5js , dataJSON_p5jswebsite , { overwrite : true } ) ;
438
438
fse . moveSync ( dataJSONmin_p5js , dataJSONmin_p5jswebsite , { overwrite : true } ) ;
439
+
440
+ const p5min_src = 'tmp/p5.js/lib/p5.min.js' ;
441
+ const p5min_dest = 'src/assets/js/p5.min.js' ;
442
+ const p5Soundmin_src = 'tmp/p5.js/lib/addons/p5.sound.min.js' ;
443
+ const p5Soundmin_dest = 'src/assets/js/p5.sound.min.js' ;
444
+ fse . moveSync ( p5min_src , p5min_dest , { overwrite : true } ) ;
445
+ fse . moveSync ( p5Soundmin_src , p5Soundmin_dest , { overwrite : true } ) ;
446
+
439
447
// delete the tmp folder that contained the p5.js repository
440
448
fse . removeSync ( 'tmp/' ) ;
441
449
} ) ;
@@ -451,8 +459,8 @@ module.exports = function(grunt) {
451
459
'clone_p5js_repo' ,
452
460
'generate_dataJSON' ,
453
461
'move_dataJSON' ,
454
- 'generate_enJSON ' ,
455
- // 'json-to-fluent '
462
+ 'update-version ' ,
463
+ 'generate_enJSON '
456
464
] ) ;
457
465
458
466
// multi-tasks: collections of other tasks
@@ -476,12 +484,11 @@ module.exports = function(grunt) {
476
484
477
485
// runs tasks in order
478
486
grunt . registerTask ( 'build' , [
479
- 'update-version' ,
487
+ // 'update-version',
480
488
'exec' ,
481
489
'clean' ,
482
490
'requirejs:yuidoc_theme' ,
483
491
'requirejs' ,
484
- // 'fluent-to-json',
485
492
'copy' ,
486
493
'optimize' ,
487
494
'assemble' ,
0 commit comments