@@ -28,6 +28,7 @@ const PLATFORM_ANDROID = "android";
28
28
const PLATFORM_AIR = "air" ;
29
29
const PLATFORM_WINDOWS = "windows" ;
30
30
const PLATFORM_MAC = "mac" ;
31
+ const PLATFORM_LINUX = "linux" ;
31
32
const PLATFORM_BUNDLE = "bundle" ;
32
33
const TARGET_AIR = "air" ;
33
34
const TARGET_BUNDLE = "bundle" ;
@@ -60,12 +61,20 @@ const TASK_NAME_PACKAGE_MAC_SHARED_DEBUG =
60
61
"package macOS debug (shared runtime)" ;
61
62
const TASK_NAME_PACKAGE_MAC_SHARED_RELEASE =
62
63
"package macOS release (shared runtime)" ;
64
+ const TASK_NAME_PACKAGE_LINUX_SHARED_DEBUG =
65
+ "package Linux debug (shared runtime)" ;
66
+ const TASK_NAME_PACKAGE_LINUX_SHARED_RELEASE =
67
+ "package Linux release (shared runtime)" ;
63
68
const TASK_NAME_PACKAGE_WINDOWS_CAPTIVE =
64
69
"package Windows release (captive runtime)" ;
65
70
const TASK_NAME_PACKAGE_MAC_CAPTIVE = "package macOS release (captive runtime)" ;
71
+ const TASK_NAME_PACKAGE_LINUX_CAPTIVE =
72
+ "package Linux release (captive runtime)" ;
66
73
const TASK_NAME_PACKAGE_WINDOWS_NATIVE =
67
74
"package Windows release (native installer)" ;
68
75
const TASK_NAME_PACKAGE_MAC_NATIVE = "package macOS release (native installer)" ;
76
+ const TASK_NAME_PACKAGE_LINUX_NATIVE =
77
+ "package Linux release (native installer)" ;
69
78
70
79
interface ActionScriptTaskDefinition extends vscode . TaskDefinition {
71
80
type : typeof TASK_TYPE_ACTIONSCRIPT ;
@@ -233,10 +242,13 @@ export default class ActionScriptTaskProvider
233
242
let isRootTargetNativeInstaller = false ;
234
243
let isWindowsOverrideBundle = false ;
235
244
let isMacOverrideBundle = false ;
245
+ let isLinuxOverrideBundle = false ;
236
246
let isWindowsOverrideNativeInstaller = false ;
237
247
let isMacOverrideNativeInstaller = false ;
248
+ let isLinuxOverrideNativeInstaller = false ;
238
249
let isWindowsOverrideShared = false ;
239
250
let isMacOverrideShared = false ;
251
+ let isLinuxOverrideShared = false ;
240
252
const asconfigJson = this . readASConfigJSON ( jsonURI ) ;
241
253
if ( asconfigJson !== null ) {
242
254
isLibrary = this . isLibrary ( asconfigJson ) ;
@@ -254,12 +266,16 @@ export default class ActionScriptTaskProvider
254
266
this . isRootTargetNativeInstaller ( asconfigJson ) ;
255
267
isWindowsOverrideShared = this . isWindowsOverrideShared ( asconfigJson ) ;
256
268
isMacOverrideShared = this . isMacOverrideShared ( asconfigJson ) ;
269
+ isLinuxOverrideShared = this . isLinuxOverrideShared ( asconfigJson ) ;
257
270
isWindowsOverrideBundle = this . isWindowsOverrideBundle ( asconfigJson ) ;
258
271
isMacOverrideBundle = this . isMacOverrideBundle ( asconfigJson ) ;
272
+ isLinuxOverrideBundle = this . isLinuxOverrideBundle ( asconfigJson ) ;
259
273
isWindowsOverrideNativeInstaller =
260
274
this . isWindowsOverrideNativeInstaller ( asconfigJson ) ;
261
275
isMacOverrideNativeInstaller =
262
276
this . isMacOverrideNativeInstaller ( asconfigJson ) ;
277
+ isLinuxOverrideNativeInstaller =
278
+ this . isLinuxOverrideNativeInstaller ( asconfigJson ) ;
263
279
}
264
280
}
265
281
@@ -398,7 +414,11 @@ export default class ActionScriptTaskProvider
398
414
//to determine what to display in the list of tasks.
399
415
400
416
//captive runtime
401
- if ( isWindowsOverrideBundle || isMacOverrideBundle ) {
417
+ if (
418
+ isWindowsOverrideBundle ||
419
+ isMacOverrideBundle ||
420
+ isLinuxOverrideBundle
421
+ ) {
402
422
result . push (
403
423
this . getTask (
404
424
`${ TASK_NAME_PACKAGE_DESKTOP_CAPTIVE } - ${ taskNameSuffix } ` ,
@@ -435,6 +455,18 @@ export default class ActionScriptTaskProvider
435
455
isAIRDesktop || isAIRMobile
436
456
)
437
457
) ;
458
+ } else if ( isLinuxOverrideBundle ) {
459
+ result . push (
460
+ this . getTask (
461
+ `${ TASK_NAME_PACKAGE_LINUX_CAPTIVE } - ${ taskNameSuffix } ` ,
462
+ jsonURI ,
463
+ workspaceFolder ,
464
+ frameworkSDK ,
465
+ false ,
466
+ PLATFORM_LINUX ,
467
+ isAIRDesktop || isAIRMobile
468
+ )
469
+ ) ;
438
470
}
439
471
//shared runtime with platform overrides
440
472
else if ( isWindowsOverrideShared ) {
@@ -483,6 +515,29 @@ export default class ActionScriptTaskProvider
483
515
isAIRDesktop || isAIRMobile
484
516
)
485
517
) ;
518
+ } else if ( isLinuxOverrideShared ) {
519
+ result . push (
520
+ this . getTask (
521
+ `${ TASK_NAME_PACKAGE_LINUX_SHARED_DEBUG } - ${ taskNameSuffix } ` ,
522
+ jsonURI ,
523
+ workspaceFolder ,
524
+ frameworkSDK ,
525
+ true ,
526
+ PLATFORM_LINUX ,
527
+ isAIRDesktop || isAIRMobile
528
+ )
529
+ ) ;
530
+ result . push (
531
+ this . getTask (
532
+ `${ TASK_NAME_PACKAGE_LINUX_SHARED_RELEASE } - ${ taskNameSuffix } ` ,
533
+ jsonURI ,
534
+ workspaceFolder ,
535
+ frameworkSDK ,
536
+ false ,
537
+ PLATFORM_LINUX ,
538
+ isAIRDesktop || isAIRMobile
539
+ )
540
+ ) ;
486
541
}
487
542
//native installers
488
543
else if ( isWindowsOverrideNativeInstaller ) {
@@ -509,6 +564,18 @@ export default class ActionScriptTaskProvider
509
564
isAIRDesktop || isAIRMobile
510
565
)
511
566
) ;
567
+ } else if ( isLinuxOverrideNativeInstaller ) {
568
+ result . push (
569
+ this . getTask (
570
+ `${ TASK_NAME_PACKAGE_LINUX_NATIVE } - ${ taskNameSuffix } ` ,
571
+ jsonURI ,
572
+ workspaceFolder ,
573
+ frameworkSDK ,
574
+ false ,
575
+ PLATFORM_LINUX ,
576
+ isAIRDesktop || isAIRMobile
577
+ )
578
+ ) ;
512
579
}
513
580
514
581
//--- root target in airOptions
@@ -517,11 +584,14 @@ export default class ActionScriptTaskProvider
517
584
//desktop platform. if it is overridden, it should be skipped to avoid
518
585
//duplicate items in the list.
519
586
const isWindows = process . platform === "win32" ;
587
+ const isMac = process . platform === "darwin" ;
588
+ const isLinux = process . platform === "linux" ;
520
589
521
590
if (
522
591
isRootTargetNativeInstaller &&
523
592
( ( isWindows && ! isWindowsOverrideNativeInstaller ) ||
524
- ( ! isWindows && ! isMacOverrideNativeInstaller ) )
593
+ ( isMac && ! isMacOverrideNativeInstaller ) ||
594
+ ( isLinux && ! isLinuxOverrideNativeInstaller ) )
525
595
) {
526
596
let taskName = isWindows
527
597
? TASK_NAME_PACKAGE_WINDOWS_NATIVE
@@ -541,7 +611,8 @@ export default class ActionScriptTaskProvider
541
611
if (
542
612
( isRootTargetBundle || isRootTargetEmpty ) &&
543
613
( ( isWindows && ! isWindowsOverrideBundle ) ||
544
- ( ! isWindows && ! isMacOverrideBundle ) )
614
+ ( isMac && ! isMacOverrideBundle ) ||
615
+ ( isLinux && ! isLinuxOverrideBundle ) )
545
616
) {
546
617
result . push (
547
618
this . getTask (
@@ -574,7 +645,8 @@ export default class ActionScriptTaskProvider
574
645
if (
575
646
( isRootTargetShared || isRootTargetEmpty ) &&
576
647
( ( isWindows && ! isWindowsOverrideShared ) ||
577
- ( ! isWindows && ! isMacOverrideShared ) )
648
+ ( isMac && ! isMacOverrideShared ) ||
649
+ ( isLinux && ! isLinuxOverrideShared ) )
578
650
) {
579
651
result . push (
580
652
this . getTask (
@@ -834,6 +906,26 @@ export default class ActionScriptTaskProvider
834
906
return target === TARGET_AIR ;
835
907
}
836
908
909
+ private isLinuxOverrideShared ( asconfigJson : any ) : boolean {
910
+ if ( process . platform !== "linux" ) {
911
+ return false ;
912
+ }
913
+ if ( ! ( FIELD_AIR_OPTIONS in asconfigJson ) ) {
914
+ return false ;
915
+ }
916
+ let airOptions = asconfigJson [ FIELD_AIR_OPTIONS ] ;
917
+ if ( ! ( PLATFORM_LINUX in airOptions ) ) {
918
+ return false ;
919
+ }
920
+ let linux = airOptions [ PLATFORM_LINUX ] ;
921
+ if ( ! ( FIELD_TARGET in linux ) ) {
922
+ //if target is omitted, defaults to bundle
923
+ return false ;
924
+ }
925
+ let target = linux [ FIELD_TARGET ] ;
926
+ return target === TARGET_AIR ;
927
+ }
928
+
837
929
private isWindowsOverrideNativeInstaller ( asconfigJson : any ) : boolean {
838
930
if ( process . platform !== "win32" ) {
839
931
return false ;
@@ -874,6 +966,26 @@ export default class ActionScriptTaskProvider
874
966
return target === TARGET_NATIVE ;
875
967
}
876
968
969
+ private isLinuxOverrideNativeInstaller ( asconfigJson : any ) : boolean {
970
+ if ( process . platform !== "linux" ) {
971
+ return false ;
972
+ }
973
+ if ( ! ( FIELD_AIR_OPTIONS in asconfigJson ) ) {
974
+ return false ;
975
+ }
976
+ let airOptions = asconfigJson [ FIELD_AIR_OPTIONS ] ;
977
+ if ( ! ( PLATFORM_LINUX in airOptions ) ) {
978
+ return false ;
979
+ }
980
+ let linux = airOptions [ PLATFORM_LINUX ] ;
981
+ if ( ! ( FIELD_TARGET in linux ) ) {
982
+ //if target is omitted, defaults to bundle
983
+ return false ;
984
+ }
985
+ let target = linux [ FIELD_TARGET ] ;
986
+ return target === TARGET_NATIVE ;
987
+ }
988
+
877
989
private isSharedOverride ( asconfigJson : any ) : boolean {
878
990
if ( ! ( FIELD_AIR_OPTIONS in asconfigJson ) ) {
879
991
return false ;
@@ -922,6 +1034,26 @@ export default class ActionScriptTaskProvider
922
1034
return target === TARGET_BUNDLE ;
923
1035
}
924
1036
1037
+ private isLinuxOverrideBundle ( asconfigJson : any ) : boolean {
1038
+ if ( process . platform !== "linux" ) {
1039
+ return false ;
1040
+ }
1041
+ if ( ! ( FIELD_AIR_OPTIONS in asconfigJson ) ) {
1042
+ return false ;
1043
+ }
1044
+ let airOptions = asconfigJson [ FIELD_AIR_OPTIONS ] ;
1045
+ if ( ! ( PLATFORM_LINUX in airOptions ) ) {
1046
+ return false ;
1047
+ }
1048
+ let linux = airOptions [ PLATFORM_LINUX ] ;
1049
+ if ( ! ( FIELD_TARGET in linux ) ) {
1050
+ //if target is omitted, default to bundle
1051
+ return true ;
1052
+ }
1053
+ let target = linux [ FIELD_TARGET ] ;
1054
+ return target === TARGET_BUNDLE ;
1055
+ }
1056
+
925
1057
private isRootTargetShared ( asconfigJson : any ) : boolean {
926
1058
if ( ! ( FIELD_AIR_OPTIONS in asconfigJson ) ) {
927
1059
//if no airOptions are specified at all, consider it shared runtime
0 commit comments