From cbf47ca21deb588806d8d1e10e9bf09f8523aebf Mon Sep 17 00:00:00 2001 From: Ed_ Date: Tue, 19 Mar 2024 16:57:28 -0400 Subject: [PATCH] Build scripts further improved Now depedency checking is working as intended --- scripts/build.ps1 | 15 +++++++-------- scripts/update_deps.ps1 | 11 ++++++++--- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 27101a5..197394b 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -205,7 +205,7 @@ push-location $path_root } return $built } - $sectr_build_code = build-sectr + $script:sectr_build_code = build-sectr function build-host { @@ -217,14 +217,13 @@ push-location $path_root return } - # TODO(Ed): FIX THIS - # $dependencies_built = $sectr_build_code -eq $module_build_failed - # if ( -not $dependencies_built ) { - # write-host 'Skipping sectr_host build, dependencies failed to build' - # return - # } + $dependencies_built = $script:sectr_build_code -ne $module_build_failed + if ( -not $dependencies_built ) { + write-host 'Skipping sectr_host build, dependencies failed to build' + return + } - $should_build = (check-ModuleForChanges $module_host) || ( $sectr_build_code == $module_built ) + $should_build = (check-ModuleForChanges $module_host) -or ( $script:sectr_build_code -eq $module_built ) if ( -not( $should_build)) { write-host 'Skipping sectr_host build, module up to date' return diff --git a/scripts/update_deps.ps1 b/scripts/update_deps.ps1 index be0fc41..a52b800 100644 --- a/scripts/update_deps.ps1 +++ b/scripts/update_deps.ps1 @@ -30,18 +30,22 @@ function Update-GitRepo return } - $last_built_commit = join-path $path "last_built_commit.txt" + $repo_name = $url.Split('/')[-1].Replace('.git', '') + + $last_built_commit = join-path $path_build "last_built_commit_$repo_name.txt" if ( -not(test-path -Path $path)) { write-host "Cloining repo from $url to $path" git clone $url $path + write-host "Building $url" push-location $path & "$build_command" pop-location git -C $path rev-parse HEAD | out-file $last_built_commit $script:binaries_dirty = $true + write-host return } @@ -58,6 +62,7 @@ function Update-GitRepo write-host 'Pulling...' git -C $path pull + write-host "Building $url" push-location $path & $build_command pop-location @@ -70,12 +75,12 @@ function Update-GitRepo push-location $path_thirdparty +Update-GitRepo -path $path_odin -url $url_odin_repo -build_command '.\build.bat' + $env:odin = join-path $path_odin 'odin.exe' Update-GitRepo -path $path_ols -url $url_ols_repo -build_command '.\build.bat' remove-item env:odin -Update-GitRepo -path $path_odin -url $url_odin_repo -build_command '.\build.bat' - if (Test-Path -Path $path_ini_parser) { # Write-Host "Checking for updates on the ini-parser"