[Windows] Add Ninja (#11737)

This commit is contained in:
Alexey-Ayupov
2025-03-10 18:45:03 +01:00
committed by GitHub
parent 7809601472
commit 71845af4a0
6 changed files with 41 additions and 5 deletions

View File

@@ -117,6 +117,7 @@ $tools.AddToolVersion("WinAppDriver", $(Get-WinAppDriver))
$tools.AddToolVersion("WiX Toolset", $(Get-WixVersion))
$tools.AddToolVersion("yamllint", $(Get-YAMLLintVersion))
$tools.AddToolVersion("zstd", $(Get-ZstdVersion))
$tools.AddToolVersion("Ninja", $(Get-NinjaVersion))
# CLI Tools
$cliTools = $installedSoftware.AddHeader("CLI Tools")

View File

@@ -322,3 +322,7 @@ function Get-MongoshVersion {
function Get-WSL2Version {
return $((Get-AppxPackage -Name "MicrosoftCorporationII.WindowsSubsystemForLinux").version)
}
function Get-NinjaVersion {
return $(ninja --version)
}

View File

@@ -103,3 +103,31 @@ Describe "ImageMagick" {
"magick -version" | Should -ReturnZeroExitCode
}
}
Describe "Ninja" {
BeforeAll {
$ninjaProjectPath = $(Join-Path $env:TEMP_DIR "ninjaproject")
New-item -Path $ninjaProjectPath -ItemType Directory -Force
@'
cmake_minimum_required(VERSION 3.10)
project(NinjaTest NONE)
'@ | Out-File -FilePath "$ninjaProjectPath/CMakeLists.txt" -Encoding utf8
$ninjaProjectBuildPath = $(Join-Path $ninjaProjectPath "build")
New-item -Path $ninjaProjectBuildPath -ItemType Directory -Force
Set-Location $ninjaProjectBuildPath
}
It "Make a simple ninja project" {
"cmake -GNinja $ninjaProjectPath" | Should -ReturnZeroExitCode
}
It "build.ninja file should exist" {
$buildFilePath = $(Join-Path $ninjaProjectBuildPath "build.ninja")
$buildFilePath | Should -Exist
}
It "Ninja" {
"ninja --version" | Should -ReturnZeroExitCode
}
}

View File

@@ -418,7 +418,8 @@
"name": "cmake.install",
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
},
{ "name": "imagemagick" }
{ "name": "imagemagick" },
{ "name": "ninja" }
]
},
"node": {

View File

@@ -339,7 +339,8 @@
"name": "cmake.install",
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
},
{ "name": "imagemagick" }
{ "name": "imagemagick" },
{ "name": "ninja" }
]
},
"node": {
@@ -386,4 +387,4 @@
"pwsh": {
"version": "7.4"
}
}
}

View File

@@ -298,7 +298,8 @@
"name": "strawberryperl" ,
"args": [ "--version", "5.40.0.1" ]
},
{ "name": "imagemagick" }
{ "name": "imagemagick" },
{ "name": "ninja" }
]
},
"node": {
@@ -340,4 +341,4 @@
"pwsh": {
"version": "7.4"
}
}
}