wip win modular headers

This commit is contained in:
Edward R. Gonzalez 2023-09-08 17:57:17 -04:00
parent 4bfa010927
commit 5cd01af384

View File

@ -1,44 +1,41 @@
clear-host clear-host
$path_root = git rev-parse --show-toplevel $path_root = & git rev-parse --show-toplevel
$path_project = join-path $path_root "project" $path_project = Join-Path $path_root "project"
$path_dependencies = join-path $path_project "dependencies" $path_dependencies = Join-Path $path_project "dependencies"
$path_temp = join-path $path_dependencies "temp" $path_temp = Join-Path $path_dependencies "temp"
$path_platform_windows = Join-Path $path_project "windows"
# Define the URL of the zip file and the destination directory # Define the URL of the zip file and the destination directory
$url = "https://github.com/Ed94/gencpp/releases/download/latest/gencpp_singleheader.zip" $url = "https://github.com/Ed94/gencpp/releases/download/latest/gencpp_singleheader.zip"
$destinationZip = join-path $path_temp "gencpp_singleheader.zip" $destinationZip = Join-Path $path_temp "gencpp_singleheader.zip"
if ( (Test-Path $path_dependencies) -eq $false ) { # Create directories if they don't exist
if (-not (Test-Path $path_dependencies)) {
New-Item -ItemType Directory -Path $path_dependencies New-Item -ItemType Directory -Path $path_dependencies
} }
if ( (Test-Path $path_temp) -eq $false ) { if (-not (Test-Path $path_temp)) {
New-Item -ItemType Directory -Path $path_temp New-Item -ItemType Directory -Path $path_temp
} }
# Download the zip file #pragma region gencpp
Invoke-WebRequest -Uri $url -OutFile $destinationZip Invoke-WebRequest -Uri $url -OutFile $destinationZip
Expand-Archive -Path $destinationZip -DestinationPath $path_temp
Move-Item -Path (Join-Path $path_temp "gen.hpp") -Destination $path_dependencies -Force
#pragma endregion gencpp
# Extract the zip file to the specified directory #pragma region windows modular headers
Expand-Archive -Path $destinationZip -DestinationPath $path_temp
# Move gen.hpp to the project directory
Move-Item -Path (join-path $path_temp "gen.hpp") -Destination $path_dependencies -Force
# if ( Test-Path $path_platform_windows )
# {
# Remove-Item (Get-ChildItem -Path $path_platform_windows -Recurse -Force)
# }
Push-Location $path_temp Push-Location $path_temp
$path_repo_content = 'include/win32/' & git clone --no-checkout https://github.com/Leandros/WindowsHModular.git
& git clone --no-checkout https://github.com/Leandros/WindowsHModular.git Push-Location WindowsHModular
& git sparse-checkout init --cone & git sparse-checkout init --cone
& git sparse-checkout set $path_repo_content & git sparse-checkout set include/win32
Pop-Location
Copy-Item -Recurse ( './' + $path_repo_content + '*') $path_platform_windows # Copy the win32 directory contents to the project/windows directory
Pop-Location $path_temp Copy-Item -Recurse .\WindowsHModular\include\win32\* $path_platform_windows
Pop-Location
#pragma endregion windows modular headers
Remove-Item $path_temp -Recurse Remove-Item $path_temp -Recurse -Force