[*] Added dependencies

This commit is contained in:
Reece Wilson 2022-02-19 22:25:03 +00:00
commit 560912fe63
54 changed files with 15481 additions and 0 deletions

218
.gitignore vendored Normal file
View File

@ -0,0 +1,218 @@
# Aurora's general purpose JS/TS/C/C++/Go vs/vscode/intellij/codelite gitignore reference
# Almost usable for Java and Qt
# Aurora build configuration
Build_CompilerWorkingDirectory/*
Build_Developers/*
Build_Ship/*
Build_Internal/*
Build_Develop/*
Build_Stage/*
Build_Ship/*
Build_Workspace/*
Build_Symbols/*
Build_Link/*
Build/Developers/*
Build/Ship/*
Build/Develop/*
Build/Stage/*
Build/Ship/*
Build/Workspace/*
Build/Symbols/*
Build/Link/*
# License Headers VS extension
*.licenseheader
# Binaries / object files
*.dll
*.exe
*.obj
*.so
*.so.*
*.la
*.lai
*.pdb
*.idb
*.exe~
*.obj
*.dynlib
*.dylib
*.lib
*.d
*.o
*.a
*.la
*.slo
*.lo
*.out
# go unit test
*.test
# Autogenerated project files
compile_flags.txt
*.mk
*.project
*cmake
Makefile
*.vcxproj
*.xcodeproj
# IDE trash
.vscode
.vs
/*.gcno
.intellij
.clion
*.vcxproj.filters
*.vcxproj.user
*.tlog
# OSX
.DS_Store
.AppleDouble
.LSOverride
xcuserdata/
# Win32
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
*.lnk
# Linux is trash and cant hotswap like NT
.nfs*
.fuse_hidden*
# Ninja
.ninja_deps
.ninja_log
# PID locks
*.pid
*.pid.lock
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# JetBrains
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-*/
# Android Studio
.idea/caches/build_file_checksums.ser
# why would we ever ship this dir?
.idea/caches/*
# NodeJS
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# node-waf configuration
.lock-wscript
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# VS Code Extensions
.vscode-test
# Qt unit tests
target_wrapper.*
# QtCreator
*.autosave
# QtCreator Qml
*.qmlproject.user
*.qmlproject.user.*
# QtCreator CMake
CMakeLists.txt.user*
# QtCreator 4.8< compilation database
compile_commands.json
# QtCreator local machine specific files for imported projects
*creator.user*
*_qmlcache.qrc
# QT cache and user files
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.moc
# Java trash
hs_err_pid*
.gradle
gradle-app.setting
!gradle-wrapper.jar
.gradletasknamecache
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar

72
.gitmodules vendored Normal file
View File

@ -0,0 +1,72 @@
[submodule "Build_Scripts"]
path = Build_Scripts
url = https://git.reece.sx/AuroraPipeline/Build
[submodule "Include"]
path = Include
url = https://git.reece.sx/AuroraPipeline/Include
[submodule "Vendor/bzip2"]
path = Vendor/bzip2
url = https://git.reece.sx/AuroraMiddleware/bzip2
[submodule "Vendor/fmt"]
path = Vendor/fmt
url = https://git.reece.sx/AuroraMiddleware/fmt
[submodule "Vendor/libtomcrypt"]
path = Vendor/libtomcrypt
url = https://git.reece.sx/AuroraMiddleware/libtomcrypt
[submodule "Vendor/libtommath"]
path = Vendor/libtommath
url = https://git.reece.sx/AuroraMiddleware/libtommath
[submodule "Vendor/lz4"]
path = Vendor/lz4
url = https://git.reece.sx/AuroraMiddleware/lz4
[submodule "Vendor/mbedtls"]
path = Vendor/mbedtls
url = https://git.reece.sx/AuroraMiddleware/mbedtls
[submodule "Vendor/mimalloc"]
path = Vendor/mimalloc
url = https://git.reece.sx/AuroraMiddleware/mimalloc
[submodule "Vendor/nlohmannjson"]
path = Vendor/nlohmannjson
url = https://git.reece.sx/AuroraMiddleware/nlohmannjson
[submodule "Vendor/stduuid"]
path = Vendor/stduuid
url = https://git.reece.sx/AuroraMiddleware/stduuid
[submodule "Vendor/zlib"]
path = Vendor/zlib
url = https://git.reece.sx/AuroraMiddleware/zlib
[submodule "Vendor/zstd"]
path = Vendor/zstd
url = https://git.reece.sx/AuroraMiddleware/zstd
[submodule "Vendor/o1heap"]
path = Vendor/o1heap
url = https://git.reece.sx/AuroraMiddleware/o1heap
[submodule "Aurora/Runtime"]
path = Aurora/Runtime
url = https://git.reece.sx/AuroraSupport/AuroraRuntime
[submodule "Aurora/ForEach"]
path = Aurora/ForEach
url = https://git.reece.sx/AuroraSupport/AuroraForEach
[submodule "Aurora/Interfaces"]
path = Aurora/Interfaces
url = https://git.reece.sx/AuroraSupport/AuroraInterfaces
[submodule "Aurora/Enum"]
path = Aurora/Enum
url = https://git.reece.sx/AuroraSupport/AuroraEnum
[submodule "Vendor/libpng"]
path = Vendor/libpng
url = https://gitea.reece.sx/AuroraMiddleware/libpng.git
[submodule "Vendor/wxConfig"]
path = Vendor/wxConfig
url = https://gitea.reece.sx/AuroraMiddleware/wxConfig.git
[submodule "Vendor/wxwidgets"]
path = Vendor/wxwidgets
url = https://gitea.reece.sx/AuroraMiddleware/wxWidgets.git
[submodule "Vendor/libexpat"]
path = Vendor/libexpat
url = https://gitea.reece.sx/AuroraMiddleware/expat.git
[submodule "Tests/googletest"]
path = Tests/googletest
url = https://github.com/google/googletest
[submodule "Vendor/Runtime"]
path = Vendor/Runtime
url = https://git.reece.sx/AuroraSupport/AuroraRuntime

1
Aurora/Enum Submodule

@ -0,0 +1 @@
Subproject commit 24ea7a67a06846aec4950b2a72d15dc72e9621b0

1
Aurora/ForEach Submodule

@ -0,0 +1 @@
Subproject commit 68a3479d137610dff8857c9054454ed8704c642c

1
Aurora/Interfaces Submodule

@ -0,0 +1 @@
Subproject commit f6025d08cdc85911579c401cb85d49621609546e

1
Aurora/Runtime Submodule

@ -0,0 +1 @@
Subproject commit 786496647819719a93030e235b6a8535a74b0a64

204
AuroraSolution.lua Normal file
View File

@ -0,0 +1,204 @@
require("aurora")
auStartSolution({name = "Runtime Project"})
local kNamespaceStlEx = "Vendor - 1 - STLEX"
local kNamespaceCompression = "Vendor - 2 - COMPRESSION"
local kNamespaceFormats = "Vendor - 3 - FORMATS"
local kNamespaceRtSupport = "Vendor - 4 - RUNTIME SUPPORT"
local kNamespaceCrypto = "Vendor - 5 - CRYPTO"
local kNamespaceJS = "Vendor - 6 - JAVASCRIPT"
local kNamespaceGraphics = "Vendor - 7 - GRAPHICS"
local kNamespaceAudio = "Vendor - 8 - AUDIO"
auAddVisit({
namespace = kNamespaceGraphics,
name = "wxwidgets",
path = "Vendor/wxwidgets",
type = "SharedLib"
})
auAddVisit({
namespace = kNamespaceStlEx,
name = "uuid",
path = "Vendor/stduuid",
type = "StaticLib"
})
auAddVisit({
namespace = kNamespaceCompression,
name = "zstd",
path = "Vendor/zstd",
type = "StaticLib"
})
auAddVisit({
namespace = kNamespaceCompression,
name = "zlib",
path = "Vendor/zlib",
type = "StaticLib"
})
auAddVisit({
namespace = kNamespaceCompression,
name = "bzip2",
path = "Vendor/bzip2",
type = "StaticLib"
})
auAddVisit({
namespace = kNamespaceCompression,
name = "lz4",
path = "Vendor/lz4",
type = "StaticLib"
})
--auAddVisit({
-- namespace = kNamespaceCompression,
-- name = "lzma",
-- path = "Vendor/liblzma",
-- type = "StaticLib"
--})
auAddVisit({
namespace = kNamespaceCrypto,
name = "ltc",
path = "Vendor/libtomcrypt",
type = "StaticLib"
})
auAddVisit({
namespace = kNamespaceCrypto,
name = "ltm",
path = "Vendor/libtommath",
type = "StaticLib"
})
auAddVisit({
namespace = kNamespaceCrypto,
name = "mbedtls",
path = "Vendor/mbedtls",
type = "StaticLib"
})
auAddVisit({
namespace = kNamespaceStlEx,
name = "fmt",
path = "Vendor/fmt",
type = "StaticLib"
})
auAddVisit({
namespace = kNamespaceStlEx,
name = "json",
path = "Vendor/nlohmannjson",
type = "StaticLib"
})
auAddVisit({
namespace = kNamespaceRtSupport,
name = "mimalloc",
path = "Vendor/mimalloc",
type = "StaticLib"
})
auAddVisit({
namespace = kNamespaceRtSupport,
name = "o1heap",
path = "Vendor/o1heap",
type = "StaticLib"
})
auAddVisit({
namespace = "Aurora",
name = "AuroraRuntime",
path = "Aurora/Runtime",
type = "SharedLib",
out = "!"
})
auAddVisit({
namespace = "Aurora",
name = "AuroraForEach",
path = "Aurora/ForEach",
type = "StaticLib"
})
auAddVisit({
namespace = "Aurora",
name = "AuroraInterfaces",
path = "Aurora/Interfaces",
type = "StaticLib"
})
auAddVisit({
namespace = "Aurora",
name = "AuroraEnum",
path = "Aurora/Enum",
type = "StaticLib"
})
auAddVisit({
namespace = kNamespaceFormats,
name = "png",
path = "Vendor/libpng",
type = "StaticLib"
})
auAddVisit({
namespace = kNamespaceFormats,
name = "expat",
path = "Vendor/libexpat",
type = "StaticLib"
})
auProcessSolution()
local processTests = function()
local addTestGroup = function(name)
local ns = "Test " .. name
auStartGroup(ns)
function dirName(fullPath)
local pos = (path.translate(fullPath):reverse()):find("%" .. path.getDefaultSeparator())
return (fullPath:sub(1 - pos))
end
local experiments = os.matchdirs("Tests/" .. name .. "/*")
auForEach(experiments, function(experimentDirectory)
local testName = dirName(experimentDirectory)
auStartProject({name = testName, projectType = "ConsoleApp", src = experimentDirectory, inc = experimentDirectory, root = experimentDirectory})
auLinkAndRefProject("AuroraRuntime")
location(experimentDirectory)
auFilter (auFilterOf({platforms = "win32"}))
defines "GTEST_OS_WINDOWS"
auFilter {}
auFilter (auFilterOf({platforms = "linux"}))
defines "GTEST_OS_LINUX"
auFilter {}
auFilter (auFilterOf({platforms = "mac"}))
defines "GTEST_OS_MAC"
auFilter {}
defines "GTEST_HAS_EXCEPTIONS"
includedirs {"Tests/googletest/googletest"}
includedirs {"Tests/googletest/googletest/include"}
files "Tests/googletest/googletest/src/gtest-all.cc"
files "Tests/Common/**.*"
files("Apps/Experiments/Bootstrap/**.*")
end)
end
addTestGroup("Private")
addTestGroup("Public")
end
processTests()

1
Build_Scripts Submodule

@ -0,0 +1 @@
Subproject commit 3b9bf8adf1958264a5608ac1d28367ea50428973

View File

@ -0,0 +1,17 @@
{
"type": "generic",
"name": "bzip2",
"dllimport": "BZ_IMPORT",
"dllexport": [],
"include": "/",
"staticImpDefines": "BZ_NOEXPORT",
"sources": [
"blocksort.*",
"huffman.*",
"crctable.*",
"randtable.*",
"compress.*",
"decompress.*",
"bzlib.*"
]
}

View File

@ -0,0 +1,7 @@
{
"name": "xpat",
"type": "generic",
"sourcePaths": "expat/lib",
"include": "expat/lib",
"defines": "XML_STATIC"
}

View File

@ -0,0 +1,7 @@
{
"name": "fmt",
"type": "generic",
"noLink": true,
"include": "include",
"defines": "FMT_HEADER_ONLY"
}

View File

@ -0,0 +1,6 @@
{
"noLink": true,
"type": "generic",
"include": "single_include",
"name": "json"
}

View File

@ -0,0 +1,13 @@
{
"name": "libtomcrypt",
"type": "generic",
"include": "src/headers",
"sourcePaths": "src",
"excludes": [
"demos/**.*",
"tests/**.*"
],
"depends": "ltm",
"defines": ["USE_LTM", "LTC_NO_PROTOTYPES"],
"impDefines": ["LTC_SOURCE", "LTC_NO_TEST"]
}

View File

@ -0,0 +1,9 @@
{
"name": "libtommath",
"type": "root",
"excludes": [
"demo/**.*",
"mtest/**.*",
"etc/**.*"
]
}

View File

@ -0,0 +1,9 @@
{
"name": "lz4",
"type": "generic",
"sourcePaths": "lib",
"dllexport": "LZ4_DLL_EXPORT=1",
"dllimport": "LZ4_DLL_IMPORT=1",
"staticImpDefines": "LZ4_STATIC_LINKING_ONLY",
"include": "lib"
}

View File

@ -0,0 +1,7 @@
{
"name": "mbedtls",
"type": "generic",
"sourcePaths": "library/",
"include": "include/",
"depends": ["AuroraRuntime"]
}

View File

@ -0,0 +1,11 @@
{
"name": "mimalloc",
"type": "generic",
"sourcePaths": "src",
"include": "include",
"excludes": [
"src/page-queue.c",
"src/page-queue.c",
"src/static.c"
]
}

View File

@ -0,0 +1,5 @@
{
"type": "lazy_free",
"name": "o1heap",
"depends": ["AuroraRuntime"]
}

View File

@ -0,0 +1,27 @@
{
"name": "libpng",
"type": "root",
"dllexport": "PNG_BUILD_DLL",
"dllimport": "PNG_USE_DLL",
"excludes": [
"mips/**.c",
"intel/**.c",
"powerpc/**.c",
"arm/**.c",
"contrib/**.*",
"projects/**.*",
"scripts/**.*"
],
"actions": [
{
"filter": {
"archs": "x86_64"
},
"then": {
"sources": "intel/**.c",
"impDefines": "PNG_INTEL_SSE_OPT=1"
}
}
],
"depends": "zlib"
}

View File

@ -0,0 +1,6 @@
{
"name": "uuid",
"type": "generic",
"noLink": true,
"include": "include"
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,211 @@
local configPath = "../wxConfig/"
local gl = true
local gtk = linux
local windows = win32
local wxGlobals = {"__WX__", "wxUSE_GUI=1", "wxUSE_BASE=1","_FILE_OFFSET_BITS=64"}
local platform_macro = "__WXUNKNOWNPLATFORM_"
--local wxvarsW32 = {}
--if (windows) then
--platform_macro = "__WXMSW__"
local wxvarsW32 = require("wxwidgets-windows-msw")
--elseif (gtk_linux) then
--platform_macro = "__WXGTK__"
local wxvarsLinux = require("wxwidgets-linux-gtk")
--end
local function addPlatformMacro()
auFilter(auFilterOf{platforms = "win32"})
defines "__WXMSW__"
auFilter {}
auFilter(auFilterOf{platforms = "linux"})
defines "__WXGTK__"
auFilter {}
end
local function translateDep(that, dep)
if (that.info.translations) then
local override = that.info.translations[dep]
if (override) then
dep = override
end
end
return dep
end
local function incDep(that, dep, link)
if (link) then
auIncludeProject(that:translateDep(dep))
else
auIncludeProject(that:translateDep(dep))
end
end
local function addSources(name)
auFilter(auFilterOf{platforms = "win32"})
auForEach(wxvarsW32[name], files)
auFilter {}
auFilter(auFilterOf{platforms = "linux"})
auForEach(wxvarsLinux[name], files)
auFilter {}
end
local function includeBaseGtk(that)
incDep(that, "gtk-desktop-bins")
end
local function processRegex(that)
auStartProject({name = "wxregex", projectType = "StaticLib", inc = "include"})
addPlatformMacro()
files
{
"src/regex/regcomp.*",
"src/regex/regexec.*",
"src/regex/regerror.*",
"src/regex/regfree.*"
}
includedirs(configPath)
end
local function processScintilla(that)
auStartProject({name = "wxscintilla", projectType = "StaticLib", src = "src/stc/scintilla/src", inc = "src/stc/scintilla/include"})
defines({"__WX__", "SCI_LEXER", "NO_CXX11_REGEX", "LINK_LEXERS", "_FILE_OFFSET_BITS=64"})
addPlatformMacro()
includedirs("include/")
includedirs(configPath)
includedirs("src/stc/scintilla/src")
includedirs("src/stc/scintilla/lexlib")
includedirs("src/stc/scintilla/lexers")
addSources("STC_SRC")
if (gtk) then
includeBaseGtk(that)
if (_linux) then
includedirs("gdk/include")
includedirs "/usr/include/at-spi-2.0 "
includedirs "/usr/include/at-spi2-atk/2.0"
includedirs "/usr/include/dbus-1.0"
includedirs "/usr/lib/dbus-1.0/include"
includedirs "/usr/include/libmount"
includedirs "/usr/include/libsecret-1"
end
end
end
local function processWxWidgets(that)
auStartProject({name = "wxWidgets", projectType = "StaticLib", inc = "include"})
defines(wxGlobals)
defines "WXBUILDING"
incDep(that, "zlib")
--dependson "wxscintilla"
includedirs("src/stc/scintilla/include")
incDep(that, "expat")
defines "XML_STATIC"
includedirs("src/common")
includedirs("src/regex")
includedirs("src/stc/scintilla/include")
includedirs(configPath)
if (gtk) then
includeBaseGtk()
else
incDep(that, "png")
incDep(that, "freetype")
incDep(that, "harfbuzz")
end
addSources("CORE_SRC")
addSources("BASE_SRC")
addSources("BASE_AND_GUI_SRC")
addSources("BASE_PLATFORM_SRC")
addSources("RICHTEXT_SRC")
addSources("XML_SRC")
addSources("HTML_SRC")
if (net) then
addSources("NET_PLATFORM_SRC")
addSources("NET_SRC")
end
if (gl) then
addSources("OPENGL_SRC")
end
end
local function auSetupProjectProject(this)
processRegex(this)
processScintilla(this)
processWxWidgets(this)
end
local function linkProject(this)
links "wxregex"
links "wxscintilla"
links "wxWidgets"
links(translateDep(this, "zlib"))
links(translateDep(this, "expat"))
links(translateDep(this, "png"))
auFilter(auFilterOf{platforms = "linux"})
-- TODO:?
--linkExternalUnixDeps(this)
auFilter {}
if (gtk) then
incDep(this, "gtk-desktop-bins", true)
end
auFilter(auFilterOf{platforms = "win32"})
links "Rpcrt4.lib"
links "Comctl32.lib"
auFilter {}
end
local function includeProject(this)
includedirs(this.info.path .. "/include")
includedirs(this.info.path .. "/src/common")
includedirs(this.info.path .. "/" .. configPath)
defines "XML_STATIC"
defines (wxGlobals)
addPlatformMacro()
end
local function resolveDependencies(this, resolve)
resolve(translateDep(this, "zlib"))
resolve(translateDep(this, "png"))
resolve(translateDep(this, "expat"))
if (gtk) then
resolve(translateDep(this, "gtk-desktop-bins"))
end
end
local function wxWidgetsProcessor(info)
local interface = {}
interface.info = info
interface.process = auSetupProjectProject
interface.handleLink = linkProject
interface.handleReference = includeProject
interface.resolveDependencies = resolveDependencies
return interface
end
return wxWidgetsProcessor

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,225 @@
const fio = require("fs")
const jsonTable = require("./wxwidgets_in.json")
var variableTable = {
"PLATFORM_WIN32": "1",
"PLATFORM_UNIX": "0",
"PLATFORM_MACOSX": "0",
"TOOLKIT": "MSW",
"TOOLKIT_VERSION": "4",
"USE_GUI": "1",
"WXUNIV": "0",
"FORMAT": "aurora",
"USE_PLUGINS": "0"
}
function stringifyTableJS()
{
var translatedScript = "";
var keys = Object.keys(variableTable)
keys.forEach((key) => {
var value = variableTable[key]
value = value.split("\r").join("\\r").split("\n").join("\\n")
translatedScript += "var " + key + " = \"" + value + "\";\n"
})
return translatedScript
}
function stringifyTableLua()
{
var translatedScript = "";
var keys = Object.keys(variableTable)
keys.forEach((key) => {
var value = variableTable[key]
//value = value.split("\r").join("");
if (value.indexOf("\n") != -1)
{
var onePassed = false
translatedScript += "local " + key + " = {\n";
var subValues = value.split(" ").join("\n").split("\n");
for (var i = 0; i < subValues.length; i++)
{
var subValue = subValues[i].trim();
if (subValue.length == 0) continue
translatedScript += " \"" + subValue.trim() + "\"" + (i + 1 == subValues.length ? "" : ",") + "\n"
}
translatedScript += "};\n"
}
else
{
translatedScript += "local " + key + " = \"" + value + "\";\n"
}
})
return translatedScript
}
function stringifyTableTableLua()
{
var translatedScript = "";
var keys = Object.keys(variableTable)
translatedScript += "local _MAGICTABLE = {\n";
for (var i = 0; i < keys.length; i++)
{
var key = keys[i];
translatedScript += " \"" + key + "\" = " + key + (i + 1 == keys.length ? "" : ",") + "\n"
}
translatedScript += "};\n"
return translatedScript
}
function isGroupValid(json, condition)
{
var translatedScript = stringifyTableJS()
console.log(condition)
if (condition.indexOf("FORMAT") != -1)
{
// global struct should always pass
return true
}
translatedScript += condition.split("and").join("&&");
//console.log("script", translatedScript)
var val = eval(translatedScript)
//console.log(translatedScript, val)
return val
}
function getGroupValid(json)
{
if (!json.if)
return json
var conditions = json.if
var condition = null
if (!conditions)
{
console.log("json object missing condition array/object", json)
return false
}
if (Array.isArray(conditions))
{
for(condition of conditions)
{
var condField = condition["@cond"]
if (!condField)
{
console.log("json child object missing condition", condition)
continue
}
if (isGroupValid(json, condField))
{
return condition
}
}
}
else
{
condition = conditions["@cond"]
if (!condition)
{
console.log("json object missing condition", json)
return false
}
if (isGroupValid(json, condition))
{
return conditions
}
}
}
function parseString(str)
{
for(var nextIndex = 0; (nextIndex = str.indexOf("$")) != -1; )
{
if (str[nextIndex + 1] != "(")
{
console.log("$ is not allowed in string. giving up, returning: ", str)
return str
}
var prefix = str.substr(0, nextIndex);
var endIndex = str.indexOf(")", nextIndex)
var expressionStart = nextIndex + 2;
var expression = str.substr(expressionStart, endIndex - expressionStart)
var suffix = str.substr(endIndex + 1)
console.log("reconstructing", prefix, expression, suffix)
var value = variableTable[expression]
if (!value)
{
console.log("warning: couldn't lookup variable", expression)
console.log(expression)
value = ""
}
str = prefix + value + suffix
}
console.log("parsed expression", str)
return str
}
function handleSetVariablesFunc(json, text)
{
var value = null;
if (Array.isArray(text))
{
text.forEach((line) => {value += parseString(line) + "\\n"} )
}
else
{
value = parseString(text)
}
console.log("key", json["@var"])
variableTable[json["@var"]] = value;
}
function handleSetVariableField(json, fields)
{
console.log("processing set variables")
fields.forEach(field => processVariable(field))
}
function processVariable(json, override)
{
console.log("analyzing", json)
var key = json
if (!((override) || (key = getGroupValid(json))))
{
console.log("ignoring group", json["@var"])
return;
}
console.log("parsing", key)
var setVariablesFunc = key["set"]
var setVariableField = key["#text"]
if (setVariablesFunc)
{
handleSetVariableField(json, setVariablesFunc)
}
else if (setVariableField)
{
console.log("alpha")
handleSetVariablesFunc(json, setVariableField)
}
}
processVariable(jsonTable, true)
console.log("processed")
console.log(variableTable)
var luaBuildScript = stringifyTableLua()
luaBuildScript += "\n\n\n";
luaBuildScript += stringifyTableTableLua()
fio.writeFileSync("out.lua", luaBuildScript)

View File

@ -0,0 +1,4 @@
{
"name": "zlib",
"type": "lazy_free"
}

View File

@ -0,0 +1,16 @@
{
"name": "zstd",
"type": "generic",
"include": "lib",
"soft-depends": ["AuroraRuntime"],
"sources": [
"lib/*.h",
"lib/common/*.*",
"lib/compress/*.*",
"lib/decompress/*.*",
"lib/dictBuilder/*.*",
"lib/legacy/*.*"
],
"defines": "ZSTD_MULTITHREAD",
"msvcIgnore": "4267"
}

1
Include Submodule

@ -0,0 +1 @@
Subproject commit 07b229a4bbe3d92b0ca6697732eca10b46c2b1e0

8
LICENSE Normal file
View File

@ -0,0 +1,8 @@
Copyright 2020-2022 J Reece Wilson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0
README.md Normal file
View File

35
Tests/Common/assert.hpp Normal file
View File

@ -0,0 +1,35 @@
/***
Copyright (c) 2020 Reece Wilson (a/k/a "Reece"). All rights reserved.
File: assert.hpp
Date: 2020-6-9
Originator: Reece
Purpose:
***/
#pragma once
#include <string>
namespace Aurora::UnitTesting
{
template<typename... Args>
static void Assert(bool value, const char * function, const char * file, int line, const char * expr, const std::string &fmt, Args... args)
{
if (value)
return;
Console::Warn("assertion hit - {}#{} ({}). failed expression: {}", file, line, function, expr);
Console::Warn(fmt, args...);
EndTest(TestResponse::kUnitError);
}
}
#define STRINGIGY_Z(in) #in
#define STRINGIGY_X(in) STRINGIGY_Z(in)
#define UnitAssert(tru, str, ...) \
do { \
Aurora::UnitTesting::Assert(tru, __FUNCTION__, __FILE__, __LINE__, STRINGIGY_X(tru), str, ## __VA_ARGS__); \
} while (0)

87
Tests/Common/console.cpp Normal file
View File

@ -0,0 +1,87 @@
/***
Copyright (c) 2020 Reece Wilson (a/k/a "Reece"). All rights reserved.
File: console.cpp
Date: 2020-6-9
Originator: Reece
Purpose: Lightweight and portable unit test abstraction
***/
#include <AuroraCommon.hpp>
#include "console.hpp"
#if defined(AURORA_PLATFORM_WIN32)
#include <windows.h>
#endif
#include <string>
#include <cstdio>
#include <array>
using namespace Aurora::UnitTesting;
using namespace Aurora::UnitTesting::Console;
#if defined(AURORA_PLATFORM_WIN32)
static bool kSupportsColor = false;
#else
static bool kSupportsColor = true;
#endif
static std::array<std::string, static_cast<size_t>(AnsiColor::kCount)> kAnsiCheats {
"\033[0;31m",
"\033[1;31m",
"\033[0;32m",
"\033[1;32m",
"\033[0;33m",
"\033[1;33m"
"\033[0;34m",
"\033[1;34m",
"\033[0;35m",
"\033[1;35m",
"\033[0;36m",
"\033[1;36m",
"\033[0m",
"\033[0m"
};
void Console::WriteLine(const std::string &prefix, AnsiColor color, const std::string &msg)
{
std::string ret;
if (kSupportsColor)
{
ret = kAnsiCheats[static_cast<size_t>(color)];
}
ret += "[" + prefix + "]\t| ";
ret += msg;
if (kSupportsColor)
{
ret += kAnsiCheats[static_cast<size_t>(AnsiColor::kReset)];
}
puts(ret.c_str());
}
void Console::Init()
{
#ifdef AURORA_PLATFORM_WIN32
auto handle = GetStdHandle(STD_OUTPUT_HANDLE);
if (handle == INVALID_HANDLE_VALUE)
{
puts("couldn't enable color. bad handle");
return;
}
DWORD mode = 0;
if (!(GetConsoleMode(handle, &mode) &&
SetConsoleMode(handle, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING)))
{
puts("couldn't enable color");
return;
}
kSupportsColor = true;
#endif
}

54
Tests/Common/console.hpp Normal file
View File

@ -0,0 +1,54 @@
/***
Copyright (c) 2020 Reece Wilson (a/k/a "Reece"). All rights reserved.
File: console.hpp
Date: 2020-6-9
Originator: Reece
Purpose:
***/
#pragma once
#include <string>
#include <fmt/format.h>
namespace Aurora::UnitTesting::Console
{
enum class AnsiColor
{
kRed,
kBoldRed,
kGreen,
kBoldGreen,
kYellow,
kBoldYellow,
kBlue,
kBoldBlue,
kMagenta,
kBoldMagenta,
kCyan,
kBoldCyan,
kReset,
kCount
};
void Init();
void WriteLine(const std::string &prefix, AnsiColor color, const std::string &msg);
template<typename... Args>
static void Log(const std::string &fmt, Args... args)
{
WriteLine("Log", AnsiColor::kGreen, fmt::format(fmt, args...));
}
template<typename... Args>
static void Warn(const std::string &fmt, Args... args)
{
WriteLine("Warn", AnsiColor::kRed, fmt::format(fmt, args...));
}
template<typename... Args>
static void Debug(const std::string &fmt, Args... args)
{
WriteLine("Debug", AnsiColor::kYellow, fmt::format(fmt, args...));
}
}

View File

@ -0,0 +1,34 @@
/***
Copyright (C) 2020 Reece Wilson (a/k/a "Reece"). All rights reserved.
File: entrypoint.cpp
Date: 2020-6-9
Originator: Reece
Purpose:
***/
#define _AURORA_RUNTIME_BUILD_API_INTERFACES
#include <AuroraCommon.hpp>
#include <AuroraRuntime.hpp>
#include "gtest/gtest.h"
#include "test.hpp"
#include "console.hpp"
using namespace Aurora::UnitTesting;
extern void RunTests();
int main(int argsc, const char ** argsv)
{
Aurora::UnitTesting::Console::Init();
RunTests();
::testing::InitGoogleTest(&argsc, (char **)argsv);
RUN_ALL_TESTS();
if (Aurora::RuntimeHasStarted())
{
Aurora::RuntimeShutdown();
}
Aurora::UnitTesting::Console::Log(" Single unit test executable passed without a failed assertion.");
Aurora::UnitTesting::Console::Log(" Returning exitcode encoded TestResponse::kPass w/ magic");
return ToExitCode(TestResponse::kPass);
}

17
Tests/Common/test.cpp Normal file
View File

@ -0,0 +1,17 @@
/***
Copyright 2020 Reece Wilson (a/k/a "Reece"). All rights reserved.
File: test.cpp
Date: 2020-6-12
Originator: Reece
Purpose: Lightweight and portable unit test abstraction
***/
#include <AuroraCommon.hpp>
#include "test.hpp"
#include <stdlib.h>
void Aurora::UnitTesting::EndTest(TestResponse response)
{
exit(ToExitCode(response));
}

50
Tests/Common/test.hpp Normal file
View File

@ -0,0 +1,50 @@
/***
Copyright 2020 Reece Wilson (a/k/a "Reece"). All rights reserved.
File: test.hpp
Date: 2020-6-9
Originator: Reece
Purpose:
***/
#pragma once
using namespace Aurora;
static_assert(sizeof(int) <= sizeof(Types::uint32_t), "not enough space to store exit code in exit int (sizeof(uint32_t) > sizeof(int))");
namespace Aurora::UnitTesting
{
const Types::uint16_t kExitMagic = 0x1771; // avoid UB by avoiding twos complement
enum class TestResponse
{
kPass,
kPassWithWarn,
kUnitError,
kScriptabilityError
};
static int ToExitCode(TestResponse code)
{
Types::uint32_t exit = 0;
exit |= (kExitMagic << 16);
exit |= static_cast<Types::uint16_t>(code);
return static_cast<int>(exit);
}
static bool ToTestResponse(int code, TestResponse &response)
{
Types::uint32_t exit = static_cast<Types::uint32_t>(code);
if (((exit >> 16) & 0xFFFF) != kExitMagic)
return false;
response = static_cast<TestResponse>(exit & 0xFFFF);
return true;
}
void EndTest(TestResponse response);
}

14
Tests/Common/unit.hpp Normal file
View File

@ -0,0 +1,14 @@
/***
Copyright 2020 Reece Wilson (a/k/a "Reece"). All rights reserved.
File: unit.hpp
Date: 2020-6-12
Originator: Reece
Purpose:
***/
#pragma once
#include <AuroraCommon.hpp>
#include "test.hpp"
#include "console.hpp"
#include "assert.hpp"

1
Tests/googletest Submodule

@ -0,0 +1 @@
Subproject commit 955c7f837efad184ec63e771c42542d37545eaef

1
Vendor/bzip2 vendored Submodule

@ -0,0 +1 @@
Subproject commit 99be3e790d7d832587c9e90f54992f9b55f9fa66

1
Vendor/fmt vendored Submodule

@ -0,0 +1 @@
Subproject commit 760ca5ccc0667f671eba928b081f24286af2f0d4

1
Vendor/libexpat vendored Submodule

@ -0,0 +1 @@
Subproject commit a28238bdeebc087071777001245df1876a11f5ee

1
Vendor/libpng vendored Submodule

@ -0,0 +1 @@
Subproject commit 1817d20ed3c4de3ad07a5fc34e27f92bfdfb7c38

1
Vendor/libtomcrypt vendored Submodule

@ -0,0 +1 @@
Subproject commit d059ecbbcbf3029daa35c655318a26d203daa238

1
Vendor/libtommath vendored Submodule

@ -0,0 +1 @@
Subproject commit ad69438311efca4b703388fafb1a5443bf9dc220

1
Vendor/lz4 vendored Submodule

@ -0,0 +1 @@
Subproject commit e2009622dd19556d31de498b68d8e555b7261251

1
Vendor/mbedtls vendored Submodule

@ -0,0 +1 @@
Subproject commit 4e4d72cce22b68d395bb5e23591d776f53923510

1
Vendor/mimalloc vendored Submodule

@ -0,0 +1 @@
Subproject commit 928a568c95597a022b6afebee9889cf053389c72

1
Vendor/nlohmannjson vendored Submodule

@ -0,0 +1 @@
Subproject commit e4643d1f1b03fc7a1d7b65f17e012ca93680cad8

1
Vendor/o1heap vendored Submodule

@ -0,0 +1 @@
Subproject commit b026aef3b155282556b9c88c75398d0054b17bc5

1
Vendor/stduuid vendored Submodule

@ -0,0 +1 @@
Subproject commit ce7ad89de245aa030af7cf868b798e5f25fcf89e

1
Vendor/wxConfig vendored Submodule

@ -0,0 +1 @@
Subproject commit dc2f9971d1f60aa357a758a014b79dd2f31345a5

1
Vendor/wxwidgets vendored Submodule

@ -0,0 +1 @@
Subproject commit f81e0ed2cbccf2d9ffba4a93b5948f4cf46111d7

1
Vendor/zlib vendored Submodule

@ -0,0 +1 @@
Subproject commit cacf7f1d4e3d44d871b605da3b647f07d718623f

1
Vendor/zstd vendored Submodule

@ -0,0 +1 @@
Subproject commit db5a7cf8ed516f1b454e2ae121f0271d55f5beb8