first
This commit is contained in:
91
ra-tool.ps1
Normal file
91
ra-tool.ps1
Normal file
@@ -0,0 +1,91 @@
|
||||
param(
|
||||
# Parameter help description
|
||||
[switch]
|
||||
$buildproject,
|
||||
[switch]
|
||||
$cookproject,
|
||||
[switch]
|
||||
$updateproject,
|
||||
[switch]
|
||||
$updatecode,
|
||||
[switch]
|
||||
$genproject,
|
||||
[switch]
|
||||
$cleancode
|
||||
)
|
||||
|
||||
$enginedir = "C:\epic\UE_5.6"
|
||||
$builddir = ".\build"
|
||||
if(!(Test-Path -Path $builddir)){
|
||||
New-Item $builddir -ItemType "directory" -Force
|
||||
}
|
||||
$builddir = Resolve-Path $builddir
|
||||
# $defaultmap = "0_TTG_Legacy.umap"
|
||||
$projectfile = Get-ChildItem . -Filter "*.uproject"
|
||||
$projectfilepath = Resolve-Path $projectfile
|
||||
$projectname = (Get-Item $projectfilepath ).Basename
|
||||
|
||||
$f7z = "$env:ProgramFiles\7-Zip\7z.exe"
|
||||
if(-not (Test-Path $f7z)){
|
||||
throw "7z not found $f7z"
|
||||
return
|
||||
}
|
||||
Set-Alias 7zip $f7z
|
||||
|
||||
|
||||
function GenProj (){
|
||||
Invoke-Expression "$enginedir\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.exe -projectfiles -project=$projectfilepath -game -rocket -progress -engine -VSCode"
|
||||
}
|
||||
function BuildProj() {
|
||||
|
||||
Invoke-Expression "$enginedir\Engine\Binaries\Win64\UnrealEditor-Cmd.exe $projectfilepath -run=cook -targetplatform=Windows -iterate -CookAll"
|
||||
Invoke-Expression "$enginedir\Engine\Binaries\DotNET\AutomationTool\AutomationTool.exe -ScriptsForProject=$projectfilepath BuildCookRun -project=$projectfilepath -noP4 -clientconfig=Shipping -serverconfig=Shipping -nocompile -nocompileeditor -installed -ue4exe=$enginedir\Engine\Binaries\Win64\UnrealEditor-Cmd.exe -utf8output -platform=Win64 -build -skipcook -compressed -stage -deploy -stagingdirectory=$builddir"
|
||||
}
|
||||
function CookProj() {
|
||||
Invoke-Expression "$enginedir\Engine\Binaries\Win64\UnrealEditor-Cmd.exe $projectfilepath -run=cook -targetplatform=Windows -iterate -CookAll"
|
||||
}
|
||||
function UpdateProj() {
|
||||
|
||||
Invoke-Expression "$enginedir\Engine\Binaries\Win64\UnrealEditor-Cmd.exe $projectfilepath -run=cook -targetplatform=Windows -iterate -CookAll"
|
||||
Robocopy.exe .\Saved\Cooked $builddir /XO /S
|
||||
}
|
||||
function ConvertMapToWorldPartition {
|
||||
param (
|
||||
[string]
|
||||
$map
|
||||
)
|
||||
Invoke-Expression "$enginedir\Engine\Binaries\Win64\UnrealEditor.exe $projectfilepath -run=WorldPartitionConvertCommandlet $map -AllowCommandletRendering"
|
||||
}
|
||||
function UpdateCodeOnlyProj() {
|
||||
Robocopy.exe .\Binaries\Win64 "$builddir\Binaries\Win64" /XO /S "$projectname*.exe"
|
||||
}
|
||||
function CleanCode() {
|
||||
$ls = Get-ChildItem .\Plugins
|
||||
foreach ($item in $ls) {
|
||||
Remove-Item ".\Plugins\$item\Intermediate" -Recurse
|
||||
Remove-Item ".\Plugins\$item\Binaries\Win64" -Recurse
|
||||
}
|
||||
}
|
||||
|
||||
function ZipBuild(){
|
||||
7zip a -r ".\zip\$projectname.7z" "$builddir\*" -mx=9 -v2000m
|
||||
}
|
||||
if($buildproject){
|
||||
BuildProj
|
||||
}
|
||||
if($updateproject){
|
||||
UpdateProj
|
||||
}
|
||||
if($updatecode){
|
||||
UpdateCodeOnlyProj
|
||||
}
|
||||
if($cleancode){
|
||||
CleanCode
|
||||
}
|
||||
if($cookproject){
|
||||
CookProj
|
||||
}
|
||||
|
||||
if($genproject){
|
||||
GenProj
|
||||
}
|
||||
Reference in New Issue
Block a user