Merge pull request #159 from aminya/rename [skip ci]

This commit is contained in:
Amin Yahyaabadi 2023-01-17 22:11:33 -08:00 committed by GitHub
commit 6908737db9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 123 additions and 114 deletions

View File

@ -103,11 +103,11 @@ jobs:
gzip: folders gzip: folders
draft: true draft: true
files: > files: >
./exe/setup_cpp_windows.exe ./exe/setup-cpp-x64-windows.exe
./exe/setup_cpp_linux ./exe/setup-cpp-x64-linux
./exe/setup_cpp_mac ./exe/setup-cpp-x64-macos
./dist/node12/setup_cpp.js ./dist/node12/setup-cpp.js
./dist/node12/setup_cpp.js.map ./dist/node12/setup-cpp.js.map
./dist/node12/ ./dist/node12/
./dist/node16/ ./dist/node16/
@ -161,4 +161,4 @@ jobs:
- name: Build - name: Build
id: docker_build id: docker_build
run: | run: |
docker build -f ./dev/docker/${{ matrix.container }} -t setup_cpp . docker build -f ./dev/docker/${{ matrix.container }} -t setup-cpp .

109
README.md
View File

@ -30,69 +30,68 @@ Setting up a **cross-platform** environment for building and testing C++/C proje
### From Terminal ### From Terminal
You should download the executable file or the js file (if Nodejs installed), and run it with the available options. #### With npm and Nodejs
Tip: You can automate downloading using `wget`, `curl`, or other similar tools. Install setup-cpp with npm:
#### Executable ```shell
npm install -g setup-cpp
Download the executable for your platform from [here](https://github.com/aminya/setup-cpp/releases/tag/v0.25.1), and run it with the available options.
An example that installs llvm, cmake, ninja, ccache, and vcpkg:
```ps1
# windows example (open shell as admin)
curl.exe -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_windows.exe"
.\setup_cpp_windows --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
RefreshEnv.cmd # activate cpp environment variables
``` ```
```ps1 Then run `setup-cpp` with the available options.
# linux example
wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_linux"
chmod +x setup_cpp_linux
sudo ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
source ~/.cpprc # activate cpp environment variables ```shell
# windows example (open PowerShell as admin)
setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
RefreshEnv.cmd # activate the environment
``` ```
```ps1 ```shell
# mac example # linux/macos example
wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_mac" sudo setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
chmod +x setup_cpp_mac
sudo ./setup_cpp_mac --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
source ~/.cpprc # activate cpp environment variables source ~/.cpprc
``` ```
NOTE: In the `compiler` entry, you can specify the version after `-` like `llvm-11.0.0`. For the tools, you can pass a specific version instead of `true` that chooses the default version NOTE: In the `compiler` entry, you can specify the version after `-` like `llvm-11.0.0`. For the tools, you can pass a specific version instead of `true` that chooses the default version
NOTE: On Unix systems, when `setup-cpp` is used locally or in other CI services like GitLab, the environment variables are added to `~/.cpprc`. You should run `source ~/.cpprc` to immediately activate the environment variables. This file is automatically sourced in the next shell restart from `~/.bashrc` or `~/.profile` if `SOURCE_CPPRC` is not set to `0`. To deactivate `.cpprc` in the next shell restart, rename/remove `~/.cpprc`. NOTE: On Unix systems, when `setup-cpp` is used locally or in other CI services like GitLab, the environment variables are added to `~/.cpprc`. You should run `source ~/.cpprc` to immediately activate the environment variables. This file is automatically sourced in the next shell restart from `~/.bashrc` or `~/.profile` if `SOURCE_CPPRC` is not set to `0`. To deactivate `.cpprc` in the next shell restart, rename/remove `~/.cpprc`.
NOTE: On Unix systems, you will not need `sudo` if you are already a root user (e.g., in a GitLab runner or Docker). NOTE: On Unix systems, if you are already a root user (e.g., in a GitLab runner or Docker), you will not need to use `sudo`.
#### With Nodejs #### With executable
Download the `setup_cpp.js` file form [here](https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp.js), and run it with the available options. You can download a self-contained executable file and run it with the available options.
On Windows: Download the executable for your platform from [here](https://github.com/aminya/setup-cpp/releases/tag/v0.25.1), and run it with the available options.
Open the shell as admin, download via `curl`, then install Tip: You can automate downloading using `wget`, `curl`, or other similar tools.
```ps1 An example that installs llvm, cmake, ninja, ccache, and vcpkg:
# open shell as admin
curl.exe -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp.js" ```shell
node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true # windows example (open PowerShell as admin)
curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-windows.exe"
./setup-cpp-x64-windows --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
RefreshEnv.cmd # activate cpp environment variables RefreshEnv.cmd # activate cpp environment variables
``` ```
On Linux or Mac: ```shell
# linux example
wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-linux"
chmod +x ./setup-cpp-x64-linux
sudo ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
```ps1 source ~/.cpprc # activate cpp environment variables
wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp.js" ```
sudo node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
```shell
# macos example
wget "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-macos"
chmod +x ./setup-cpp-x64-macos
sudo ./setup-cpp-x64-macos --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
source ~/.cpprc # activate cpp environment variables source ~/.cpprc # activate cpp environment variables
``` ```
@ -160,21 +159,21 @@ jobs:
### Inside Docker ### Inside Docker
Here is an example for using setup_cpp to make a builder image that has the Cpp tools you need. Here is an example for using setup-cpp to make a builder image that has the Cpp tools you need.
```dockerfile ```dockerfile
#### Base Image #### Base Image
FROM ubuntu:22.04 AS base FROM ubuntu:22.04 AS base
# add setup_cpp # add setup-cpp
WORKDIR "/" WORKDIR "/"
RUN apt-get update -qq RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends wget RUN apt-get install -y --no-install-recommends wget
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_linux" RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-linux"
RUN chmod +x ./setup_cpp_linux RUN chmod +x ./setup-cpp-x64-linux
# install llvm, cmake, ninja, and ccache # install llvm, cmake, ninja, and ccache
RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --make true RUN ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --make true
CMD source ~/.cpprc CMD source ~/.cpprc
ENTRYPOINT [ "/bin/bash" ] ENTRYPOINT [ "/bin/bash" ]
@ -199,18 +198,18 @@ See [this folder](https://github.com/aminya/setup-cpp/tree/master/dev/docker), f
If you want to build the ones included, then run: If you want to build the ones included, then run:
```ps1 ```shell
git clone --recurse-submodules https://github.com/aminya/setup-cpp git clone --recurse-submodules https://github.com/aminya/setup-cpp
cd ./setup-cpp cd ./setup-cpp
docker build -f ./dev/docker/ubuntu.dockerfile -t setup_cpp . docker build -f ./dev/docker/ubuntu.dockerfile -t setup-cpp .
``` ```
Where you should use the path to the dockerfile after `-f`. Where you should use the path to the dockerfile after `-f`.
After build, run the following to start an interactive shell in your container After build, run the following to start an interactive shell in your container
```ps1 ```shell
docker run -it setup_cpp docker run -it setup-cpp
``` ```
### Inside Docker inside GitHub Actions ### Inside Docker inside GitHub Actions
@ -230,7 +229,7 @@ jobs:
- name: Build - name: Build
id: docker_build id: docker_build
run: | run: |
docker build -f ./dev/docker/debian.dockerfile -t setup_cpp . docker build -f ./dev/docker/debian.dockerfile -t setup-cpp .
``` ```
### Inside GitLab pipelines ### Inside GitLab pipelines
@ -261,10 +260,10 @@ stages:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F
.setup_cpp: &setup_cpp | .setup-cpp: &setup-cpp |
curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_linux" curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-linux"
chmod +x setup_cpp_linux chmod +x setup-cpp-x64-linux
./setup_cpp_linux --compiler $compiler --cmake true --ninja true --ccache true --vcpkg true ./setup-cpp-x64-linux --compiler $compiler --cmake true --ninja true --ccache true --vcpkg true
source ~/.cpprc source ~/.cpprc
.test: &test | .test: &test |
@ -277,7 +276,7 @@ test_linux_llvm:
compiler: llvm compiler: llvm
script: script:
- *setup_linux - *setup_linux
- *setup_cpp - *setup-cpp
- *test - *test
test_linux_gcc: test_linux_gcc:
@ -286,7 +285,7 @@ test_linux_gcc:
compiler: gcc compiler: gcc
script: script:
- *setup_linux - *setup_linux
- *setup_cpp - *setup-cpp
- *test - *test
``` ```

View File

@ -84,7 +84,7 @@ inputs:
runs: runs:
using: "node16" using: "node16"
main: "dist/node16/setup_cpp.js" main: "dist/node16/setup-cpp.js"
branding: branding:
icon: "award" icon: "award"

View File

@ -10,12 +10,12 @@ RUN pacman -S --noconfirm --needed nodejs
# curl for downloading setup-cpp # curl for downloading setup-cpp
RUN pacman -S --noconfirm --needed curl RUN pacman -S --noconfirm --needed curl
# add setup_cpp.js # add setup-cpp.js
COPY "./dist/node12" "/" COPY "./dist/node12" "/"
WORKDIR "/" WORKDIR "/"
# run installation # run installation
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true RUN node ./setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
# clean up # clean up
RUN pacman -Scc --noconfirm RUN pacman -Scc --noconfirm

View File

@ -7,12 +7,12 @@ RUN dnf -y install nodejs
# curl for downloading setup-cpp # curl for downloading setup-cpp
RUN dnf -y install curl RUN dnf -y install curl
# add setup_cpp.js # add setup-cpp.js
COPY "./dist/node12" "/" COPY "./dist/node12" "/"
WORKDIR "/" WORKDIR "/"
# run installation # run installation
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true RUN node ./setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true
# clean up # clean up
RUN rm -rf /tmp/* RUN rm -rf /tmp/*

View File

@ -1,15 +1,15 @@
#### Base Image #### Base Image
FROM ubuntu:22.04 AS base FROM ubuntu:22.04 AS base
# add setup_cpp # add setup-cpp
WORKDIR "/" WORKDIR "/"
RUN apt-get update -qq RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends wget RUN apt-get install -y --no-install-recommends wget
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup_cpp_linux" RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.25.1/setup-cpp-x64-linux"
RUN chmod +x ./setup_cpp_linux RUN chmod +x ./setup-cpp-x64-linux
# install llvm, cmake, ninja, and ccache # install llvm, cmake, ninja, and ccache
RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --task true RUN ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --task true
CMD source ~/.cpprc CMD source ~/.cpprc
ENTRYPOINT [ "/bin/bash" ] ENTRYPOINT [ "/bin/bash" ]

View File

@ -11,12 +11,12 @@ RUN apt-get install -y --no-install-recommends curl gnupg ca-certificates
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y --no-install-recommends nodejs RUN apt-get install -y --no-install-recommends nodejs
# add setup_cpp.js # add setup-cpp.js
COPY "./dist/node12" "/" COPY "./dist/node12" "/"
WORKDIR "/" WORKDIR "/"
# run installation # run installation
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true RUN node ./setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
CMD source ~/.cpprc CMD source ~/.cpprc
ENTRYPOINT [ "/bin/bash" ] ENTRYPOINT [ "/bin/bash" ]

View File

@ -3,12 +3,12 @@ FROM ubuntu:22.04 AS base
RUN apt-get update -qq RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends nodejs RUN apt-get install -y --no-install-recommends nodejs
# add setup_cpp.js # add setup-cpp.js
COPY "./dist/node12" "/" COPY "./dist/node12" "/"
WORKDIR "/" WORKDIR "/"
# run installation # run installation
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true RUN node ./setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true
# clean up # clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/* RUN apt-get clean && rm -rf /var/lib/apt/lists/*

View File

@ -5,7 +5,7 @@ const { join, dirname } = require("path")
async function main() { async function main() {
console.log("Disabling debug messages inside @actions/core") console.log("Disabling debug messages inside @actions/core")
const file = join(dirname(__dirname), "dist", "setup_cpp.js") const file = join(dirname(__dirname), "dist", "setup-cpp.js")
const { code, map } = await minify(readFileSync(file, "utf8"), { sourceMap: true, ...require("../.terserrc.js") }) const { code, map } = await minify(readFileSync(file, "utf8"), { sourceMap: true, ...require("../.terserrc.js") })
writeFileSync(file, code) writeFileSync(file, code)

View File

@ -7,7 +7,7 @@ function getPlatformName() {
return "windows" return "windows"
} }
case "darwin": { case "darwin": {
return "mac" return "macos"
} }
default: { default: {
return process.platform return process.platform
@ -31,10 +31,10 @@ function main() {
"--input", "--input",
"./dist/node16", "./dist/node16",
"--output", "--output",
`./exe/setup_cpp_${getPlatformName()}${exe}`, `./exe/setup-cpp-${process.arch}-${getPlatformName()}${exe}`,
"--", "--",
`{{caxa}}/node_modules/.bin/node${exe}`, `{{caxa}}/node_modules/.bin/node${exe}`,
`{{caxa}}/setup_cpp.js`, `{{caxa}}/setup-cpp.js`,
]) ])
) )
) )

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

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

@ -9,18 +9,28 @@
"import": "./dist/node12/setup-cpp.mjs", "import": "./dist/node12/setup-cpp.mjs",
"require": "./dist/node12/setup-cpp.js" "require": "./dist/node12/setup-cpp.js"
}, },
"main": "./dist/node12/setup_cpp.js", "main": "./dist/node12/setup-cpp.js",
"source": "./src/main.ts", "source": "./src/main.ts",
"bin": { "bin": {
"setup-cpp": "./dist/node12/setup_cpp.js", "setup-cpp": "./dist/node12/setup-cpp.js"
"setup_cpp": "./dist/node12/setup_cpp.js"
}, },
"files": [
"dist",
"src",
"packages",
"dev",
"README.md",
"LICENSE.txt",
"LICENSE.dependencies.txt",
"package.json",
"tsconfig.json"
],
"scripts": { "scripts": {
"build": "shx rm -rf dist/ && shx mkdir -p ./dist/node12 ./dist/node16 && run-p lint.tsc build.parcel copy.matchers", "build": "shx rm -rf dist/ && shx mkdir -p ./dist/node12 ./dist/node16 && run-p lint.tsc build.parcel copy.matchers",
"build.docker": "pnpm build && docker build -f ./dev/docker/ubuntu_node.dockerfile -t setup_cpp .", "build.docker": "pnpm build && docker build -f ./dev/docker/ubuntu_node.dockerfile -t setup-cpp .",
"build.docker.arch": "pnpm build && docker build -f ./dev/docker/arch_node.dockerfile -t setup_cpp:arch .", "build.docker.arch": "pnpm build && docker build -f ./dev/docker/arch_node.dockerfile -t setup-cpp:arch .",
"build.docker.fedora": "pnpm build && docker build -f ./dev/docker/fedora_node.dockerfile -t setup_cpp:fedora .", "build.docker.fedora": "pnpm build && docker build -f ./dev/docker/fedora_node.dockerfile -t setup-cpp:fedora .",
"build.docker.ubuntu": "pnpm build && docker build -f ./dev/docker/ubuntu_node.dockerfile -t setup_cpp:ubuntu .", "build.docker.ubuntu": "pnpm build && docker build -f ./dev/docker/ubuntu_node.dockerfile -t setup-cpp:ubuntu .",
"build.parcel": "cross-env NODE_ENV=production parcel build", "build.parcel": "cross-env NODE_ENV=production parcel build",
"bump": "ncu -u -x execa,numerous,path-exists && pnpm update", "bump": "ncu -u -x execa,numerous,path-exists && pnpm update",
"clean": "shx rm -rf .parcel-cache dist exe", "clean": "shx rm -rf .parcel-cache dist exe",
@ -35,14 +45,14 @@
"lint.tsc": "tsc --noEmit", "lint.tsc": "tsc --noEmit",
"pack.exe": "shx rm -rf ./dist/tsconfig.tsbuildinfo && ts-node --esm ./dev/scripts/pack-exe.ts", "pack.exe": "shx rm -rf ./dist/tsconfig.tsbuildinfo && ts-node --esm ./dev/scripts/pack-exe.ts",
"prepare": "pnpm run -r build && pnpm run -w build", "prepare": "pnpm run -r build && pnpm run -w build",
"start.docker": "docker run -t setup_cpp .", "start.docker": "docker run -t setup-cpp .",
"start.docker.arch": "docker run -t setup_cpp:arch .", "start.docker.arch": "docker run -t setup-cpp:arch .",
"start.docker.fedora": "docker run -t setup_cpp:fedora .", "start.docker.fedora": "docker run -t setup-cpp:fedora .",
"start.docker.ubuntu": "docker run -t setup_cpp:ubuntu .", "start.docker.ubuntu": "docker run -t setup-cpp:ubuntu .",
"test": "run-p --continue-on-error test.lint test.unit", "test": "run-p --continue-on-error test.lint test.unit",
"test.docker.arch": "docker build -f ./dev/docker/arch_node.dockerfile --target base -t setup_cpp:arch-base . && container-structure-test test --image setup_cpp:arch-base --config ./dev/container-tests/arch.yml", "test.docker.arch": "docker build -f ./dev/docker/arch_node.dockerfile --target base -t setup-cpp:arch-base . && container-structure-test test --image setup-cpp:arch-base --config ./dev/container-tests/arch.yml",
"test.docker.fedora": "docker build -f ./dev/docker/fedora_node.dockerfile --target base -t setup_cpp:fedora-base . && container-structure-test test --image setup_cpp:fedora-base --config ./dev/container-tests/fedora.yml", "test.docker.fedora": "docker build -f ./dev/docker/fedora_node.dockerfile --target base -t setup-cpp:fedora-base . && container-structure-test test --image setup-cpp:fedora-base --config ./dev/container-tests/fedora.yml",
"test.docker.ubuntu": "docker build -f ./dev/docker/ubuntu_node.dockerfile --target base -t setup_cpp:ubuntu-base . && container-structure-test test --image setup_cpp:ubuntu-base --config ./dev/container-tests/ubuntu.yml", "test.docker.ubuntu": "docker build -f ./dev/docker/ubuntu_node.dockerfile --target base -t setup-cpp:ubuntu-base . && container-structure-test test --image setup-cpp:ubuntu-base --config ./dev/container-tests/ubuntu.yml",
"test.lint": "run-p --aggregate-output --continue-on-error lint.cspell test.lint.eslint test.lint.prettier lint.tsc", "test.lint": "run-p --aggregate-output --continue-on-error lint.cspell test.lint.eslint test.lint.prettier lint.tsc",
"test.lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/", "test.lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
"test.lint.prettier": "prettier . --check", "test.lint.prettier": "prettier . --check",
@ -132,7 +142,7 @@
"electron": false, "electron": false,
"patha": "patha/dist/index.node.mjs" "patha": "patha/dist/index.node.mjs"
}, },
"main.actions": "./dist/node16/setup_cpp.js", "main.actions": "./dist/node16/setup-cpp.js",
"pnpm": { "pnpm": {
"overrides": { "overrides": {
"semver": "7.3.8", "semver": "7.3.8",

View File

@ -25,7 +25,7 @@ export async function setupBrew(_version: string, _setupDir: string, _arch: stri
} }
// brew is not thread-safe // brew is not thread-safe
const brewTempDirectory = path.join(tmpdir(), "setup_cpp", "brew") const brewTempDirectory = path.join(tmpdir(), "setup-cpp", "brew")
await mkdirP(brewTempDirectory) await mkdirP(brewTempDirectory)
execa.sync("curl", ["-LJO", "https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"], { execa.sync("curl", ["-LJO", "https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"], {

View File

@ -207,7 +207,7 @@ async function activateGcc(version: string, binDir: string) {
async function addGccLoggingMatcher() { async function addGccLoggingMatcher() {
const matcherPath = join(__dirname, "gcc_matcher.json") const matcherPath = join(__dirname, "gcc_matcher.json")
if (!(await pathExists(matcherPath))) { if (!(await pathExists(matcherPath))) {
return warning("the gcc_matcher.json file does not exist in the same folder as setup_cpp.js") return warning("the gcc_matcher.json file does not exist in the same folder as setup-cpp.js")
} }
info(`::add-matcher::${matcherPath}`) info(`::add-matcher::${matcherPath}`)
} }

View File

@ -132,7 +132,7 @@ export async function setupClangTools(version: string, setupDir: string, arch: s
async function addLLVMLoggingMatcher() { async function addLLVMLoggingMatcher() {
const matcherPath = join(__dirname, "llvm_matcher.json") const matcherPath = join(__dirname, "llvm_matcher.json")
if (!(await pathExists(matcherPath))) { if (!(await pathExists(matcherPath))) {
return warning("the llvm_matcher.json file does not exist in the same folder as setup_cpp.js") return warning("the llvm_matcher.json file does not exist in the same folder as setup-cpp.js")
} }
info(`::add-matcher::${matcherPath}`) info(`::add-matcher::${matcherPath}`)
} }

View File

@ -273,7 +273,7 @@ export async function main(args: string[]): Promise<number> {
await finalizeCpprc() await finalizeCpprc()
if (successMessages.length === 0 && errorMessages.length === 0) { if (successMessages.length === 0 && errorMessages.length === 0) {
warning("setup_cpp was called without any arguments. Nothing to do.") warning("setup-cpp was called without any arguments. Nothing to do.")
return 0 return 0
} }
@ -281,7 +281,7 @@ export async function main(args: string[]): Promise<number> {
successMessages.forEach((tool) => success(tool)) successMessages.forEach((tool) => success(tool))
errorMessages.forEach((tool) => error(tool)) errorMessages.forEach((tool) => error(tool))
info("setup_cpp finished") info("setup-cpp finished")
if (ciDetect() !== "github-actions") { if (ciDetect() !== "github-actions") {
switch (process.platform) { switch (process.platform) {
@ -346,8 +346,8 @@ export function getCompilerInfo(maybeCompiler: string) {
function printHelp() { function printHelp() {
info(` info(`
setup_cpp [options] setup-cpp [options]
setup_cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
Install all the tools required for building and testing C++/C projects. Install all the tools required for building and testing C++/C projects.

View File

@ -74,7 +74,7 @@ export async function setupMSVC(
async function addMSVCLoggingMatcher() { async function addMSVCLoggingMatcher() {
const matcherPath = join(__dirname, "msvc_matcher.json") const matcherPath = join(__dirname, "msvc_matcher.json")
if (!(await pathExists(matcherPath))) { if (!(await pathExists(matcherPath))) {
return warning("the msvc_matcher.json file does not exist in the same folder as setup_cpp.js") return warning("the msvc_matcher.json file does not exist in the same folder as setup-cpp.js")
} }
info(`::add-matcher::${matcherPath}`) info(`::add-matcher::${matcherPath}`)
} }

View File

@ -61,7 +61,7 @@ export async function setupActionsPython(version: string, _setupDir: string, arc
async function addPythonLoggingMatcher() { async function addPythonLoggingMatcher() {
const matcherPath = join(__dirname, "python_matcher.json") const matcherPath = join(__dirname, "python_matcher.json")
if (!(await pathExists(matcherPath))) { if (!(await pathExists(matcherPath))) {
return warning("the python_matcher.json file does not exist in the same folder as setup_cpp.js") return warning("the python_matcher.json file does not exist in the same folder as setup-cpp.js")
} }
info(`::add-matcher::${matcherPath}`) info(`::add-matcher::${matcherPath}`)
} }