@@ -26,16 +26,20 @@ var releaseDir = './release/';
2626
2727// Get platform from commandline args
2828// #
29- // # gulp <task> [<platform>]+ Run only for platform(s) (with <platform> one of --linux64, --osx64, or --win32)
29+ // # gulp <task> [<platform>]+ Run only for platform(s) (with <platform> one of --linux64, --osx64, or --win32 --chromeos )
3030// #
31- function getPlatforms ( ) {
31+ function getPlatforms ( includeChromeOs ) {
3232 var supportedPlatforms = [ 'linux64' , 'osx64' , 'win32' ] ;
3333 var platforms = [ ] ;
3434 var regEx = / - - ( \w + ) / ;
3535 for ( var i = 3 ; i < process . argv . length ; i ++ ) {
3636 var arg = process . argv [ i ] . match ( regEx ) [ 1 ] ;
3737 if ( supportedPlatforms . indexOf ( arg ) > - 1 ) {
3838 platforms . push ( arg ) ;
39+ } else if ( arg === 'chromeos' ) {
40+ if ( includeChromeOs ) {
41+ platforms . push ( arg ) ;
42+ }
3943 } else {
4044 console . log ( 'Unknown platform: ' + arg ) ;
4145 process . exit ( ) ;
@@ -83,7 +87,8 @@ function getRunDebugAppCommand() {
8387 break ;
8488
8589 default :
86- return '' ;
90+ return '' ;
91+
8792 break ;
8893 }
8994}
@@ -333,6 +338,20 @@ function release_linux64() {
333338 return archive . finalize ( ) ;
334339}
335340
341+ // Create distribution package for chromeos platform
342+ function release_chromeos ( ) {
343+ var src = distDir ;
344+ var output = fs . createWriteStream ( path . join ( releaseDir , get_release_filename ( 'chromeos' , 'zip' ) ) ) ;
345+ var archive = archiver ( 'zip' , {
346+ zlib : { level : 9 }
347+ } ) ;
348+ archive . on ( 'warning' , function ( err ) { throw err ; } ) ;
349+ archive . on ( 'error' , function ( err ) { throw err ; } ) ;
350+ archive . pipe ( output ) ;
351+ archive . directory ( src , false ) ;
352+ return archive . finalize ( ) ;
353+ }
354+
336355// Create distribution package for macOS platform
337356function release_osx64 ( ) {
338357 var appdmg = require ( 'gulp-appdmg' ) ;
@@ -370,9 +389,13 @@ gulp.task('release', ['apps', 'clean-release'], function () {
370389 }
371390 } ) ;
372391
373- var platforms = getPlatforms ( ) ;
392+ var platforms = getPlatforms ( true ) ;
374393 console . log ( 'Packing release.' ) ;
375394
395+ if ( platforms . indexOf ( 'chromeos' ) !== - 1 ) {
396+ release_chromeos ( ) ;
397+ }
398+
376399 if ( platforms . indexOf ( 'linux64' ) !== - 1 ) {
377400 release_linux64 ( ) ;
378401 }
0 commit comments