Skip to content

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Nov 21, 2021
1 parent 9634608 commit 0b3d2fa
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 22 deletions.
28 changes: 28 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"cSpell.words": [
"buildtools",
"ccache",
"cmake",
"CPATH",
"Cppcheck",
"CPPFLAGS",
"dyld",
"eabi",
"execa",
"gcovr",
"Graphviz",
"isci",
"LDFLAGS",
"msbuild",
"msvc",
"msys",
"multilib",
"nothrow",
"Opencppcoverage",
"OSSDK",
"untildify",
"vcpkg",
"visualc",
"visualcpp"
]
}
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,55 +35,55 @@ The package can be used locally or from CI services like GitHub Actions. Stay tu

# From Terminal

You should download the exe file or the js file (if have Nodejs installed), and run it with the available options.
You should download the executable file or the js file (if Nodejs installed), and run it with the available options.

Tip: You can automate downloading using `wget`, `curl` or other similar tools.
Tip: You can automate downloading using `wget`, `curl`, or other similar tools.

### Executable

Download the executable for your platform from [here](https://github.com/aminya/setup-cpp/releases/tag/v0.2.2), and run it with the available options.
Download the executable for your platform from [here](https://github.com/aminya/setup-cpp/releases/tag/v0.3.0), 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 -O "https://github.com/aminya/setup-cpp/releases/download/v0.2.2/setup_cpp_windows.exe"
curl -O "https://github.com/aminya/setup-cpp/releases/download/v0.3.0/setup_cpp_windows.exe"
./setup_cpp_windows --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
```

```ps1
# linux example
wget "https://github.com/aminya/setup-cpp/releases/download/v0.2.2/setup_cpp_linux"
wget "https://github.com/aminya/setup-cpp/releases/download/v0.3.0/setup_cpp_linux"
chmod +x setup_cpp_linux
sudo ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
```

```ps1
# mac example
wget "https://github.com/aminya/setup-cpp/releases/download/v0.2.2/setup_cpp_mac"
wget "https://github.com/aminya/setup-cpp/releases/download/v0.3.0/setup_cpp_mac"
chmod +x setup_cpp_mac
sudo ./setup_cpp_mac --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
```

NOTE: In the `compiler` entry, you can specify the version after `-` like `llvm-11`.
For the tools, instead of `true`, which chooses the default version, you can pass a specific version.
For the tools, instead of `true` that chooses the default version, you can pass a specific version.

### With Nodejs

Download the `setup_cpp.js` file form [here](https://github.com/aminya/setup-cpp/releases/download/v0.2.2/setup_cpp.js), and run it with the available options.
Download the `setup_cpp.js` file form [here](https://github.com/aminya/setup-cpp/releases/download/v0.3.0/setup_cpp.js), and run it with the available options.

On Windows

```ps1
# open shell as admin
curl "https://github.com/aminya/setup-cpp/releases/download/v0.2.2/setup_cpp.js"
curl "https://github.com/aminya/setup-cpp/releases/download/v0.3.0/setup_cpp.js"
node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
```

On Linux or Mac:

```ps1
wget "https://github.com/aminya/setup-cpp/releases/download/v0.2.2/setup_cpp.js"
wget "https://github.com/aminya/setup-cpp/releases/download/v0.3.0/setup_cpp.js"
sudo node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
```

Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:

# 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
# debian
Expand All @@ -142,7 +142,7 @@ WORKDIR "/"
RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends apt-utils
RUN apt-get install -y --no-install-recommends ca-certificates wget unzip
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.2.2/setup_cpp_linux"
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.3.0/setup_cpp_linux"
RUN chmod +x ./setup_cpp_linux

# install llvm, cmake, ninja, ccache, and vcpkg
Expand All @@ -159,7 +159,7 @@ If you want to build the ones included, then run:
docker build -f ./building/docker/debian.dockerfile -t setup_cpp .
```

Where you should use the path to the the docker after `-f`.
Where you should use the path to the docker after `-f`.

After build, run the following to start an interactive shell in your container

Expand All @@ -169,4 +169,4 @@ docker run -it setup_cpp

### Incomplete

- msvc. It is implemented, but has bugs. See [this issue](https://github.com/aminya/setup-cpp/issues/1)
- `msvc`. It is implemented, but it has bugs. See [this issue](https://github.com/aminya/setup-cpp/issues/1)
2 changes: 1 addition & 1 deletion dist/setup_cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/setup_cpp.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export async function main(args: string[]): Promise<number> {
// get the setup function
const setupFunction = setups[tool]

// runnig the setup function for this tool
// running the setup function for this tool
try {
// eslint-disable-next-line no-await-in-loop
const installationInfo = await setupFunction(getVersion(tool, value), join(setupCppDir, tool), arch)
Expand All @@ -135,7 +135,7 @@ export async function main(args: string[]): Promise<number> {
const maybeCompiler = opts.compiler
try {
if (maybeCompiler !== undefined) {
// detecting the compiler version. Devide the given string by `-` and use the second element as the version
// detecting the compiler version. Divide the given string by `-` and use the second element as the version
const compilerAndMaybeVersion = maybeCompiler.split("-")
const compiler = compilerAndMaybeVersion[0]
let version: string | undefined
Expand Down Expand Up @@ -263,10 +263,10 @@ function maybeGetInput(key: string) {
function getSuccessMessage(tool: string, installationInfo: InstallationInfo) {
let msg = `${tool} was successfully installed`
if ("installDir" in installationInfo) {
msg += `\nThe installation direcotry is ${installationInfo.installDir}`
msg += `\nThe installation directory is ${installationInfo.installDir}`
}
if (installationInfo.binDir !== "") {
msg += `\nThe binary direcotry is ${installationInfo.binDir}`
msg += `\nThe binary directory is ${installationInfo.binDir}`
}
return msg
}
4 changes: 2 additions & 2 deletions src/utils/setup/setupBin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export type InstallationInfo = {
/**
* A function that:
*
* - Downlodas and extracts a package
* - Downloads and extracts a package
* - Adds the bin path of the package to PATH
* - Caches the dowloaded directory into tool cache for usage from other sessions
* - Caches the downloaded directory into tool cache for usage from other sessions
*
* @returns The installation directory
*/
Expand Down

0 comments on commit 0b3d2fa

Please sign in to comment.