Skip to content

Commit 67a1d8d

Browse files
committed
feat: add support for cmakelang, cmake-lint, cmake-format
1 parent d7f5466 commit 67a1d8d

11 files changed

+59
-12
lines changed

README.md

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

action.yml

+15
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,21 @@ inputs:
7070
cmake:
7171
description: "Wether to install cmake (true/false) or the specific version to install."
7272
required: false
73+
cmakelang:
74+
description: "Wether to install cmakelang (true/false) or the specific version to install."
75+
required: false
76+
cmake-lint:
77+
description: "Wether to install cmake-lint (true/false) or the specific version to install."
78+
required: false
79+
cmakelint:
80+
description: "Wether to install cmake-lint (true/false) or the specific version to install."
81+
required: false
82+
cmake-format:
83+
description: "Wether to install cmake-format (true/false) or the specific version to install."
84+
required: false
85+
cmakeformat:
86+
description: "Wether to install cmake-format (true/false) or the specific version to install."
87+
required: false
7388
ninja:
7489
description: "Wether to install ninja (true/false) or the specific version to install."
7590
required: false

cspell.config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ words:
2828
- choco
2929
- clangd
3030
- cmake
31+
- cmakeformat
3132
- cobertura
3233
- copr
3334
- CPATH

dist/legacy/setup-cpp.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.mjs

+1-1
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.map

+1-1
Large diffs are not rendered by default.

src/cli-options.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ All the available tools:
3535
"compiler and analyzer": {
3636
tools: "--llvm, --gcc, --msvc, --apple-clang, --vcvarsall, --cppcheck, --clang-tidy, --clang-format",
3737
},
38-
"build system": { tools: "--cmake, --ninja, --meson, --make, --task, --bazel" },
38+
"build system": {
39+
tools: "--cmake, --ninja, --meson, --make, --task, --bazel, --cmakelang, --cmake-lint, --cmake-format",
40+
},
3941
"package manager": { tools: "--vcpkg, --conan, --choco, --brew, --nala" },
4042
cache: { tools: "--ccache, --sccache" },
4143
documentation: { tools: "--doxygen, --graphviz" },
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { ubuntuVersion } from "../../utils/env/ubuntu_version.js"
2+
import { testBin } from "../../utils/tests/test-helpers.js"
3+
import { getVersion } from "../../versions/versions.js"
4+
import { setupCmakelang } from "../cmakelang.js"
5+
6+
jest.setTimeout(300000)
7+
describe("setup-cmakelang", () => {
8+
it("should setup cmakelang", async () => {
9+
const installInfo = await setupCmakelang(getVersion("cmakelang", "true", await ubuntuVersion()), "", process.arch)
10+
await testBin("cmake-lint", ["--version"], installInfo.binDir)
11+
await testBin("cmake-format", ["--version"], installInfo.binDir)
12+
})
13+
})

src/cmakelang/cmakelang.ts

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

src/tool.ts

+16-6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { setupBazel } from "./bazel/bazel.js"
33
import { setupCcache } from "./ccache/ccache.js"
44
import { setupChocolatey } from "./chocolatey/chocolatey.js"
55
import { setupCmake } from "./cmake/cmake.js"
6+
import { setupCmakelang } from "./cmakelang/cmakelang.js"
67
import { setupConan } from "./conan/conan.js"
78
import { setupCppcheck } from "./cppcheck/cppcheck.js"
89
import { setupDoxygen } from "./doxygen/doxygen.js"
@@ -42,30 +43,39 @@ export const appleClangSetups = {
4243
"apple-llvm": setupAppleClang,
4344
} as const
4445

46+
const cmakeLangSetups = {
47+
cmakelang: setupCmakelang,
48+
"cmake-lint": setupCmakelang,
49+
"cmake-format": setupCmakelang,
50+
cmakelint: setupCmakelang,
51+
cmakeformat: setupCmakelang,
52+
} as const
53+
4554
export const llvmTools = ["llvm", "clang", "clang++", "clang-tidy", "clang-format", "clangtidy", "clangformat"]
4655

4756
/** The setup functions */
4857
export const setups = {
58+
nala: setupNala,
59+
brew: setupBrew,
60+
choco: setupChocolatey,
61+
python: setupPython,
62+
powershell: setupPowershell,
63+
pwsh: setupPowershell,
4964
...llvmSetups,
5065
...gccSetups,
5166
...mingwSetups,
5267
...msvcSetups,
5368
...appleClangSetups,
54-
nala: setupNala,
69+
...cmakeLangSetups,
5570
cmake: setupCmake,
5671
ninja: setupNinja,
57-
python: setupPython,
5872
vcpkg: setupVcpkg,
5973
bazel: setupBazel,
6074
conan: setupConan,
6175
meson: setupMeson,
6276
gcovr: setupGcovr,
6377
opencppcoverage: setupOpencppcoverage,
6478
OpenCppCoverage: setupOpencppcoverage,
65-
choco: setupChocolatey,
66-
brew: setupBrew,
67-
powershell: setupPowershell,
68-
pwsh: setupPowershell,
6979
ccache: setupCcache,
7080
sccache: setupSccache,
7181
doxygen: setupDoxygen,

0 commit comments

Comments
 (0)