mirror of
https://github.com/Ed94/gencpp.git
synced 2025-06-14 18:51:47 -07:00
inital implemention of UE library variant generator completed
This commit is contained in:
@ -6,6 +6,7 @@ Import-Module ./helpers/target_arch.psm1
|
||||
$target_arch = Join-Path $PSScriptRoot 'helpers/target_arch.psm1'
|
||||
$devshell = Join-Path $PSScriptRoot 'helpers/devshell.ps1'
|
||||
$format_cpp = Join-Path $PSScriptRoot 'helpers/format_cpp.psm1'
|
||||
$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'
|
||||
|
||||
@ -201,6 +202,8 @@ if ( $unreal )
|
||||
write-host "`n Unreal variant generator completed in $($time_taken.TotalMilliseconds) ms"
|
||||
}
|
||||
Pop-Location
|
||||
|
||||
. $refactor_unreal
|
||||
}
|
||||
|
||||
if ( $test )
|
||||
|
@ -3,20 +3,22 @@ cls
|
||||
$build = Join-Path $PSScriptRoot 'build.ci.ps1'
|
||||
|
||||
if ( $IsWindows ) {
|
||||
& $build release msvc bootstrap singleheader
|
||||
& $build release msvc bootstrap singleheader unreal
|
||||
}
|
||||
else {
|
||||
& $build release clang bootstrap singleheader
|
||||
& $build release clang bootstrap singleheader unreal
|
||||
}
|
||||
|
||||
$path_root = git rev-parse --show-toplevel
|
||||
$path_docs = Join-Path $path_root docs
|
||||
$path_project = Join-Path $path_root project
|
||||
$path_project_gen = Join-Path $path_project gen
|
||||
$path_singleheader = Join-Path $path_root singleheader
|
||||
$path_docs = Join-Path $path_root docs
|
||||
$path_project = Join-Path $path_root project
|
||||
$path_project_gen = Join-Path $path_project gen
|
||||
$path_singleheader = Join-Path $path_root singleheader
|
||||
$path_singleheader_gen = Join-Path $path_singleheader gen
|
||||
$path_release = Join-Path $path_root release
|
||||
$path_release_content = Join-Path $path_release content
|
||||
$path_unreal = Join-Path $path_root unreal_engine
|
||||
$path_unreal_gen = Join-Path $path_unreal gen
|
||||
$path_release = Join-Path $path_root release
|
||||
$path_release_content = Join-Path $path_release content
|
||||
|
||||
if ( -not(Test-Path $path_release) ) {
|
||||
New-Item -ItemType Directory -Path $path_release
|
||||
@ -50,5 +52,17 @@ Remove-Item -Path $path_release_content\gen.hpp
|
||||
# Segmented
|
||||
Copy-Item -Path $path_project_gen\* -Destination $path_release_content
|
||||
Compress-Archive -Path $path_release_content\* -DestinationPath $path_release\gencpp_segmented.zip -Force
|
||||
Remove-Item -Path $path_release_content\gen.dep.hpp
|
||||
Remove-Item -Path $path_release_content\gen.dep.cpp
|
||||
Remove-Item -Path $path_release_content\gen.hpp
|
||||
Remove-Item -Path $path_release_content\gen.cpp
|
||||
Remove-Item -Path $path_release_content\gen.builder.hpp
|
||||
Remove-Item -Path $path_release_content\gen.builder.cpp
|
||||
Remove-Item -Path $path_release_content\gen.scanner.hpp
|
||||
Remove-Item -Path $path_release_content\gen.scanner.cpp
|
||||
|
||||
# Unreal
|
||||
Copy-Item -Path $path_unreal_gen\* -Destination $path_release_content
|
||||
Compress-Archive -Path $path_release_content\* -DestinationPath $path_release\gencpp_unreal.zip -Force
|
||||
|
||||
Remove-Item -Path $path_release_content -Recurse
|
||||
|
56
scripts/refactor_unreal.ps1
Normal file
56
scripts/refactor_unreal.ps1
Normal file
@ -0,0 +1,56 @@
|
||||
[string] $format = $false
|
||||
|
||||
foreach ( $arg in $args )
|
||||
{
|
||||
if ( $arg -eq "format" )
|
||||
{
|
||||
$format = $true
|
||||
}
|
||||
}
|
||||
|
||||
[string[]] $include = 'gen.*.hpp', 'gen.*.cpp', 'gen.hpp', 'gen.cpp'
|
||||
[string[]] $exclude
|
||||
|
||||
$path_root = git rev-parse --show-toplevel
|
||||
$path_project = Join-Path $path_root project
|
||||
$path_scripts = Join-Path $path_root scripts
|
||||
$path_singlheader = Join-Path $path_root singleheader
|
||||
$path_singleheader_comp = Join-Path $path_singlheader components
|
||||
$path_unreal = Join-Path $path_root unreal_engine
|
||||
$path_unreal_gen = Join-Path $path_unreal gen
|
||||
|
||||
$file_spec = Join-Path $path_scripts unreal.refactor
|
||||
|
||||
# Gather the files to be formatted.
|
||||
$targetFiles = @()
|
||||
$targetFiles += Get-ChildItem -Recurse -Path $path_unreal_gen -Include $include -Exclude $exclude | Select-Object -ExpandProperty FullName
|
||||
# $targetFiles += Get-ChildItem -Recurse -Path $path_project -Include $include -Exclude $exclude | Select-Object -ExpandProperty FullName
|
||||
# $targetFiles += Get-ChildItem -Recurse -Path $path_singleheader_comp -Include $include -Exclude $exclude | Select-Object -ExpandProperty FullName
|
||||
|
||||
# Format the files.
|
||||
$formatParams = @(
|
||||
'-i' # In-place
|
||||
'-style=file:./.clang-format' # Search for a .clang-format file in the parent directory of the source file.
|
||||
'-verbose'
|
||||
)
|
||||
|
||||
write-host "Beginning refactor...`n"
|
||||
|
||||
$refactorParams = @(
|
||||
# "-debug",
|
||||
"-num=$($targetFiles.Count)"
|
||||
"-src=$($targetFiles)",
|
||||
"-spec=$($file_spec)"
|
||||
)
|
||||
|
||||
& refactor $refactorParams
|
||||
|
||||
Write-Host "`nRefactoring complete`n`n"
|
||||
|
||||
if ( $format -eq $true ) {
|
||||
Write-Host "Beginning format...`n"
|
||||
|
||||
& clang-format $formatParams $targetFiles
|
||||
|
||||
Write-Host "`nFormatting complete"
|
||||
}
|
Reference in New Issue
Block a user