Skip to content

Commit 9defbc1

Browse files
author
Heiko Alexander Weber
committed
replaced Makefile with ./do.sh
1 parent a1f274c commit 9defbc1

6 files changed

Lines changed: 53 additions & 40 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ jobs:
8484
- name: Publish
8585
id: publish
8686
run: |
87-
VERSION=${{ steps.get_version.outputs.VERSION }} make update-version &&
87+
chmod +x ./do.sh &&
88+
bash ./do.sh update-version ${{ steps.get_version.outputs.VERSION }} &&
8889
cargo login ${{ secrets.CRATES_IO_TOKEN }} &&
8990
cargo publish --allow-dirty
9091
@@ -119,7 +120,8 @@ jobs:
119120
rustup target install ${{ matrix.target }}
120121
- name: build-${{ matrix.target }}
121122
run: |
122-
VERSION=${{ steps.get_version.outputs.VERSION }} make update-version &&
123+
chmod +x ./do.sh &&
124+
bash ./do.sh update-version ${{ steps.get_version.outputs.VERSION }} &&
123125
cargo build --release --target ${{ matrix.target }}
124126
- name: zip
125127
run: cd ./target/${{ matrix.target }}/release && tar -zcvf ${{ matrix.target }}.tar.gz complate

Makefile

Lines changed: 0 additions & 37 deletions
This file was deleted.

do.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
case $1 in
4+
help)
5+
printf 'No\n'
6+
;;
7+
8+
init)
9+
rm -rf .git/hooks
10+
ln -s ../scripts/git-hooks .git/hooks
11+
chmod -R +x ./scripts/*
12+
;;
13+
14+
update-version)
15+
sed 's/version = "0.0.0"/version = "'$2'"/g' Cargo.toml > Cargo.toml.tmp
16+
mv Cargo.toml.tmp Cargo.toml
17+
;;
18+
19+
cover)
20+
export coverflags CARGO_INCREMENTAL=0 RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
21+
$coverflags cargo +nightly build
22+
$coverflags cargo +nightly test
23+
grcov ./target/debug/ -s . -t lcov --llvm --ignore-not-existing -o ./target/debug/coverage
24+
genhtml -o ./target/debug/coverage-html --show-details --highlight ./target/debug/coverage
25+
;;
26+
27+
open-coverage-html)
28+
open ./target/debug/coverage-html/index.html
29+
;;
30+
31+
scan)
32+
cargo clippy --all-targets --all-features -- -D warnings
33+
cargo fmt --all -- --check
34+
cargo sync-readme -c
35+
;;
36+
esac

docs/adrs/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ Architecture
77
- [ADR 3: Versioning](./adrs/3.md)
88
- [ADR 4: Experimental flag](./adrs/4.md)
99
- [ADR 5: Usage of feature flags](./adrs/5.md)
10+
- [ADR 6: Usage of shell scripts instead of Makefiles](./adrs/6.md)

docs/adrs/src/adrs/6.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ADR 6: Usage of shell scripts instead of Makefiles
2+
3+
## Summary
4+
5+
Originally, this project had a Makefile in order to do the build steps and such. Since Makefile still is kind of an alien syntax and has some disadvantages against standard plain shell scripts (bash scripts), I decided to replace the Makefile with a shell script (`./do.sh`).\
6+
This script now contains the important commands like generating coverage reports and initializing the repository.
7+
8+
## Authors
9+
10+
* Heiko Alexander Weber\
11+
[haw@voidpointergroup.com](mailto:haw@voidpointergroup.com)

scripts/git-hooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/sh
2-
make scan
2+
bash ./do.sh scan

0 commit comments

Comments
 (0)