Commit 0f4b96d 1 parent 9e8d521 commit 0f4b96d Copy full SHA for 0f4b96d
File tree 7 files changed +50
-3
lines changed
7 files changed +50
-3
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e
2
+ # ###############################################################################
3
+ # # File: install-ninja.sh
4
+ # # Desc: Install ninja-build
5
+ # ###############################################################################
6
+
7
+ # Source the helpers for use with the script
8
+ source $HELPER_SCRIPTS /install.sh
9
+
10
+ # Install ninja
11
+ download_url=$( resolve_github_release_asset_url " ninja-build/ninja" " endswith(\" ninja-linux.zip\" )" " latest" )
12
+ ninja_binary_path=$( download_with_retry " ${download_url} " )
13
+
14
+ # Unzip the ninja binary
15
+ unzip -qq " $ninja_binary_path " -d /usr/local/bin
16
+
17
+ invoke_tests " Tools" " Ninja"
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ if ((Test-IsUbuntu20) -or (Test-IsUbuntu22)) {
156
156
$tools.AddToolVersion (" yamllint" , $ (Get-YamllintVersion ))
157
157
$tools.AddToolVersion (" yq" , $ (Get-YqVersion ))
158
158
$tools.AddToolVersion (" zstd" , $ (Get-ZstdVersion ))
159
+ $tools.AddToolVersion (" Ninja" , $ (Get-NinjaVersion ))
159
160
160
161
# CLI Tools
161
162
$cliTools = $installedSoftware.AddHeader (" CLI Tools" )
Original file line number Diff line number Diff line change @@ -275,6 +275,10 @@ function Get-ZstdVersion {
275
275
return " $zstdVersion "
276
276
}
277
277
278
+ function Get-NinjaVersion {
279
+ return $ (ninja -- version)
280
+ }
281
+
278
282
function Get-YqVersion {
279
283
$yqVersion = $ (yq - V) | Get-StringPart - Part 3
280
284
return $yqVersion.TrimStart (" v" ).Trim()
Original file line number Diff line number Diff line change @@ -411,3 +411,25 @@ Describe "Kotlin" {
411
411
" kotlinc-js -version" | Should - ReturnZeroExitCode
412
412
}
413
413
}
414
+
415
+ Describe " Ninja" {
416
+ New-item - Path " /tmp/ninjaproject" - ItemType Directory - Force
417
+ Set-Location ' /tmp/ninjaproject'
418
+ @'
419
+ cmake_minimum_required(VERSION 3.10)
420
+ project(NinjaTest NONE)
421
+ '@ | Out-File - FilePath " ./CMakeLists.txt"
422
+
423
+ It " Make a simple ninja project" {
424
+ " cmake -GNinja /tmp/ninjaproject" | Should - ReturnZeroExitCode
425
+ }
426
+
427
+ It " build.ninja file should exist" {
428
+ $buildFilePath = Join-Path " /tmp/ninjaproject" " build.ninja"
429
+ $buildFilePath | Should - Exist
430
+ }
431
+
432
+ It " Ninja" {
433
+ " ninja --version" | Should - ReturnZeroExitCode
434
+ }
435
+ }
Original file line number Diff line number Diff line change @@ -328,7 +328,8 @@ build {
328
328
"${path.root}/../scripts/build/install-android-sdk.sh",
329
329
"${path.root}/../scripts/build/install-pypy.sh",
330
330
"${path.root}/../scripts/build/install-python.sh",
331
- "${path.root}/../scripts/build/install-zstd.sh"
331
+ "${path.root}/../scripts/build/install-zstd.sh",
332
+ "${path.root}/../scripts/build/install-ninja.sh"
332
333
]
333
334
}
334
335
Original file line number Diff line number Diff line change @@ -324,7 +324,8 @@ build {
324
324
"${path.root}/../scripts/build/install-android-sdk.sh",
325
325
"${path.root}/../scripts/build/install-pypy.sh",
326
326
"${path.root}/../scripts/build/install-python.sh",
327
- "${path.root}/../scripts/build/install-zstd.sh"
327
+ "${path.root}/../scripts/build/install-zstd.sh",
328
+ "${path.root}/../scripts/build/install-ninja.sh"
328
329
]
329
330
}
330
331
Original file line number Diff line number Diff line change @@ -313,7 +313,8 @@ provisioner "shell" {
313
313
"${path.root}/../scripts/build/install-android-sdk.sh",
314
314
"${path.root}/../scripts/build/install-pypy.sh",
315
315
"${path.root}/../scripts/build/install-python.sh",
316
- "${path.root}/../scripts/build/install-zstd.sh"
316
+ "${path.root}/../scripts/build/install-zstd.sh",
317
+ "${path.root}/../scripts/build/install-ninja.sh"
317
318
]
318
319
}
319
320
You can’t perform that action at this time.
0 commit comments