Skip to content

Commit

Permalink
Devtools: Fixup formatter dev cmd, add stackypm cmd.
Browse files Browse the repository at this point in the history
  • Loading branch information
furby-tm committed Aug 5, 2024
1 parent b0988fd commit 78332f1
Showing 1 changed file with 40 additions and 21 deletions.
61 changes: 40 additions & 21 deletions build_files/build_environment/KrakenDeveloperProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,11 @@ function MakeMetaversalBoostFramework
# ever really be done by @furby-tm on
# macOS, internal stuff for the sake
# of convenience.
function CopyMTXHeaders
function CopyHeaders
{
if ($IsMacOS) {
$sourceDir = "/Users/$env:USER/Wabi/MetaverseKit/Sources/MaterialX/source"
$targetDir = "/Users/$env:USER/Wabi/MetaverseKit/Sources/MaterialX/include/"
$sourceDir = $Args[0]
$targetDir = $Args[1]
# -----------------------------------
Push-Location $sourceDir

Expand Down Expand Up @@ -369,24 +369,6 @@ function CopyMTXHeaders
Remove-Item $_.FullName
}

# FOR REMOVING THE (*.H) HEADERS FROM THE SOURCE DIRECTORY
Get-ChildItem $sourceDir -filter "*.h" -recurse | `
foreach {
Remove-Item $_.FullName
}

# FOR REMOVING THE (*.HPP) HEADERS FROM THE SOURCE DIRECTORY
Get-ChildItem $sourceDir -filter "*.hpp" -recurse | `
foreach {
Remove-Item $_.FullName
}

# FOR REMOVING THE (*.INL) HEADERS FROM THE SOURCE DIRECTORY
Get-ChildItem $sourceDir -filter "*.inl" -recurse | `
foreach {
Remove-Item $_.FullName
}

Pop-Location
# -----------------------------------
} else {
Expand Down Expand Up @@ -519,6 +501,21 @@ function DeployWabiWeb
}
}

function ClangFormatAll
{
# clang-format (*.cpp) (*.h) (*.json)
Get-ChildItem -Path . -Recurse | Where-Object {
$_ -match '(\.cpp)|(\.cc)|(\.c)|(\.hpp)|(\.h)'
} | ForEach-Object {
$relativePath = Get-Item $_.FullName | Resolve-Path -Relative
Write-Color -Text "Formatting", ": ", "$relativePath" -Color Yellow, DarkGray, Cyan
& clang-format -i -verbose -style=file $relativePath 2>&1>$null
}
}

Set-Alias clangformat ClangFormatAll


function WabiFormatAll
{
if ((Test-Path -Path $IsKrakenCreatorInDirectory) -and (Test-Path -Path $IsKrakenSourceInDirectory)) {
Expand Down Expand Up @@ -955,6 +952,28 @@ if($KrakenGlobalView) {
Pop-Location
}

# stackys fork of swiftpm.
# this fork allows swiftpm targets to depend on products:
# https://github.com/stackotter/swift-package-manager/tree/same_package_product_dependencies
function StackotterPM {
$ArgRest = ($Args).Where({$_ -ne 'build' -and $_ -ne 'run' -and $_ -ne 'test' -and $_ -ne 'package'})

if(($Args[0] -eq 'build')) {
& /Users/furby/Wabi/swift-package-manager/.build/arm64-apple-macosx/release/swift-build $ArgRest
} elseif(($Args[0] -eq 'run')) {
& /Users/furby/Wabi/swift-package-manager/.build/arm64-apple-macosx/release/swift-run $ArgRest
} elseif(($Args[0] -eq 'test')) {
& /Users/furby/Wabi/swift-package-manager/.build/arm64-apple-macosx/release/swift-test $ArgRest
} elseif(($Args[0] -eq 'package')) {
& /Users/furby/Wabi/swift-package-manager/.build/arm64-apple-macosx/release/swift-package $ArgRest
} else {
Write-Color -Text "stackypm: available options are (", "build ", "run ", "test ", "or ", "package", ")" -Color Blue, Yellow, Yellow, Yellow, Blue, Yellow, Blue
}
}

# Run stackys fork of swiftpm.
Set-Alias stackypm StackotterPM

# Hop Into Kraken Root
Set-Alias krkn HopIntoRootDir

Expand Down

0 comments on commit 78332f1

Please sign in to comment.