-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile-swc
More file actions
executable file
·57 lines (47 loc) · 1.38 KB
/
compile-swc
File metadata and controls
executable file
·57 lines (47 loc) · 1.38 KB
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
#! /usr/bin/perl
# This script creates bin-debug/Multigraph.swc, by looking for all .as and .mxml files in the "src"
# directory, except src/Multigraph.mxml, and compiling them using "compc".
@asfiles = src_files("as");
@mxmlfiles = src_files("mxml");
@classes = ();
foreach $file (@mxmlfiles, @asfiles) {
if ($file eq "MultigraphApp.mxml") { next; }
$file =~ s|.mxml$||;
$file =~ s|.as$||;
$file =~ s|/|\.|g;
push(@classes, $file);
}
$classes = join(" ", @classes);
$cmd = "compc"
. " -use-network=false"
. " -compiler.show-actionscript-warnings=false"
. " -managers flash.fonts.AFEFontManager"
. " -define=CONFIG::player10,true"
. " -source-path src"
. " -output='bin-debug/Multigraph.swc'"
. " -include-classes $classes"
;
sys($cmd);
########################################################################
sub src_files {
my $suffix = shift;
@files = ();
open(FIND, "find src -name '*.$suffix' -print |");
while (my $file = <FIND>) {
chomp($file);
if ($file =~ m|/generated/|) { next; }
if ($file =~ m|/edu/|) { next; }
if ($file =~ m|WeatherForecasts|) { next; }
if ($file =~ /\.$suffix$/) {
$file =~ s|^src/||;
push(@files, $file);
}
}
close(FIND);
return @files;
}
sub sys {
my $cmd = shift;
print("$cmd\n");
return system($cmd);
}