forked from openfl/lime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommandLineTools.hx
2373 lines (1999 loc) · 64.1 KB
/
CommandLineTools.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package;
// import openfl.text.Font;
// import openfl.utils.ByteArray;
// import openfl.utils.CompressionAlgorithm;
import haxe.Serializer;
import haxe.Unserializer;
import haxe.rtti.Meta;
import hxp.*;
import lime.system.CFFI;
import lime.tools.HXProject;
import lime.tools.*;
import sys.io.File;
import sys.io.Process;
import sys.FileSystem;
import utils.publish.*;
import utils.CreateTemplate;
import utils.JavaExternGenerator;
import utils.PlatformSetup;
@:access(lime.tools.HXProject)
class CommandLineTools
{
public static var commandName = "lime";
public static var defaultLibrary = "lime";
public static var defaultLibraryName = "Lime";
private var additionalArguments:Array<String>;
private var command:String;
private var debug:Bool;
private var environment:Map<String, String>;
private var includePaths:Array<String>;
private var overrides:HXProject;
private var project:HXProject;
private var projectDefines:Map<String, String>;
private var runFromHaxelib:Bool;
private var targetFlags:Map<String, String>;
private var traceEnabled:Bool;
private var userDefines:Map<String, Dynamic>;
private var version:String;
private var words:Array<String>;
public function new()
{
additionalArguments = new Array<String>();
command = "";
debug = false;
environment = Sys.environment();
includePaths = new Array<String>();
projectDefines = new Map<String, String>();
targetFlags = new Map<String, String>();
traceEnabled = true;
userDefines = new Map<String, Dynamic>();
words = new Array<String>();
overrides = new HXProject();
// Haxelib.setOverridePath (new Haxelib ("lime-tools"), Path.combine (Haxelib.getPath (new Haxelib ("lime")), "tools"));
processArguments();
version = Haxelib.getVersion();
if (targetFlags.exists("openfl"))
{
Log.accentColor = "\x1b[36;1m";
commandName = "openfl";
defaultLibrary = "openfl";
defaultLibraryName = "OpenFL";
}
if (command == "" && targetFlags.exists("help"))
{
command = "help";
}
if (Log.verbose && command != "help" && command != "")
{
displayInfo();
Sys.println("");
}
switch (command)
{
case "":
if (targetFlags.exists("version"))
{
Sys.println(getToolsVersion());
return;
}
displayInfo(true);
case "help":
displayHelp();
case "config":
displayConfig();
case "setup":
platformSetup();
case "document":
document();
case "generate":
generate();
case "compress":
compress();
case "create":
createTemplate();
case "install", "remove", "upgrade":
updateLibrary();
case "clean", "update", "display", "build", "run", "rerun", /*"install",*/ "uninstall", "trace", "test", "deploy":
if (words.length < 1 || words.length > 2)
{
Log.error("Incorrect number of arguments for command '" + command + "'");
return;
}
var project = initializeProject();
buildProject(project);
case "rebuild":
if (words.length < 1 || words.length > 2)
{
Log.error("Incorrect number of arguments for command '" + command + "'");
return;
}
if (words.length == 1)
{
var haxelibPath = Haxelib.getPath(new Haxelib(words[0]), false);
if (haxelibPath != "" && haxelibPath != null)
{
words.push("tools");
}
}
if (words.length < 2)
{
if (targetFlags.exists("openfl"))
{
words.unshift("openfl");
}
else
{
words.unshift("lime");
}
}
var targets = words[1].split(",");
var haxelib = null;
var path = null;
var hxmlPath = null;
var project = null;
if (!FileSystem.exists(words[0]))
{
var fullPath = Path.tryFullPath(words[0]);
if (FileSystem.exists(fullPath))
{
path = Path.combine(fullPath, "project");
hxmlPath = Path.combine(fullPath, "rebuild.hxml");
}
else
{
haxelib = new Haxelib(words[0]);
}
}
else
{
if (FileSystem.isDirectory(words[0]))
{
if (FileSystem.exists(Path.combine(words[0], "Build.xml")))
{
path = words[0];
}
else
{
path = Path.combine(words[0], "project/Build.xml");
}
hxmlPath = Path.combine(words[0], "rebuild.hxml");
}
else
{
path = words[0];
if (Path.extension(words[0]) == "hxml")
{
hxmlPath = words[0];
}
}
var haxelibPath = Haxelib.getPath(new Haxelib(words[0]));
if (!FileSystem.exists(path) && haxelibPath != null)
{
haxelib = new Haxelib(words[0]);
}
}
if (haxelib != null)
{
var haxelibPath = Haxelib.getPath(haxelib, true);
switch (haxelib.name)
{
case "hxcpp":
hxmlPath = Path.combine(haxelibPath, "tools/hxcpp/compile.hxml");
case "haxelib":
hxmlPath = Path.combine(haxelibPath, "../client.hxml");
default:
hxmlPath = Path.combine(haxelibPath, "rebuild.hxml");
}
}
for (targetName in targets)
{
var target:Platform = null;
switch (targetName)
{
case "cpp":
target = System.hostPlatform;
targetFlags.set("cpp", "");
case "neko":
target = System.hostPlatform;
targetFlags.set("neko", "");
case "hl", "hashlink":
target = System.hostPlatform;
targetFlags.set("hl", "");
case "cppia":
target = System.hostPlatform;
targetFlags.set("cppia", "");
case "java":
target = System.hostPlatform;
targetFlags.set("java", "");
case "nodejs":
target = System.hostPlatform;
targetFlags.set("nodejs", "");
case "cs":
target = System.hostPlatform;
targetFlags.set("cs", "");
case "iphone", "iphoneos":
target = Platform.IOS;
case "iphonesim":
target = Platform.IOS;
targetFlags.set("simulator", "");
case "electron":
target = Platform.HTML5;
targetFlags.set("electron", "");
case "firefox", "firefoxos":
target = Platform.FIREFOX;
overrides.haxedefs.set("firefoxos", "");
case "appletv", "appletvos":
target = Platform.TVOS;
case "appletvsim":
target = Platform.TVOS;
targetFlags.set("simulator", "");
case "mac", "macos":
target = Platform.MAC;
case "rpi", "raspberrypi":
target = Platform.LINUX;
targetFlags.set("rpi", "");
case "webassembly", "wasm", "emscripten":
target = Platform.WEB_ASSEMBLY;
targetFlags.set("webassembly", "");
default:
target = cast targetName.toLowerCase();
}
if (target == cast "tools")
{
if (hxmlPath != null && FileSystem.exists(hxmlPath))
{
var cacheValue = Sys.getEnv("HAXELIB_PATH");
Sys.putEnv("HAXELIB_PATH", Haxelib.getRepositoryPath());
System.runCommand(Path.directory(hxmlPath), "haxe", [Path.withoutDirectory(hxmlPath)]);
if (cacheValue != null)
{
Sys.putEnv("HAXELIB_PATH", cacheValue);
}
}
}
else
{
HXProject._command = command;
HXProject._environment = environment;
HXProject._debug = debug;
HXProject._target = target;
HXProject._targetFlags = targetFlags;
HXProject._userDefines = userDefines;
var project = null;
if (haxelib != null)
{
userDefines.set("rebuild", 1);
project = HXProject.fromHaxelib(haxelib, userDefines);
if (project == null)
{
project = new HXProject();
project.config.set("project.rebuild.path", Path.combine(Haxelib.getPath(haxelib), "project"));
}
else
{
project.config.set("project.rebuild.path", Path.combine(Haxelib.getPath(haxelib), project.config.get("project.rebuild.path")));
}
}
else
{
// project = HXProject.fromPath (path);
if (project == null)
{
project = new HXProject();
if (FileSystem.isDirectory(path))
{
project.config.set("project.rebuild.path", path);
}
else
{
project.config.set("project.rebuild.path", Path.directory(path));
project.config.set("project.rebuild.file", Path.withoutDirectory(path));
}
}
}
// this needs to be improved
var rebuildPath = project.config.get("project.rebuild.path");
var rebuildFile = project.config.get("project.rebuild.file");
project.merge(overrides);
for (haxelib in overrides.haxelibs)
{
var includeProject = HXProject.fromHaxelib(haxelib, project.defines);
if (includeProject != null)
{
for (ndll in includeProject.ndlls)
{
if (ndll.haxelib == null)
{
ndll.haxelib = haxelib;
}
}
project.merge(includeProject);
}
}
project.config.set("project.rebuild.path", rebuildPath);
project.config.set("project.rebuild.file", rebuildFile);
// TODO: Fix use of initialize without resetting reference?
project = initializeProject(project, targetName);
buildProject(project);
if (Log.verbose)
{
Log.println("");
}
}
}
case "publish":
if (words.length < 1 || words.length > 2)
{
Log.error("Incorrect number of arguments for command '" + command + "'");
return;
}
publishProject();
case "installer", "copy-if-newer":
// deprecated?
default:
Log.error("'" + command + "' is not a valid command");
}
}
#if neko
public static function __init__():Void
{
var args = Sys.args();
if (args.length > 0 && args[0].toLowerCase() == "rebuild")
{
CFFI.enabled = false;
}
for (arg in args)
{
// TODO: Allow -rebuild without locking native binary?
if (arg == "-nocffi" || arg == "-rebuild")
{
CFFI.enabled = false;
}
}
var path = "";
if (FileSystem.exists("tools.n"))
{
path = Path.combine(Sys.getCwd(), "../ndll/");
}
else if (FileSystem.exists("run.n"))
{
path = Sys.getCwd() + "/ndll/";
}
if (path == "")
{
var process = new Process("haxelib", ["path", "lime"]);
try
{
while (true)
{
var line = StringTools.trim(process.stdout.readLine());
if (StringTools.startsWith(line, "-L "))
{
path = StringTools.trim(line.substr(2));
break;
}
}
}
catch (e:Dynamic) {}
process.close();
}
switch (System.hostPlatform)
{
case WINDOWS:
// var is64 = neko.Lib.load("std", "sys_is64", 0)();
untyped $loader.path = $array(path + "Windows/", $loader.path);
if (CFFI.enabled)
{
try
{
neko.Lib.load("lime", "lime_application_create", 0);
}
catch (e:Dynamic)
{
untyped $loader.path = $array(path + "Windows64/", $loader.path);
}
}
case MAC:
if (System.hostArchitecture == X64)
{
untyped $loader.path = $array(path + "Mac64/", $loader.path);
}
else if (System.hostArchitecture == ARM64)
{
untyped $loader.path = $array(path + "MacArm64/", $loader.path);
}
case LINUX:
var arguments = Sys.args();
var raspberryPi = false;
for (argument in arguments)
{
if (argument == "-rpi") raspberryPi = true;
}
if (raspberryPi || System.hostArchitecture == ARMV6 || System.hostArchitecture == ARMV7)
{
untyped $loader.path = $array(path + "RPi/", $loader.path);
}
else if (System.hostArchitecture == X64)
{
untyped $loader.path = $array(path + "Linux64/", $loader.path);
}
else
{
untyped $loader.path = $array(path + "Linux/", $loader.path);
}
default:
}
}
#end
private function buildProject(project:HXProject, command:String = "")
{
if (command == "")
{
command = project.command.toLowerCase();
}
if (project.targetHandlers.exists(Std.string(project.target)))
{
if (command == "build" || command == "test")
{
CommandHelper.executeCommands(project.preBuildCallbacks);
}
Log.info("", Log.accentColor + "Using target platform: " + Std.string(project.target).toUpperCase() + "\x1b[0m");
var handler = project.targetHandlers.get(Std.string(project.target));
var projectData = Serializer.run(project);
var temporaryFile = System.getTemporaryFile();
File.saveContent(temporaryFile, projectData);
var targetDir = Haxelib.getPath(new Haxelib(handler));
var exePath = Path.join([targetDir, "run.exe"]);
var exeExists = FileSystem.exists(exePath);
var args = [command, temporaryFile];
if (Log.verbose) args.push("-verbose");
if (!Log.enableColor) args.push("-nocolor");
if (!traceEnabled) args.push("-notrace");
if (additionalArguments.length > 0)
{
args.push("-args");
args = args.concat(additionalArguments);
}
if (exeExists)
{
System.runCommand("", exePath, args);
}
else
{
Haxelib.runCommand("", ["run", handler].concat(args));
}
try
{
FileSystem.deleteFile(temporaryFile);
}
catch (e:Dynamic) {}
if (command == "build" || command == "test")
{
CommandHelper.executeCommands(project.postBuildCallbacks);
}
}
else
{
var platform:PlatformTarget = null;
switch (project.target)
{
case ANDROID:
platform = new AndroidPlatform(command, project, targetFlags);
case BLACKBERRY:
// platform = new BlackBerryPlatform (command, project, targetFlags);
case IOS:
platform = new IOSPlatform(command, project, targetFlags);
case TIZEN:
// platform = new TizenPlatform (command, project, targetFlags);
case WEBOS:
// platform = new WebOSPlatform (command, project, targetFlags);
case WINDOWS:
platform = new WindowsPlatform(command, project, targetFlags);
case MAC:
platform = new MacPlatform(command, project, targetFlags);
case LINUX:
platform = new LinuxPlatform(command, project, targetFlags);
case FLASH:
platform = new FlashPlatform(command, project, targetFlags);
case HTML5:
platform = new HTML5Platform(command, project, targetFlags);
// case FIREFOX:
// platform = new FirefoxPlatform (command, project, targetFlags);
case WEB_ASSEMBLY:
platform = new WebAssemblyPlatform(command, project, targetFlags);
case TVOS:
platform = new TVOSPlatform(command, project, targetFlags);
case AIR:
platform = new AIRPlatform(command, project, targetFlags);
default:
}
if (platform != null)
{
platform.traceEnabled = traceEnabled;
platform.execute(additionalArguments);
}
else
{
Log.error("\"" + Std.string(project.target) + "\" is an unknown target");
}
}
}
private function compress()
{
if (words.length > 0)
{
// var bytes = new ByteArray ();
// bytes.writeUTFBytes (words[0]);
// bytes.compress (CompressionAlgorithm.LZMA);
// Sys.print (bytes.toString ());
// File.saveBytes (words[0] + ".compress", bytes);
}
}
private function createTemplate()
{
Log.info("", Log.accentColor + "Running command: CREATE\x1b[0m");
if (words.length > 0)
{
var colonIndex = words[0].indexOf(":");
var projectName = null;
var sampleName = null;
if (colonIndex == -1)
{
projectName = words[0];
if (words.length > 1)
{
sampleName = words[1];
}
}
else
{
projectName = words[0].substring(0, colonIndex);
sampleName = words[0].substr(colonIndex + 1);
}
if (projectName == "project" || sampleName == "project")
{
CreateTemplate.createProject(words, userDefines, overrides);
}
else if (projectName == "extension" || sampleName == "extension")
{
CreateTemplate.createExtension(words, userDefines);
}
else
{
if (sampleName == null)
{
var sampleExists = false;
var defines = new Map<String, Dynamic>();
defines.set("create", 1);
var project = HXProject.fromHaxelib(new Haxelib(defaultLibrary), defines);
for (samplePath in project.samplePaths)
{
if (FileSystem.exists(Path.combine(samplePath, projectName)))
{
sampleExists = true;
}
}
if (sampleExists)
{
CreateTemplate.createSample(words, userDefines);
}
else if (Haxelib.getPath(new Haxelib(projectName)) != "")
{
CreateTemplate.listSamples(projectName, userDefines);
}
else if (projectName == "" || projectName == null)
{
CreateTemplate.listSamples(defaultLibrary, userDefines);
}
else
{
CreateTemplate.listSamples(null, userDefines);
}
}
else
{
CreateTemplate.createSample(words, userDefines);
}
}
}
else
{
CreateTemplate.listSamples(defaultLibrary, userDefines);
}
}
private function displayConfig():Void
{
if (words.length == 0)
{
Log.println(File.getContent(ConfigHelper.getConfigPath()));
}
else if (words.length == 1)
{
var value = ConfigHelper.getConfigValue(words[0]);
if (value != null)
{
Log.println(value);
}
else
{
Log.error("\"" + words[0] + "\" is undefined");
}
}
else
{
var name = words.shift();
var value = words.join(" ");
if (name == "remove")
{
ConfigHelper.removeConfigValue(value);
}
else
{
ConfigHelper.writeConfigValue(name, value);
}
}
}
private function displayHelp():Void
{
var commands = [
"config" => "Display or set command-line configuration values", "create" => "Create a new project or extension using templates",
"clean" => "Clean the specified project and target", "update" => "Copy assets for the specified project and target",
"build" => "Compile and package for the specified project and target", "run" => "Install and run for the specified project and target",
"test" => "Update, build and run in one command", "help" => "Show this information",
"trace" => "Trace output for the specifed project and target", "deploy" => "Archive and upload builds",
"display" => "Display information for the specified project and target", "rebuild" => "Recompile native binaries for libraries",
"install" => "Install a library from haxelib, plus dependencies", "remove" => "Remove a library from haxelib",
"upgrade" => "Upgrade a library from haxelib", "setup" => "Setup " + defaultLibraryName + " or a specific platform"
];
var basicCommands = ["config", "create", "clean", "update", "build", "run", "test", "help"];
var additionalCommands = ["trace", "deploy", "display", "rebuild", "install", "remove", "upgrade", "setup"];
if (targetFlags.exists("openfl"))
{
commands.set("process", "Process a SWF asset for use with " + defaultLibraryName);
additionalCommands.push("process");
}
var command = (words.length > 0 ? words[0] : "");
var isProjectCommand = false, isBuildCommand = false;
if (commands.exists(command))
{
Log.println("\x1b[1m" + commands.get(command) + "\x1b[0m");
Log.println("");
}
switch (command)
{
case "setup":
Log.println(" "
+ Log.accentColor
+ "Usage:\x1b[0m \x1b[1m"
+ commandName
+ " setup\x1b[0m \x1b[3;37m(target)\x1b[0m \x1b[3;37m[options]\x1b[0m");
case "clean", "update", "build", "run", "test", "display", "deploy", "trace":
Log.println(" "
+ Log.accentColor
+ "Usage:\x1b[0m \x1b[1m"
+ commandName
+ " "
+ command
+ "\x1b[0m \x1b[3;37m(project)\x1b[0m \x1b[1m<target>\x1b[0m \x1b[3;37m[options]\x1b[0m");
isProjectCommand = true;
isBuildCommand = true;
case "create":
Log.println(" "
+ Log.accentColor
+ "Usage:\x1b[0m \x1b[1m"
+ commandName
+ " create\x1b[0m \x1b[3;37m(library)\x1b[0m \x1b[1mproject\x1b[0m \x1b[3;37m(directory)\x1b[0m \x1b[3;37m[options]\x1b[0m");
Log.println(" "
+ Log.accentColor
+ "Usage:\x1b[0m \x1b[1m"
+ commandName
+ " create\x1b[0m \x1b[3;37m(library)\x1b[0m \x1b[1mextension\x1b[0m \x1b[3;37m(directory)\x1b[0m \x1b[3;37m[options]\x1b[0m");
Log.println(" "
+ Log.accentColor
+ "Usage:\x1b[0m \x1b[1m"
+ commandName
+ " create\x1b[0m \x1b[3;37m(library)\x1b[0m \x1b[1m<sample>\x1b[0m \x1b[3;37m(directory)\x1b[0m \x1b[3;37m[options]\x1b[0m");
case "rebuild":
Log.println(" "
+ Log.accentColor
+ "Usage:\x1b[0m \x1b[1m"
+ commandName
+ " rebuild\x1b[0m \x1b[3;37m(library)\x1b[0m \x1b[3;37m(target)\x1b[0m \x1b[3;37m[options]\x1b[0m");
isBuildCommand = true;
case "config":
Log.println(" "
+ Log.accentColor
+ "Usage:\x1b[0m \x1b[1m"
+ commandName
+ " config\x1b[0m \x1b[3;37m(name)\x1b[0m \x1b[3;37m(value)\x1b[0m \x1b[3;37m[options]\x1b[0m");
Log.println(" "
+ Log.accentColor
+ "Usage:\x1b[0m \x1b[1m"
+ commandName
+ " config remove <name>\x1b[0m \x1b[3;37m[options]\x1b[0m");
case "install", "remove", "upgrade":
Log.println(" "
+ Log.accentColor
+ "Usage:\x1b[0m \x1b[1m"
+ commandName
+ " "
+ command
+ "\x1b[0m \x1b[3;37m(library)\x1b[0m \x1b[3;37m[options]\x1b[0m");
case "process":
Log.println(" "
+ Log.accentColor
+ "Usage:\x1b[0m \x1b[1m"
+ commandName
+ " process <file>\x1b[0m \x1b[3;37m(directory)\x1b[0m \x1b[3;37m[options]\x1b[0m");
default:
displayInfo();
Log.println("");
Log.println(" " + Log.accentColor + "Usage:\x1b[0m \x1b[1m" + commandName + " <command>\x1b[0m \x1b[3;37m[arguments]\x1b[0m");
Log.println("");
Log.println(" " + Log.accentColor + "Basic Commands:" + Log.resetColor);
Log.println("");
for (command in basicCommands)
{
Log.println(" \x1b[1m" + command + "\x1b[0m -- " + commands.get(command));
}
Log.println("");
Log.println(" " + Log.accentColor + "Additional Commands:" + Log.resetColor);
Log.println("");
for (command in additionalCommands)
{
Log.println(" \x1b[1m" + command + "\x1b[0m -- " + commands.get(command));
}
Log.println("");
Log.println("For additional help, run \x1b[1m" + commandName + " help <command>\x1b[0m");
return;
}
if (isBuildCommand || command == "setup")
{
Log.println("");
Log.println(" " + Log.accentColor + "Targets:" + Log.resetColor);
Log.println("");
Log.println(" \x1b[1mair\x1b[0m -- Create an AIR application");
Log.println(" \x1b[1mandroid\x1b[0m -- Create an Android application");
// Log.println (" \x1b[1mblackberry\x1b[0m -- Create a BlackBerry application");
Log.println(" \x1b[1mflash\x1b[0m -- Create a Flash SWF application");
Log.println(" \x1b[1mhtml5\x1b[0m -- Create an HTML5 application");
Log.println(" \x1b[1mios\x1b[0m -- Create an iOS application");
Log.println(" \x1b[1mlinux\x1b[0m -- Create a Linux application");
Log.println(" \x1b[1mmac\x1b[0m -- Create a macOS application");
// Log.println (" \x1b[1mtizen\x1b[0m -- Create a Tizen application");
Log.println(" \x1b[1mtvos\x1b[0m -- Create a tvOS application");
// Log.println (" \x1b[1mwebos\x1b[0m -- Create a webOS application");
Log.println(" \x1b[1mwebassembly\x1b[0m -- Create a WebAssembly application");
Log.println(" \x1b[1mwindows\x1b[0m -- Create a Windows application");
Log.println("");
Log.println(" " + Log.accentColor + "Target Aliases:" + Log.resetColor);
Log.println("");
Log.println(" \x1b[1mcpp\x1b[0m -- Alias for host platform (using \x1b[1m-cpp\x1b[0m)");
Log.println(" \x1b[1mneko\x1b[0m -- Alias for host platform (using \x1b[1m-neko\x1b[0m)");
Log.println(" \x1b[1mmacos\x1b[0m -- Alias for \x1b[1mmac\x1b[0m");
Log.println(" \x1b[1mnodejs\x1b[0m -- Alias for host platform (using \x1b[1m-nodejs\x1b[0m)");
Log.println(" \x1b[1mjava\x1b[0m -- Alias for host platform (using \x1b[1m-java\x1b[0m)");
Log.println(" \x1b[1mcs\x1b[0m -- Alias for host platform (using \x1b[1m-cs\x1b[0m)");
Log.println(" \x1b[1mhl/hashlink\x1b[0m -- Alias for host platform (using \x1b[1m-hl\x1b[0m)");
Log.println(" \x1b[1mhlc\x1b[0m -- Alias for host platform (using \x1b[1m-hlc\x1b[0m)");
#if (lime >= "7.6.0")
// Log.println(" \x1b[1mcppia\x1b[0m -- Alias for host platform (using \x1b[1m-cppia\x1b[0m)");
#end
Log.println(" \x1b[1muwp\x1b[0;3m/\x1b[0m\x1b[1mwinjs\x1b[0m -- Alias for \x1b[1mwindows -uwp\x1b[0m");
// Log.println (" \x1b[1miphone\x1b[0;3m/\x1b[0m\x1b[1miphoneos\x1b[0m -- \x1b[1mios\x1b[0m");
// Log.println (" \x1b[1miphonesim\x1b[0m -- Alias for \x1b[1mios -simulator\x1b[0m");
// Log.println (" \x1b[1mappletv\x1b[0;3m/\x1b[0m\x1b[1mappletvos\x1b[0m -- Alias for \x1b[1mtvos\x1b[0m");
// Log.println (" \x1b[1mappletvsim\x1b[0m -- Alias for \x1b[1mtvos -simulator\x1b[0m");
Log.println(" \x1b[1mrpi\x1b[0;3m/\x1b[0m\x1b[1mraspberrypi\x1b[0m -- Alias for \x1b[1mlinux -rpi\x1b[0m");
Log.println(" \x1b[1melectron\x1b[0m -- Alias for \x1b[1mhtml5 -electron\x1b[0m");
Log.println(" \x1b[1mwasm/emscripten\x1b[0m -- Alias for \x1b[1mwebassembly\x1b[0m");
}
Log.println("");
Log.println(" " + Log.accentColor + "Options:" + Log.resetColor);
Log.println("");
if (isBuildCommand)
{
Log.println(" \x1b[1m-D\x1b[0;3mvalue\x1b[0m -- Specify a define to use when processing other commands");
Log.println(" \x1b[1m-debug\x1b[0m -- Use debug configuration instead of release");
Log.println(" \x1b[1m-final\x1b[0m -- Use final configuration instead of release");
}
Log.println(" \x1b[1m-v\x1b[0;3m/\x1b[0m\x1b[1m-verbose\x1b[0m -- Print additional information (when available)");
if (isBuildCommand && command != "run" && command != "trace")
{
Log.println(" \x1b[1m-clean\x1b[0m -- Add a \"clean\" action before running the current command");
}
Log.println(" \x1b[1m-nocolor\x1b[0m -- Disable ANSI format codes in output");
if (command == "run" || command == "test")
{
Log.println(" \x1b[1m-notrace\x1b[0m -- Disable trace output during run or test command");
}
Log.println(" \x1b[1m-dryrun\x1b[0m -- Execute the requested command without making changes");
if (isProjectCommand && command != "run" && command != "trace")
{
Log.println(" \x1b[1m-xml\x1b[0m -- Generate XML type information, useful for documentation");
}
if (command == "run" || command == "test")
{
Log.println(" \x1b[1m--\x1b[0;3m/\x1b[0m\x1b[1m-args\x1b[0m ... -- Pass additional arguments at launch");
}
if (isProjectCommand)
{
Log.println(" \x1b[3m(windows|mac|linux)\x1b[0m \x1b[1m-cpp\x1b[0m -- Build with C++ (default behavior)");
Log.println(" \x1b[3m(windows|mac|linux)\x1b[0m \x1b[1m-neko\x1b[0m -- Build with Neko instead of C++");
Log.println(" \x1b[3m(windows|mac|ios|android)\x1b[0m \x1b[1m-air\x1b[0m -- Build with AIR instead of C++");
}
if (isBuildCommand)
{
Log.println(" \x1b[3m(windows|mac|linux|android)\x1b[0m \x1b[1m-static\x1b[0m -- Compile as a static C++ executable");
Log.println(" \x1b[3m(windows|mac|linux)\x1b[0m \x1b[1m-x86_32\x1b[0m -- Compile for x86_32 instead of the OS default");