feat: add support for cmakelang, cmake-lint, cmake-format

This commit is contained in:
Amin Yahyaabadi 2024-09-17 14:53:47 -07:00
parent d7f5466d92
commit 67a1d8d27d
No known key found for this signature in database
GPG Key ID: F52AF77F636088F0
11 changed files with 59 additions and 12 deletions

View File

@ -17,7 +17,7 @@ Setting up a **cross-platform** environment for building and testing C++/C proje
| category | tools |
| --------------------- | --------------------------------------------------------------------------- |
| compiler and analyzer | llvm, gcc, msvc, apple-clang, vcvarsall, cppcheck, clang-tidy, clang-format |
| build system | cmake, ninja, meson, make, task, bazel |
| build system | cmake, ninja, meson, make, task, bazel, cmakelang, cmake-format, cmake-lint |
| package manager | vcpkg, conan, choco, brew, nala |
| cache | ccache, sccache |
| documentation | doxygen, graphviz |

View File

@ -70,6 +70,21 @@ inputs:
cmake:
description: "Wether to install cmake (true/false) or the specific version to install."
required: false
cmakelang:
description: "Wether to install cmakelang (true/false) or the specific version to install."
required: false
cmake-lint:
description: "Wether to install cmake-lint (true/false) or the specific version to install."
required: false
cmakelint:
description: "Wether to install cmake-lint (true/false) or the specific version to install."
required: false
cmake-format:
description: "Wether to install cmake-format (true/false) or the specific version to install."
required: false
cmakeformat:
description: "Wether to install cmake-format (true/false) or the specific version to install."
required: false
ninja:
description: "Wether to install ninja (true/false) or the specific version to install."
required: false

View File

@ -28,6 +28,7 @@ words:
- choco
- clangd
- cmake
- cmakeformat
- cobertura
- copr
- CPATH

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,9 @@ All the available tools:
"compiler and analyzer": {
tools: "--llvm, --gcc, --msvc, --apple-clang, --vcvarsall, --cppcheck, --clang-tidy, --clang-format",
},
"build system": { tools: "--cmake, --ninja, --meson, --make, --task, --bazel" },
"build system": {
tools: "--cmake, --ninja, --meson, --make, --task, --bazel, --cmakelang, --cmake-lint, --cmake-format",
},
"package manager": { tools: "--vcpkg, --conan, --choco, --brew, --nala" },
cache: { tools: "--ccache, --sccache" },
documentation: { tools: "--doxygen, --graphviz" },

View File

@ -0,0 +1,13 @@
import { ubuntuVersion } from "../../utils/env/ubuntu_version.js"
import { testBin } from "../../utils/tests/test-helpers.js"
import { getVersion } from "../../versions/versions.js"
import { setupCmakelang } from "../cmakelang.js"
jest.setTimeout(300000)
describe("setup-cmakelang", () => {
it("should setup cmakelang", async () => {
const installInfo = await setupCmakelang(getVersion("cmakelang", "true", await ubuntuVersion()), "", process.arch)
await testBin("cmake-lint", ["--version"], installInfo.binDir)
await testBin("cmake-format", ["--version"], installInfo.binDir)
})
})

View File

@ -0,0 +1,6 @@
import { setupPipPack } from "../utils/setup/setupPipPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupCmakelang(version: string | undefined, _setupDir: string, _arch: string) {
return setupPipPack("cmakelang[YAML]", version)
}

View File

@ -3,6 +3,7 @@ import { setupBazel } from "./bazel/bazel.js"
import { setupCcache } from "./ccache/ccache.js"
import { setupChocolatey } from "./chocolatey/chocolatey.js"
import { setupCmake } from "./cmake/cmake.js"
import { setupCmakelang } from "./cmakelang/cmakelang.js"
import { setupConan } from "./conan/conan.js"
import { setupCppcheck } from "./cppcheck/cppcheck.js"
import { setupDoxygen } from "./doxygen/doxygen.js"
@ -42,19 +43,32 @@ export const appleClangSetups = {
"apple-llvm": setupAppleClang,
} as const
const cmakeLangSetups = {
cmakelang: setupCmakelang,
"cmake-lint": setupCmakelang,
"cmake-format": setupCmakelang,
cmakelint: setupCmakelang,
cmakeformat: setupCmakelang,
} as const
export const llvmTools = ["llvm", "clang", "clang++", "clang-tidy", "clang-format", "clangtidy", "clangformat"]
/** The setup functions */
export const setups = {
nala: setupNala,
brew: setupBrew,
choco: setupChocolatey,
python: setupPython,
powershell: setupPowershell,
pwsh: setupPowershell,
...llvmSetups,
...gccSetups,
...mingwSetups,
...msvcSetups,
...appleClangSetups,
nala: setupNala,
...cmakeLangSetups,
cmake: setupCmake,
ninja: setupNinja,
python: setupPython,
vcpkg: setupVcpkg,
bazel: setupBazel,
conan: setupConan,
@ -62,10 +76,6 @@ export const setups = {
gcovr: setupGcovr,
opencppcoverage: setupOpencppcoverage,
OpenCppCoverage: setupOpencppcoverage,
choco: setupChocolatey,
brew: setupBrew,
powershell: setupPowershell,
pwsh: setupPowershell,
ccache: setupCcache,
sccache: setupSccache,
doxygen: setupDoxygen,