-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththird_party.lua
More file actions
57 lines (52 loc) · 1.76 KB
/
third_party.lua
File metadata and controls
57 lines (52 loc) · 1.76 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
57
local third_party = {}
local config = require(path.getrelative(_SCRIPT_DIR, _MAIN_SCRIPT_DIR) .. "/third_party/script/parse_config")
function third_party.acquire(filename)
config_file = filename or "third_party"
user_config_file = config_file .. ".user"
print("- third_party: acquire dependencies (config: '" .. config_file .. ".yml').")
local parsing_result = config.parse(config_file .. '.yml',
user_config_file .. '.yml')
if parsing_result then
print("- third_party: success")
else
print("- third_party: fail")
end
end
local dependency = require(path.getrelative(_SCRIPT_DIR, _MAIN_SCRIPT_DIR) .. "/third_party/script/dependency")
local function depend_impl(input, config)
if input then
if type(input) == "table" then
for id, value in pairs(input) do
dependency.depend_on(value, config)
end
else
dependency.depend_on(input, config)
end
else
print("Warning: Ignore empty 'depends_on' function call. "
.. "At least one argument is required")
end
end
function third_party.depends(table, config)
if config then
depend_impl(table, config)
else
filter "configurations:release"
depend_impl(table, "release")
filter "configurations:debug"
depend_impl(table, "debug")
filter {}
end
end
function third_party.depends_on_everything(config)
if config then
dependency.depend_on_everything(config)
else
filter "configurations:release"
dependency.depend_on_everything("release")
filter "configurations:debug"
dependency.depend_on_everything("debug")
filter {}
end
end
return third_party