Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions ci/setup-and-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ param(
[string] $deployment_launch_configuration = "one_worker_test.json",
[string] $deployment_snapshot_path = "snapshots/FPS-Start_Small.snapshot",
[string] $deployment_cluster_region = "eu",
[string] $project_name = "unreal_gdk"
[string] $project_name = "unreal_gdk",
[string] $build_home = (Get-Item "$($PSScriptRoot)").parent.parent.FullName, ## The root of the entire build. Should ultimately resolve to "C:\b\<number>\".
[string] $unreal_engine_symlink_dir = "$build_home\UnrealEngine"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to make sure to clean up the symlink before / after each build?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, we're just changing the symlink location, it's previous functionality was sufficient.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but now the symlink is outside of the folder that gets checked out and cleaned before each build. so that symlink won't get cleaned up, plus the GDK uses the same symlink location (we do clean it up there before each build btw)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a valid point, because the creation of the symlink will probably fail on a new build, since one could be present already. We can do a quick fix by just deleting the symlink before creating it (if it exists).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did this get addressed?

Copy link
Contributor

@mironec mironec Apr 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, spoke offline/online, we delete the symlink before linking again, so should be fine

)

. "$PSScriptRoot\common.ps1"
Expand Down Expand Up @@ -50,19 +52,18 @@ pushd "$exampleproject_home"
# Use the cached engine version or set it up if it has not been cached yet.
Start-Event "set-up-engine" "build-unreal-gdk-example-project-:windows:"

$engine_directory = "${exampleproject_home}\UnrealEngine"
&"$($gdk_home)\ci\get-engine.ps1" -unreal_path "$engine_directory"
&"$($gdk_home)\ci\get-engine.ps1" -unreal_path "$unreal_engine_symlink_dir"

Finish-Event "set-up-engine" "build-unreal-gdk-example-project-:windows:"

Start-Event "associate-uproject-with-engine" "build-unreal-gdk-example-project-:windows:"
pushd $engine_directory
pushd $unreal_engine_symlink_dir
$unreal_version_selector_path = "Engine\Binaries\Win64\UnrealVersionSelector.exe"

$find_engine_process = Start-Process -Wait -PassThru -NoNewWindow -FilePath $unreal_version_selector_path -ArgumentList @(`
"-switchversionsilent", `
"${exampleproject_home}\Game\GDKShooter.uproject", `
"$engine_directory"
"$unreal_engine_symlink_dir"
)

if ($find_engine_process.ExitCode -ne 0) {
Expand Down Expand Up @@ -97,7 +98,7 @@ pushd "$exampleproject_home"

# Invoke the GDK commandlet to generate schema and snapshot. Note: this needs to be run prior to cooking
Start-Event "generate-schema" "build-unreal-gdk-example-project-:windows:"
pushd "UnrealEngine/Engine/Binaries/Win64"
pushd "${unreal_engine_symlink_dir}/Engine/Binaries/Win64"
$schema_gen_proc = Start-Process -PassThru -NoNewWindow -FilePath ((Convert-Path .) + "\UE4Editor.exe") -ArgumentList @(`
"$($exampleproject_home)/Game/GDKShooter.uproject", `
"-run=GenerateSchemaAndSnapshots", `
Expand Down Expand Up @@ -144,7 +145,7 @@ pushd "$exampleproject_home"
Finish-Event "build-linux-worker" "build-unreal-gdk-example-project-:windows:"

Start-Event "build-android-client" "build-unreal-gdk-example-project-:windows:"
$unreal_uat_path = "${exampleproject_home}\UnrealEngine\Engine\Build\BatchFiles\RunUAT.bat"
$unreal_uat_path = "${unreal_engine_symlink_dir}\Engine\Build\BatchFiles\RunUAT.bat"
$build_server_proc = Start-Process -PassThru -NoNewWindow -FilePath $unreal_uat_path -ArgumentList @(`
"-ScriptsForProject=$($exampleproject_home)/Game/GDKShooter.uproject", `
"BuildCookRun", `
Expand All @@ -157,7 +158,7 @@ pushd "$exampleproject_home"
"-archivedirectory=$($exampleproject_home)/cooked-android", `
"-package", `
"-clientconfig=Development", `
"-ue4exe=$($exampleproject_home)/UnrealEngine/Engine/Binaries/Win64/UE4Editor-Cmd.exe", `
"-ue4exe=$($unreal_engine_symlink_dir)/Engine/Binaries/Win64/UE4Editor-Cmd.exe", `
"-pak", `
"-prereqs", `
"-nodebuginfo", `
Expand Down