gencpp/scripts/build.ci.ps1
Ed_ 352da126ca Nativs support for gen::AST, fixes & update to library, getting gen_array working...
token_fmt returns StrC now. Did some fixes so it can properly function now!

Lots of changes to the Array non-parsed implementation.
It shows no errors in the edtitor static analysis, however I haven't tried it yet.
Unfortunately have some friction with how I would like to set it up like with everything in C++...
Can't inherit from ArrayBase to provide the common members to all Array defs, without introducing constructor complexity.

I may be open to using constructors in the future, depends on how I feel when trying out the context pattern used in jai and odin...
2023-06-30 03:13:41 -04:00

105 lines
2.0 KiB
PowerShell

[string] $type = $null
[string] $test = $false
foreach ( $arg in $args )
{
if ( $arg -eq "test" )
{
$test = $true
}
else
{
$type = $arg
}
}
$path_root = git rev-parse --show-toplevel
$path_build = Join-Path $path_root build
$path_scripts = Join-Path $path_root scripts
# if ( $test -eq $true )
# {
#region Test Build
write-host "`n`nBuilding Test`n"
$path_test = Join-Path $path_root test
$path_gen = Join-Path $path_test gen
$path_test_build = Join-Path $path_test build
$path_gen_build = Join-Path $path_gen build
# Generate files using metaprogram.
if ( -not( Test-Path $path_gen_build ) )
{
$args_meson = @()
$args_meson += "setup"
$args_meson += $path_gen_build
Push-Location $path_gen
& meson $args_meson
Pop-Location
}
$args_ninja = @()
$args_ninja += "-C"
$args_ninja += $path_gen_build
Push-Location $path_root
& ninja $args_ninja
Pop-Location
if ($true) {
$gencpp = Join-Path $path_gen_build gencpp.exe
Push-location $path_gen
Write-Host `nGenerating files...
& $gencpp
Write-Host `nBeginning format...
$formatParams = @(
'-i' # In-place
'-style=file' # Search for a .clang-format file in the parent directory of the source file.
'-verbose'
)
$include = @('*.gen.hpp', '*.gen.cpp')
$exclude = $null
$targetFiles = @(Get-ChildItem -Recurse -Path $path_gen -Include $include -Exclude $exclude | Select-Object -ExpandProperty FullName)
clang-format $formatParams $targetFiles
Write-Host "`nFormatting complete"
Pop-Location
}
# Build the program depending on generated files.
# if ( -not( Test-Path $path_test_build ) )k
# {
# $args_meson = @()
# $args_meson += "setup"
# $args_meson += $path_test_build
# Push-Location $path_test
# & meson $args_meson
# Pop-Location
# }
# $args_ninja = @()
# $args_ninja += "-C"
# $args_ninja += $path_test_build
# Push-Location $path_root
# ninja $args_ninja
# Pop-Location
# $testcpp = Join-Path $path_test_build testcpp.exe
# Push-Location $path_test
# & $testcpp
# Pop-Location
# endregion Test Build
# }