Skip to content

Commit

Permalink
update windows pwsh build
Browse files Browse the repository at this point in the history
  • Loading branch information
admercs committed Feb 29, 2024
1 parent 00057a4 commit 008d3a6
Show file tree
Hide file tree
Showing 17 changed files with 80 additions and 64 deletions.
10 changes: 5 additions & 5 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ Import-Module "${ProjectDir}\scripts\mod_docs.psm1" # imports: Build-Do
# Static variables
$PROJECT_DIR = "$ProjectDir"
$SCRIPT_DIR = "${ProjectDir}\scripts"

# Command-line interface (CLI) arguments
$BUILD_MODE = "$BuildMode"
$CMAKE_GENERATOR = "$CmakeGenerator"
$DEBUG_MODE = if ( $SystemDebug.IsPresent ) { $true } else { $false }
$UNREAL_ENV_DIR = if ($PSBoundParameters.ContainsKey('UnrealEnvDir')) {
"$UnrealEnvDir"
} else {
"${PROJECT_DIR}\UnrealPlugin\Unreal\Environments"
}

# Command-line arguments
$BUILD_MODE = "$BuildMode"
$CMAKE_GENERATOR = "$CmakeGenerator"
$DEBUG_MODE = if ( $SystemDebug.IsPresent ) { $true } else { $false }
$UNREAL_ASSET = if ( $UnrealAsset.IsPresent ) { $true } else { $false }
$BUILD_DOCS = if ( $BuildDocs.IsPresent ) { $true } else { $false }
$AUTOMATE_MODE = if ( $Automate.IsPresent ) { $true } else { $false }
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_docs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ NOTES:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Imports
Expand Down
4 changes: 2 additions & 2 deletions scripts/clean.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ NOTES:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Imports
Expand Down
4 changes: 2 additions & 2 deletions scripts/clean_rebuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ NOTES:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Imports
Expand Down
4 changes: 2 additions & 2 deletions scripts/format_cpp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ USAGE:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Imports
Expand Down
4 changes: 2 additions & 2 deletions scripts/format_powershell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ USAGE:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Imports
Expand Down
4 changes: 2 additions & 2 deletions scripts/git_commit_all.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ NOTES:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Command-line interface (CLI) arguments
Expand Down
8 changes: 2 additions & 6 deletions scripts/mod_cmake.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@ NOTES:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Imports
###

# Utilities
# imports: Add-Directories, Remove-ItemSilent, Remove-TempDirectories, Invoke-Fail,
# Test-WorkingDirectory, Test-VariableDefined, Get-EnvVariables, Get-ProgramVersion,
# Get-VersionMajorMinor, Get-VersionMajorMinorBuild, Get-WindowsInfo, Get-WindowsVersion,
# Get-Architecture, Get-ArchitectureWidth, Set-ProcessorCount
Import-Module "${SCRIPT_DIR}\mod_utils.psm1"

###
Expand Down
12 changes: 6 additions & 6 deletions scripts/mod_docs.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ NOTES:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Imports
###

# Utilities
# imports: Add-Directories, Remove-ItemSilent, Remove-TempDirectories, Invoke-Fail,
# Test-WorkingDirectory, Test-VariableDefined, Get-EnvVariables, Get-ProgramVersion,
# Get-VersionMajorMinor, Get-VersionMajorMinorBuild, Get-WindowsInfo, Get-WindowsVersion,
# Get-Architecture, Get-ArchitectureWidth, Set-ProcessorCount
Import-Module "${SCRIPT_DIR}\mod_utils.psm1"

###
Expand Down
8 changes: 2 additions & 6 deletions scripts/mod_eigen.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@ NOTES:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Imports
###

# Utilities
# imports: Add-Directories, Remove-ItemSilent, Remove-TempDirectories, Invoke-Fail,
# Test-WorkingDirectory, Test-VariableDefined, Get-EnvVariables, Get-ProgramVersion,
# Get-VersionMajorMinor, Get-VersionMajorMinorBuild, Get-WindowsInfo, Get-WindowsVersion,
# Get-Architecture, Get-ArchitectureWidth, Set-ProcessorCount
Import-Module "${SCRIPT_DIR}\mod_utils.psm1"

