[*] Typescript: include decls in project source alongside dep link dirs
This commit is contained in:
parent
ce24026ab0
commit
dbaaabeab8
@ -96,7 +96,9 @@ local function processProject(meta, object)
|
||||
|
||||
local typeDirs = {}
|
||||
|
||||
if (object.depends ) then
|
||||
table.insert(typeDirs, path.normalize(path.join(rootdir, object.base)))
|
||||
|
||||
if (object.depends) then
|
||||
auForEach(object.depends, function(dependency)
|
||||
local typeDir = path.normalize(path.join(linkPath2, dependency))
|
||||
table.insert(typeDirs, typeDir)
|
||||
@ -114,11 +116,16 @@ local function processProject(meta, object)
|
||||
local ew = ""
|
||||
local ew2 = {}
|
||||
|
||||
if (object.depends or object.depends2) then
|
||||
local bSingleShot = false
|
||||
--if (object.depends or object.depends2) then
|
||||
args = args .. ' --typeRoots "'
|
||||
|
||||
auForEach(typeDirs, function(dependency)
|
||||
if (bSingleShot) then
|
||||
args = args .. path.normalize(dependency) .. "\",\""
|
||||
else
|
||||
bSingleShot = true
|
||||
end
|
||||
|
||||
table.insert(ew2, dependency .. "/**/*.d.ts")
|
||||
table.insert(ew2, dependency .. "/*.d.ts")
|
||||
@ -131,7 +138,7 @@ local function processProject(meta, object)
|
||||
|
||||
args = args .. '"'
|
||||
args = args .. ew
|
||||
end
|
||||
--end
|
||||
|
||||
args = args:gsub(",\"\"", "")
|
||||
|
||||
@ -154,10 +161,10 @@ local function processProject(meta, object)
|
||||
|
||||
if (os.host() == "windows") then
|
||||
pathSuffix = "*\"";
|
||||
mkdir = "mkdir ";
|
||||
mkdir = "IF NOT EXIST \"PATH\" mkdir \"PATH\"";
|
||||
else
|
||||
pathSuffix = "\"";
|
||||
mkdir = "mkdir -p ";
|
||||
mkdir = "mkdir -p \"PATH\"";
|
||||
end
|
||||
|
||||
if (object.bundle) then
|
||||
@ -165,6 +172,11 @@ local function processProject(meta, object)
|
||||
else
|
||||
auForEach(object.files, function(file)
|
||||
local part = path.getrelative(meta.path, file):sub(1, -4)
|
||||
local isD = false
|
||||
if (part:ends(".d")) then
|
||||
part = part:sub(1, -3)
|
||||
isD = true
|
||||
end
|
||||
local script = part .. ".js"
|
||||
local dbg = part .. ".js.map"
|
||||
local link = part .. ".d.ts"
|
||||
@ -180,12 +192,13 @@ local function processProject(meta, object)
|
||||
local link2 = part2 .. ".d.ts"
|
||||
local dbg2p = part .. ".d.ts.map"
|
||||
|
||||
if (not isD) then
|
||||
auForEach(meta.out, function(dest)
|
||||
if (dest:starts(kPathPrefix)) then
|
||||
dest = Aurora.Settings.sAbsWd .. dest:sub(#kPathPrefix + 1)
|
||||
end
|
||||
|
||||
prebuildcommands(mkdir .. path.translate(path.normalize(path.getdirectory(path.join(dest, script2))), path.getDefaultSeparator()))
|
||||
prebuildcommands(mkdir:gsub("PATH", path.translate(path.normalize(path.getdirectory(path.join(dest, script2))), path.getDefaultSeparator())))
|
||||
|
||||
prebuildcommands(string.format("{COPY} \"%s\" \"%s%s",
|
||||
path.translate(path.normalize(path.join(compilerPath, script)), path.getDefaultSeparator()),
|
||||
@ -193,8 +206,8 @@ local function processProject(meta, object)
|
||||
|
||||
end)
|
||||
|
||||
prebuildcommands(mkdir .. path.translate(path.normalize(path.getdirectory(path.join(symPath, dbg2p))), path.getDefaultSeparator()))
|
||||
prebuildcommands(mkdir .. path.translate(path.normalize(path.getdirectory(path.join(linkPath, link2))), path.getDefaultSeparator()) )
|
||||
prebuildcommands(mkdir:gsub("PATH", path.translate(path.normalize(path.getdirectory(path.join(symPath, dbg2p))), path.getDefaultSeparator())))
|
||||
prebuildcommands(mkdir:gsub("PATH", path.translate(path.normalize(path.getdirectory(path.join(linkPath, link2))), path.getDefaultSeparator())))
|
||||
|
||||
prebuildcommands(string.format("{COPY} \"%s\" \"%s%s",
|
||||
path.translate(path.normalize(path.join(compilerPath, dbg)), path.getDefaultSeparator()),
|
||||
@ -204,9 +217,15 @@ local function processProject(meta, object)
|
||||
path.translate(path.normalize(path.join(compilerPath, dbg2)), path.getDefaultSeparator()),
|
||||
path.translate(path.normalize(path.join(symPath, dbg2p)), path.getDefaultSeparator()), pathSuffix))
|
||||
|
||||
|
||||
prebuildcommands(string.format("{COPY} \"%s\" \"%s%s",
|
||||
path.translate(path.normalize(path.join(compilerPath, link)), path.getDefaultSeparator()),
|
||||
path.translate(path.normalize(path.join(linkPath, link2)), path.getDefaultSeparator()), pathSuffix))
|
||||
else
|
||||
prebuildcommands(string.format("{COPY} \"%s\" \"%s%s",
|
||||
file,
|
||||
path.translate(path.normalize(path.join(linkPath, link2)), path.getDefaultSeparator()), pathSuffix))
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user