Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for just #20

Merged
merged 3 commits into from
Mar 8, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install tools used in tests
run: |
apt install -y just
npm install -g pnpm
- name: Run tests
run: dash run-tests.sh
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ request.
| Cabal | Haskell | `*.cabal` | `cabal build` <br/> `cabal run` <br/> `cabal test` |
| Stack | Haskell | `stack.yaml` | `stack build` <br/> `stack run` <br/> `stack test` |
| make | Any | `Makefile` | `make` <br/> `make test/check` |
| just | Any | `justfile` | `just build` <br /> `just run` <br /> `just test` |
| Mage | Go | `magefile.go` with a `test`/`check` target | `mage test/check` |
| Go | Go | `go.mod` | `go test` |
| Tectonic | LaTeX | `Tectonic.toml` | `tectonic -X build` |
Expand Down
17 changes: 16 additions & 1 deletion man/projectdo.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'\" t
.\" Automatically generated by Pandoc 3.1.13
.\" Automatically generated by Pandoc 3.1.11.1
.\"
.TH "projectdo" "1" "April 24, 2024" "projectdo 0.2.2" "User Manual"
.SH NAME
Expand Down Expand Up @@ -279,6 +279,21 @@ _
tab(@);
lw(8.4n) lw(10.9n) lw(23.5n) lw(27.2n).
T{
just
T}@T{
Any
T}@T{
\f[CR]justfile\f[R]
T}@T{
\f[CR]just build\f[R], \f[CR]just run\f[R], \f[CR]just test\f[R]
T}
_
.TE
.PP
.TS
tab(@);
lw(8.4n) lw(10.9n) lw(23.5n) lw(27.2n).
T{
make
T}@T{
Any
Expand Down
3 changes: 3 additions & 0 deletions man/projectdo.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ alias p='projectdo tool'
| Stack | Haskell | `stack.yaml` | `stack build`, `stack run`, `stack test` |
|--------------|------------------|---------------------------------------|---------------------------------------------|

| just | Any | `justfile` | `just build`, `just run`, `just test` |
|--------------|------------------|---------------------------------------|---------------------------------------------|

| make | Any | `Makefile` | `make`, `make test/check` |
|--------------|------------------|---------------------------------------|---------------------------------------------|

Expand Down
13 changes: 13 additions & 0 deletions projectdo
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,18 @@ try_lein() {
fi
}

# justfile

try_justfile() {
if [ -f justfile ]; then
if ! has_command "just"; then
echo "Found a justfile but 'just' is not installed."
exit 1
fi
execute_command just "$ACTION"
fi
}

# Makefile

has_make_target() {
Expand Down Expand Up @@ -319,6 +331,7 @@ detect_and_run() {
try_cmake
try_maven
try_lein
try_justfile
try_makefile
try_python
try_go
Expand Down
19 changes: 19 additions & 0 deletions run-tests.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,25 @@ if describe "npm / yarn / pnpm"; then
fi
fi

if describe "just"; then
if it "finds test target"; then
do_test_in "just"; assert
assertEqual "$RUN_RESULT" "just test"
fi
if it "finds build target"; then
do_build_in "just"; assert
assertEqual "$RUN_RESULT" "just build"
fi
if it "finds run target"; then
do_run_in "just"; assert
assertEqual "$RUN_RESULT" "just run"
fi
if it "can print tool"; then
do_print_tool_in "just"; assert
assertEqual "$RUN_RESULT" "just"
fi
fi

if describe "make"; then
if it "finds check target"; then
do_test_in "make-check"; assert
Expand Down
8 changes: 8 additions & 0 deletions tests/just/justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
test:
@echo "Tests passed"

build:
@echo "Built"

run:
@echo "Ran"
Loading