###
Expand Down
10 changes: 7 additions & 3 deletions scripts/mod_format.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ NOTES:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Variables
### Imports
###

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
###
### Variables
###

# Specify PowerShell script directories to avoid scanning the entire repository.
$PS_DIR_PATHS = @("$SCRIPT_DIR")
Expand Down
8 changes: 2 additions & 6 deletions scripts/mod_rpclib.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@ NOTES:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Imports
###

# Utilities
# imports: Add-Directories, Remove-TempDirectories, Invoke-Fail, Test-Program, Test-WorkingDirectory,
# Test-VariableDefined, Get-EnvVariables, Test-Program, Get-ProgramVersion, Get-VersionMajorMinor,
# Get-VersionMajorMinorBuild, Get-WindowsInfo, Get-WindowsVersion, Get-Architecture,
# Get-ArchitectureWidth, Set-ProcessorCount
Import-Module "${SCRIPT_DIR}\mod_utils.psm1"

###
Expand Down
9 changes: 2 additions & 7 deletions scripts/mod_unreal.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,17 @@ NOTES:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Imports
###

# Utilities
# imports: Add-Directories, Remove-TempDirectories, Invoke-Fail, Test-WorkingDirectory, Test-Program,
# Test-VariableDefined, Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor,
# Get-VersionMajorMinorBuild, Get-WindowsInfo, Get-WindowsVersion, Get-Architecture,
# Get-ArchitectureWidth, Set-ProcessorCount
Import-Module "${SCRIPT_DIR}\mod_utils.psm1"

# Unreal Environments
# imports: Get-UnrealVersion, Copy-UnrealEnvItems, Restore-UnrealEnv, Invoke-UnrealVsProjectFileGenerator
Import-Module "${SCRIPT_DIR}\mod_unreal_env.psm1"

###
Expand Down
5 changes: 3 additions & 2 deletions scripts/mod_unreal_env.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ USAGE:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Imports
###

# Utilities
Import-Module "${SCRIPT_DIR}\mod_utils.psm1"

###
Expand Down
8 changes: 6 additions & 2 deletions scripts/mod_utils.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ NOTES:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Imports
###

###
### Functions
Expand Down
8 changes: 2 additions & 6 deletions scripts/mod_visualstudio.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@ NOTES:
Copyright © 2024 Nervosys, LLC
#>

[String]$PROJECT_DIR = (Split-Path -Parent -Path (Split-Path -Parent -Path "$PSScriptRoot"))
[String]$SCRIPT_DIR = (Split-Path -Parent -Path "$PSScriptRoot")
[String]$PROJECT_DIR = "$PWD"
[String]$SCRIPT_DIR = "${PWD}\scripts"

###
### Imports
###

# Utilities
# imports: Add-Directories, Remove-TempDirectories, Invoke-Fail, Test-WorkingDirectory, Test-Program,
# Test-VariableDefined, Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor,
# Get-VersionMajorMinorBuild, Get-WindowsInfo, Get-WindowsVersion, Get-Architecture,
# Get-ArchitectureWidth, Set-ProcessorCount
Import-Module "${SCRIPT_DIR}\mod_utils.psm1"

###
Expand Down
34 changes: 31 additions & 3 deletions scripts/rename_recursive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,37 @@ NOTES:
Copyright © 2024 Nervosys, LLC
#>

$OLD = '.bat'
$NEW = '.cmd'
# Static variables
$PROJECT_DIR = "$PWD"
$SCRIPT_DIR = "${PWD}\scripts"

Get-ChildItem -File -Recurse | ForEach-Object { Rename-Item -Path $_.PSPath -NewName $_.Name.replace($OLD, $NEW) }
###
### Functions
###

function Rename-FileExtensions {
[OutputType()]
param(
[Parameter()]
[String]
$Path = "$PROJECT_DIR",
[Parameter()]
[String]
$Old = '.bat',
[Parameter()]
[String]
$New = '.cmd'
)
Get-ChildItem -File -Recurse | ForEach-Object {
Rename-Item -Path "$Path" -NewName $_.Name.replace("$Old", "$New")
}
return $null
}

###
### Main
###

Rename-FileExtensions -Old '.bat' -New '.cmd'

exit 0

0 comments on commit 008d3a6

Please sign in to comment.