Updates to docs and scripts

This commit is contained in:
2024-12-10 16:38:01 -05:00
parent 2c51a2f9c8
commit 8e3e66b3c1
6 changed files with 86 additions and 171 deletions

View File

@@ -3,36 +3,15 @@
# That or just rewrite it in an sh script and call it a day.
$devshell = Join-Path $PSScriptRoot 'helpers/devshell.ps1'
$format_cpp = Join-Path $PSScriptRoot 'helpers/format_cpp.psm1'
$misc = Join-Path $PSScriptRoot 'helpers/misc.psm1'
$refactor_c_library = Join-Path $PSScriptRoot 'refactor_c_library.ps1'
$refactor_unreal = Join-Path $PSScriptRoot 'refactor_unreal.ps1'
$incremental_checks = Join-Path $PSScriptRoot 'helpers/incremental_checks.ps1'
$vendor_toolchain = Join-Path $PSScriptRoot 'helpers/vendor_toolchain.ps1'
function Get-ScriptRepoRoot {
$currentPath = $PSScriptRoot
while ($currentPath -ne $null -and $currentPath -ne "")
{
if (Test-Path (Join-Path $currentPath ".git")) {
return $currentPath
}
# Also check for .git file which indicates a submodule
$gitFile = Join-Path $currentPath ".git"
if (Test-Path $gitFile -PathType Leaf)
{
$gitContent = Get-Content $gitFile
if ($gitContent -match "gitdir: (.+)") {
return $currentPath
}
}
$currentPath = Split-Path $currentPath -Parent
}
throw "Unable to find repository root"
}
$path_root = Get-ScriptRepoRoot
Import-Module $misc
# Import-Module $target_arch
Import-Module $format_cpp
$path_root = Get-ScriptRepoRoot
Push-Location $path_root

View File

@@ -1,62 +1,42 @@
$path_root = git rev-parse --show-toplevel
$path_project = Join-Path $path_root project
$path_project_build = Join-Path $path_project build
$path_project_gen = Join-Path $path_project gen
$path_singleheader = Join-Path $path_root singleheader
$path_base = Join-Path $path_root base
$path_base_build = Join-Path $path_base build
$path_singleheader = Join-Path $path_root singleheader
$path_singleheader_build = Join-Path $path_singleheader build
$path_singleheader_gen = Join-Path $path_singleheader gen
$path_test = Join-Path $path_root test
$path_test_build = Join-Path $path_test build
$path_test_gen = Join-Path $path_test gen
$path_x64 = Join-Path $path_root x64
$path_release = Join-Path $path_root release
$path_unreal = Join-Path $paht_root unreal
$path_unreal_build = Join-Path $path_unreal build
$path_unreal_gen = Join-Path $path_unreal gen
$path_test = Join-Path $path_root test
$path_test_build = Join-Path $path_test build
$path_test_gen = Join-Path $path_test gen
$path_x64 = Join-Path $path_root x64
$path_release = Join-Path $path_root release
if ( Test-Path $path_project_build)
{
if ( Test-Path $path_project_build) {
Remove-Item $path_project_build -Recurse
}
if ( Test-Path $path_project_gen )
{
if ( Test-Path $path_project_gen ) {
Remove-Item $path_project_gen -Recurse
}
if ( Test-Path $path_singleheader_build)
{
if ( Test-Path $path_singleheader_build) {
Remove-Item $path_singleheader_build -Recurse
}
if ( Test-Path $path_singleheader_gen )
{
if ( Test-Path $path_singleheader_gen ) {
Remove-Item $path_singleheader_gen -Recurse
}
if ( Test-Path $path_test_build )
{
if ( Test-Path $path_unreal ) {
Remove-Item $path_unreal_build -Recurse
}
if ( Test-Path $path_test_build ) {
Remove-Item $path_test_build -Recurse
}
if ( Test-Path $path_test_gen )
{
if ( Test-Path $path_test_gen ) {
Remove-Item $path_test_gen -Recurse
}
if ( Test-Path $path_x64)
{
if ( Test-Path $path_x64) {
Remove-Item $path_x64 -Recurse
}
if ( Test-Path $path_release )
{
if ( Test-Path $path_release ) {
Remove-Item $path_release -Recurse
}
$include = '*.h', '*.hpp', '*.cpp'
$exclude =
$files = Get-ChildItem -Recurse -Path $path_gen -Include $include -Exclude $exclude
if ( $files )
{
Remove-Item $files
}

20
scripts/helpers/misc.psm1 Normal file
View File

@@ -0,0 +1,20 @@
function Get-ScriptRepoRoot {
$currentPath = $PSScriptRoot
while ($currentPath -ne $null -and $currentPath -ne "")
{
if (Test-Path (Join-Path $currentPath ".git")) {
return $currentPath
}
# Also check for .git file which indicates a submodule
$gitFile = Join-Path $currentPath ".git"
if (Test-Path $gitFile -PathType Leaf)
{
$gitContent = Get-Content $gitFile
if ($gitContent -match "gitdir: (.+)") {
return $currentPath
}
}
$currentPath = Split-Path $currentPath -Parent
}
throw "Unable to find repository root"
}