Add list highlighting nice features to readme (#664)
This was suggested by @zaiste, to make it clearer how Just differs from Make, and what features it has.
This commit is contained in:
parent
981465ad30
commit
5e2b51e83e
14
.github/workflows/build.yaml
vendored
14
.github/workflows/build.yaml
vendored
@ -19,13 +19,13 @@ jobs:
|
|||||||
os:
|
os:
|
||||||
- macos-latest
|
- macos-latest
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- windows-latest
|
- windows-2016
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
target: x86_64-unknown-linux-musl
|
target: x86_64-unknown-linux-musl
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
target: x86_64-apple-darwin
|
target: x86_64-apple-darwin
|
||||||
- os: windows-latest
|
- os: windows-2016
|
||||||
target: x86_64-pc-windows-msvc
|
target: x86_64-pc-windows-msvc
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
@ -41,19 +41,19 @@ jobs:
|
|||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ~/.cargo/registry
|
path: ~/.cargo/registry
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
key: 0-${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Cache cargo index
|
- name: Cache cargo index
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ~/.cargo/git
|
path: ~/.cargo/git
|
||||||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
key: 0-${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Cache cargo build
|
- name: Cache cargo build
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: target
|
path: target
|
||||||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
key: 0-${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Install Main Toolchain
|
- name: Install Main Toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
@ -80,7 +80,7 @@ jobs:
|
|||||||
run: cargo clippy --all
|
run: cargo clippy --all
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
if: matrix.os != 'windows-latest'
|
if: matrix.os != 'windows-2016'
|
||||||
run: cargo run lint
|
run: cargo run lint
|
||||||
|
|
||||||
- name: Install Rustfmt Toolchain
|
- name: Install Rustfmt Toolchain
|
||||||
@ -95,7 +95,7 @@ jobs:
|
|||||||
run: cargo +nightly fmt --all -- --check
|
run: cargo +nightly fmt --all -- --check
|
||||||
|
|
||||||
- name: Completion Scripts
|
- name: Completion Scripts
|
||||||
if: matrix.os != 'windows-latest'
|
if: matrix.os != 'windows-2016'
|
||||||
run: |
|
run: |
|
||||||
./bin/generate-completions
|
./bin/generate-completions
|
||||||
git diff --no-ext-diff --quiet --exit-code
|
git diff --no-ext-diff --quiet --exit-code
|
||||||
|
39
README.adoc
39
README.adoc
@ -12,7 +12,7 @@ image:https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg[say thanks,link=htt
|
|||||||
|
|
||||||
(非官方中文文档,link:https://github.com/chinanf-boy/just-zh[这里],快看过来!)
|
(非官方中文文档,link:https://github.com/chinanf-boy/just-zh[这里],快看过来!)
|
||||||
|
|
||||||
Commands are stored in a file called `justfile` with syntax inspired by `make`:
|
Commands, called recipes, are stored in a file called `justfile` with syntax inspired by `make`:
|
||||||
|
|
||||||
```make
|
```make
|
||||||
build:
|
build:
|
||||||
@ -27,7 +27,7 @@ test TEST: build
|
|||||||
./test --test {{TEST}}
|
./test --test {{TEST}}
|
||||||
```
|
```
|
||||||
|
|
||||||
You can then run them with `just COMMAND`:
|
You can then run them with `just RECIPE`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ just test-all
|
$ just test-all
|
||||||
@ -36,9 +36,40 @@ cc *.c -o main
|
|||||||
Yay, all your tests passed!
|
Yay, all your tests passed!
|
||||||
```
|
```
|
||||||
|
|
||||||
`just` produces detailed error messages and avoids `make`’s idiosyncrasies, so debugging a justfile is easier and less surprising than debugging a makefile.
|
Just has a ton of useful features, and many improvements over Make:
|
||||||
|
|
||||||
If you need help with `just` please feel free to open an issue or let me know on link:https://gitter.im/just-because/Lobby[gitter]. Feature requests and bug reports are always welcome!
|
- Just is a command runner, not a build system, so it avoids much of
|
||||||
|
link:https://github.com/casey/just#what-are-the-idiosyncrasies-of-make-that-just-avoids[Make's
|
||||||
|
complexity and idiosyncrasies]. No need for `.PHONY` recipes!
|
||||||
|
|
||||||
|
- Errors are specific and informative, and syntax errors are reported along with their source context.
|
||||||
|
|
||||||
|
- Recipes can accept
|
||||||
|
link:https://github.com/casey/just#recipe-parameters[command line arguments].
|
||||||
|
|
||||||
|
- Wherever possible, errors are resolved statically. Unknown recipes and
|
||||||
|
circular dependencies are reported before anything runs.
|
||||||
|
|
||||||
|
- Just link:https://github.com/casey/just#dotenv-integration[loads `.env`
|
||||||
|
files], making it easy to populate environment variables.
|
||||||
|
|
||||||
|
- Recipes can be
|
||||||
|
link:https://github.com/casey/just#listing-available-recipes[listed from the
|
||||||
|
command line].
|
||||||
|
|
||||||
|
- Command line completion scripts are
|
||||||
|
link:https://github.com/casey/just#shell-completion-scripts[available for
|
||||||
|
most popular shells].
|
||||||
|
|
||||||
|
- Recipes can be written in
|
||||||
|
link:https://github.com/casey/just#writing-recipes-in-other-languages[arbitrary
|
||||||
|
languages], like Python or NodeJS.
|
||||||
|
|
||||||
|
- `just` can be invoked from any subdirectory, not just the directory that contains the `Justfile`.
|
||||||
|
|
||||||
|
- And link:https://github.com/casey/just#manual[much more]!
|
||||||
|
|
||||||
|
If you need help with `just` please feel free to open an issue or ping me on link:https://discord.gg/ezYScXR[discord]. Feature requests and bug reports are always welcome!
|
||||||
|
|
||||||
[discrete]
|
[discrete]
|
||||||
== Manual
|
== Manual
|
||||||
|
@ -20,7 +20,7 @@ case $os in
|
|||||||
cargo rustc --bin $bin --target $target --release
|
cargo rustc --bin $bin --target $target --release
|
||||||
executable=target/$target/release/$bin
|
executable=target/$target/release/$bin
|
||||||
;;
|
;;
|
||||||
windows-latest)
|
windows-2016)
|
||||||
cargo rustc --bin $bin --target $target --release -- -C target-feature="+crt-static"
|
cargo rustc --bin $bin --target $target --release -- -C target-feature="+crt-static"
|
||||||
executable=target/$target/release/$bin.exe
|
executable=target/$target/release/$bin.exe
|
||||||
;;
|
;;
|
||||||
@ -46,7 +46,7 @@ case $os in
|
|||||||
tar czf $archive *
|
tar czf $archive *
|
||||||
echo "::set-output name=archive::$archive"
|
echo "::set-output name=archive::$archive"
|
||||||
;;
|
;;
|
||||||
windows-latest)
|
windows-2016)
|
||||||
archive=$dist/$bin-$version-$target.zip
|
archive=$dist/$bin-$version-$target.zip
|
||||||
7z a $archive *
|
7z a $archive *
|
||||||
echo "::set-output name=archive::`pwd -W`/$bin-$version-$target.zip"
|
echo "::set-output name=archive::`pwd -W`/$bin-$version-$target.zip"
|
||||||
|
Loading…
Reference in New Issue
Block a user