-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
89 lines (83 loc) · 2.12 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# #!/usr/bin/env -S just --justfile
# just reference: https://just.systems/man/en/
# monolith flavor: ~/.config/nvim/readme/build.md
#
# set positional-arguments
build:
@dub build
release:
@dub build -b release
build-all:
dub build
# dub build :sdl
dub build :term
dub build :web
dust:
dub dustmite ../dustmite/sily/ --compiler-status=-4 -b=release --no-redirect
test FILENOEXT:
#!/bin/bash
if [[ -f "test/{{FILENOEXT}}.d" ]]; then
dub run --single "test/{{FILENOEXT}}.d"
else
echo "Missing test/{{FILENOEXT}}.d"
fi
# Cheatsheet:
# Set a variable (variable case is arbitrary)
# SINGLE := "--single"
#
# Export variable
# export MYHOME := "/new/home"
#
# Join paths:
# PATHS := "path/to" / "file" + ".txt"
#
# Conditions
# foo := if "2" == "2" { "Good!" } else { "1984" }
#
# String literals
# escaped_string := "\"\\" # will eval to "\
# raw_string := '\"\\' # will eval to \"\\
# exec_string := `ls` # will be set to result of inner command
#
# Hide configuration from just --list, prepend _ or add [private]
# [private]
# _test: build_d
#
# Alias to a recipe (just noecho)
# alias noecho := _echo
#
# Silence commands or recipes by prepending @ (i.e hide "dub build"):
# @build_d_custom:
# @dub build
#
# Continue even on fail by adding "-"
# test:
# -cat notexists.txt
# echo "Still executes"
#
# Configuration using variable from above (and positional argument $1)
# buildFile FILENAME:
# dub build {{SINGLE}} $1
#
# Set env ([linux] makes recipe be usable only in linux)
# [linux]
# @test_d:
# #!/bin/bash
#
# A command's arguments can be passed to dependency (also default arguments)
# push target="debug": (build target)
#
# Use + (1 ore more) or * (0 or more) to make argument variadic. Must be last
# ntest +FILES="justfile1 justfile2":
#
# Run set configurations (recipe requirements)
# all: build_d build_d_custom _echo
#
# This example will run in order "a", "b", "c", "d"
# b: a && c d
#
# Each recipe line is executed by a new shell (use shebang to prevent)
# foo:
# pwd # This `pwd` will print the same directory…
# cd bar
# pwd # …as this `pwd`!