From 2c4dc9522df5274f77ea9cb842890b409036525b Mon Sep 17 00:00:00 2001 From: Reece Date: Tue, 16 Nov 2021 12:12:13 +0000 Subject: [PATCH] [+] Added support for filtering by options [+] Added more documentation in the form of objects.lua pseudo code --- Core/Target/Target.lua | 11 ++++- Public/objects.lua | 100 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 102 insertions(+), 9 deletions(-) diff --git a/Core/Target/Target.lua b/Core/Target/Target.lua index cb008a3..d9be88a 100644 --- a/Core/Target/Target.lua +++ b/Core/Target/Target.lua @@ -99,6 +99,7 @@ end local function auFilterOf(configFilter, ...) local ret = {} + local andOptions = {} local test = function(val, orArray, notArray) if (orArray) then @@ -154,7 +155,15 @@ local function auFilterOf(configFilter, ...) end) end) - return auConcatVararg({table.concat(ret, " or ")}, ...) + auForEach(configFilter.options, function(option) + table.insert(andOptions, "options:" .. option) + end) + + auForEach(configFilter.notOptions, function(option) + table.insert(andOptions, "not options:" .. option) + end) + + return auConcatVararg({table.concat(ret, " or ")}, andOptions, ...) end return { diff --git a/Public/objects.lua b/Public/objects.lua index 20422bf..1c252e4 100644 --- a/Public/objects.lua +++ b/Public/objects.lua @@ -2,15 +2,34 @@ function auEnum(...) return nil end -function auProjectO() +function auProjectInfoO() -- extends auHeaderProject + return {} +end + +function auBaseProjectO() + return { + info = auProjectInfoO() + } +end + +function auAbstractProjectO() -- extends auBaseProject + return { + process = function(info, visit) end, + resolveDependencies = function(this, resolveFunction) end, + handleLink = function(this) end, + handleReference = function(this) end + } +end + +function auProjectO() -- extends auAbstractProjectO + -- auAbstractProjectO is implemented by either your projects lua script or the json processor +end + +function auSolutionO() -- extends auHeaderPartO end -function auSolutionO() - -end - -function auVisitO() +function auVisitO() -- extends auProjectInfoO end @@ -28,7 +47,9 @@ function auFilterInO() archs = nil, notConfigs = nil, notPlatforms = nil, - notArchs = nil + notArchs = nil, + notOptions = nil, + options = nil } end @@ -42,4 +63,67 @@ function auStartProjectO() dest = "!", -- "!" means default binary export path root = nil } -end \ No newline at end of file +end + +-- Root JSON element +function auHeaderProjectO() + return { + projectType = "ConsoleApp", + name = "AuroraProject", + namespace = "" + } +end + +-- + +function auBlockProjectKeyDefines() + +end + +function auBlockProjectKeyIncludes() + +end + +function auBlockProjectKeyFeatures() + +end + +function auBlockProjectKeyExcludes() + +end + +function auBlockProjectKeySources() + +end + +function auBlockProjectKeyLinks() + +end + +function auBlockProjectKeyIncludeDepends() + +end + +function auBlockProjectKeyIncludeSoftDepends() + +end + +function auBlockProjectKeyLinkDepends() + +end + +function auBlockProjectKeyLinkSoftDepends() + +end + +-- Root JSON element and sub-documents +function auBlockProjectO() + +end + +-- Root JSON element +function auHeaderPartO() + return { + type = "part" + } +end