-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
targetpath.lua
39 lines (34 loc) · 951 Bytes
/
targetpath.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
-- imports
import("core.project.config")
import("core.project.project")
function main (targetname)
-- load config
config.load()
if not os.isfile(os.projectfile()) then
return
end
-- get target
local target = nil
if targetname then
target = project.target(targetname)
end
if not target then
for _, t in pairs(project.targets()) do
local default = t:get("default")
if (default == nil or default == true) and t:get("kind") == "binary" then
target = t
break
end
end
end
-- get target path
if target then
local targetfile = target:targetfile()
if not path.is_absolute(targetfile) then
targetfile = path.absolute(targetfile, os.projectdir())
end
print(targetfile)
end
-- print end tag to ignore other deprecated/warnings infos
print("__end__")
end