-
Notifications
You must be signed in to change notification settings - Fork 0
/
Howlfile.lua
80 lines (66 loc) · 2.51 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
Options:Default "trace"
local fs = require "howl.platform".fs
local Source = require "howl.files.Source"
local main = {
include = { "bsrocks/*.lua" },
exclude = { "bsrocks/bin/completions.lua", "bsrocks/bin/repl.lua" },
startup = "bsrocks/bin/bsrocks.lua",
api = true,
}
Tasks:clean()
Tasks:require "develop" (main) {
link = true,
output = "build/bsrocksD.lua",
description = "Generates a bootstrap file for development"
}
Tasks:require "main" (main) { output = "build/bsrocks.un.lua" }
Tasks:require "repl" {
include = {
"bsrocks/bin/repl.lua",
"bsrocks/lib/parse.lua",
"bsrocks/commands/repl.lua",
"bsrocks/lib/dump.lua",
},
output = "build/repl.lua",
startup = "bsrocks/bin/repl.lua",
}
Tasks:minify "minify" { input = "build/bsrocks.un.lua", output = "build/bsrocks.min.un.lua" }
Tasks:minify "replMin" { input = "build/repl.lua", output = "build/repl.min.lua" }
-- Add licenses. We kinda require this because diffmatchpatch
Tasks:Task "license" (function(_, _, file, dest)
local contents = table.concat {
"--[[\n",
fs.read(File "LICENSE"),
"\n\n",
fs.read(File "LICENSE-DMP"),
"\n]]\n",
fs.read(File(file)),
}
fs.write(File(dest), contents)
end)
:Maps("wild:build/*.un.lua", "wild:build/*.lua")
:description "Append a license to a file"
Tasks:Task "licenses" {}
:requires { "build/bsrocks.lua", "build/bsrocks.min.lua" }
:description "Generate licensed files"
Tasks:Task "cleanup" (function()
fs.delete(File "build/bsrocks.un.lua")
fs.delete(File "build/bsrocks.min.un.lua")
end):description "Destory unlicensed files"
Tasks:Task "build" {"clean", "licenses", "replMin", "cleanup"} :description "Main build task"
Tasks:Default "build"
Tasks:Task "upload" {"upload:core", "upload:repl"} :description "Uploads all the files"
Tasks:gist "upload:core" (function(spec)
spec:summary "Vanilla Lua emulation and package manager (http://www.computercraft.info/forums2/index.php?/topic/26032- and https://github.com/SquidDev-CC/Blue-Shiny-Rocks)"
spec:gist "6ced21eb437a776444aacef4d597c0f7"
spec:from "build" {
include = { "bsrocks.lua", "bsrocks.min.lua" }
}
end) :Requires { "build/bsrocks.lua", "build/bsrocks.min.lua" }
Tasks:gist "upload:repl" (function(spec)
spec:summary "A fancy Lua REPL (originally from Blue-Shiny-Rocks: http://www.computercraft.info/forums2/index.php?/topic/26032- and https://github.com/SquidDev-CC/Blue-Shiny-Rocks)"
spec:gist "e204ea9b6032dabf0cba3f57893125ba"
spec:from "build" {
include = { "repl.lua", "repl.min.lua" }
}
end) :Requires { "build/repl.lua", "build/repl.min.lua" }