This repository has been archived by the owner on Jul 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Howlfile.lua
173 lines (139 loc) · 3.56 KB
/
Howlfile.lua
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
do -- Setup options
-- By default we want to include the minify and depends library
-- and print a trace on errors
Options:Default "trace"
Options:Option "with-minify"
:Description "Include the minify library"
:Alias "wm"
:Default()
Options:Option "with-depends"
:Description "Include the dependencies library"
:Alias "wd"
:Default()
Options:Option "with-dump"
:Description "Include the dumper"
Options:Option "with-files"
:Description "Include the files library"
:Alias "wf"
Options:Option "with-interop"
:Description "Include the interop library"
:Alias "wi"
end
Sources:Main "Howl.lua"
:Depends "Runner"
:Depends "ArgParse"
:Depends "HowlFile"
-- Not needed but we include
:Depends "Task.Extensions"
:Depends "Combiner"
:Depends "Bootstrap"
do -- Core files
Sources:File "core/ArgParse.lua"
:Name "ArgParse"
:Depends "Utils"
Sources:File "core/Utils.lua" :Name "Utils"
Sources:File "core/HowlFileLoader.lua" :Name "HowlFile"
Sources:File "core/Dump.lua" :Name "Dump"
end
do -- Task files
Sources:File "tasks/Context.lua"
:Name "Context"
:Depends "Utils"
Sources:File "tasks/Task.lua"
:Name "Task"
:Depends "Utils"
Sources:File "tasks/Runner.lua"
:Name "Runner"
:Depends "Context"
:Depends "Task"
:Depends "Utils"
Sources:File "tasks/Extensions.lua"
:Alias "Task.Extensions"
:Depends "HowlFile"
:Depends "Runner"
:Depends "Utils"
end
do
Sources:File "depends/Depends.lua"
:Name "Depends"
Sources:File "depends/Combiner.lua"
:Alias "Combiner"
:Depends "Depends"
:Depends "HowlFile"
:Depends "Runner"
Sources:File "depends/Bootstrap.lua"
:Alias "Bootstrap"
:Depends "Depends"
:Depends "HowlFile"
:Depends "Runner"
end
do -- Minification
Sources:File "lexer/Parse.lua"
:Name "Parse"
:Depends "Constants"
:Depends "Scope"
:Depends "TokenList"
Sources:File "lexer/Rebuild.lua"
:Name "Rebuild"
:Depends "Constants"
Sources:File "lexer/Scope.lua"
:Name "Scope"
:Depends "Scope"
Sources:File "lexer/TokenList.lua" :Name "TokenList"
Sources:File "lexer/Constants.lua" :Name "Constants"
Sources:File "lexer/Tasks.lua"
:Alias "Lexer.Tasks"
:Depends "HowlFile"
:Depends "Parse"
:Depends "Rebuild"
end
do -- Minification
Sources:File "files/Files.lua"
:Name "Files"
:Depends "Utils"
:Depends "HowlFile"
Sources:File "files/Compilr.lua"
:Alias "Compilr"
:Depends "Files"
:Depends "Runner"
:Depends "Parse"
:Depends "Rebuild"
end
do -- Interop
Sources:File "interop/Colors.lua" :Name "colors"
Sources:File "interop/FileSystem.lua" :Name "fs"
Sources:File "interop/Shell.lua" :Name "shell"
Sources:File "interop/Terminal.lua"
:Name "term"
:Depends "colors"
Sources:File "interop/Globals.lua"
:Alias "InteropGlobals"
:Depends "term"
:Depends "colors"
end
if Options:Get("with-dump") then
Sources:Depends "Dump"
end
if Options:Get("with-minify") then
Sources:Depends "Lexer.Tasks"
end
if Options:Get("with-depends") then
Sources:Depends{"Bootstrap", "Combiner"}
end
if Options:Get("with-files") then
Sources:Depends{"Compilr"}
end
if Options:Get("with-interop") then
Sources
:Prerequisite "InteropGlobals"
:Prerequisite "shell"
:Prerequisite "fs"
:Prerequisite "term"
end
Tasks:Clean("clean", "build")
Tasks:Combine("combine", Sources, "build/Howl.lua", {"clean"})
Tasks:Minify("minify", "build/Howl.lua", "build/Howl.min.lua")
:Description("Produces a minified version of the code")
Tasks:CreateBootstrap("boot", Sources, "build/Boot.lua", {"clean"})
Tasks:Task "build"{"minify", "boot"}
:Description "Minify and bootstrap"