[+] TS: object.exportIDE for Visual Studio

This commit is contained in:
Reece Wilson 2022-05-22 05:55:35 +01:00
parent c67d2728ab
commit d551cda998

View File

@ -21,6 +21,7 @@ local function processJson(meta, object, result)
object.sources = result.sources
object.depends = result.depends
object.removeComments = result.removeComments
object.flags = result.flags or {}
end
local function processProject(meta, object)
@ -90,9 +91,7 @@ local function processProject(meta, object)
auAddBuildAction("pre", "cmd", "tsc", false, args)
if (object.exportIDE) then
end
local requiredDirs = {}
local requiredCopies = {}
@ -141,22 +140,39 @@ local function processProject(meta, object)
end)
prebuildcommands(mkdir .. path.translate(path.normalize(path.getdirectory(symPath .. "/" .. dbg2p)), path.getDefaultSeparator()))
prebuildcommands(mkdir .. path.translate(path.normalize(path.getdirectory(linkPath .. "/" .. link2)), path.getDefaultSeparator()) )
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(string.format("{COPY} \"%s\" \"%s%s",
path.translate(path.normalize(path.join(compilerPath, dbg)), path.getDefaultSeparator()),
path.translate(path.normalize((symPath .. "/" .. dbgp)), path.getDefaultSeparator()), pathSuffix))
path.translate(path.normalize(path.join(symPath, dbgp)), path.getDefaultSeparator()), pathSuffix))
prebuildcommands(string.format("{COPY} \"%s\" \"%s%s",
path.translate(path.normalize(path.join(compilerPath, dbg2)), path.getDefaultSeparator()),
path.translate(path.normalize((symPath .. "/" .. dbg2p)), path.getDefaultSeparator()), pathSuffix))
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(linkPath .. "/" .. link2), path.getDefaultSeparator()), pathSuffix))
path.translate(path.normalize(path.join(linkPath, link2)), path.getDefaultSeparator()), pathSuffix))
end)
end
if (object.exportIDE) then
local compilerOptions = {}
auMergeTable(compilerOptions, object.flags)
compilerOptions.typeRoots = typeDirs
compilerOptions.target = object.targetVersion
local IDE = {
autogeneratedfile = "DO NOT MODIFY OR ATTEMPT TO COMPILE. IDE LINT, TOOLTIP, AND AUTOCOMPLETE USAGE ONLY",
files = object.files,
compilerOptions = compilerOptions
}
io.writefile("tsconfig.json", json.encode(IDE))
files "tsconfig.json"
end
end