Skip to content

Commit 9d52a08

Browse files
committed
Just: add some docs in source
1 parent db83285 commit 9d52a08

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

misc/just/build.just

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1+
# Helper build recipes
2+
13
import "defs.just"
24

5+
# Build the given language-specific CLI distribution
36
_build_dist LANGUAGE: _require_semmle_code (_maybe_build_dist LANGUAGE)
47

8+
# Build the language-specific distribution if we are in an internal repository checkout
9+
# Otherwise, do nothing
510
[no-exit-message]
611
_maybe_build_dist LANGUAGE: (_if_in_semmle_code ('cd "$SEMMLE_CODE"; tools/bazel run //language-packs:intree-' + LANGUAGE) '# using codeql from PATH, if any')
712

13+
# Call bazel. Uses our official bazel wrapper if we are in an internal repository checkout
814
[no-cd, no-exit-message]
915
_bazel COMMAND *ARGS: (_if_in_semmle_code 'cd "$SEMMLE_CODE"; tools/bazel' 'bazel' COMMAND ARGS)
1016

17+
# Call sembuild (requires an internal repository checkout)
1118
[no-cd, no-exit-message]
1219
_sembuild *ARGS: (_run_in_semmle_code "./build" ARGS)

misc/just/forward.just

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
# Common verbs
2+
# See README.md in this directory for an overview.
3+
14
import "lib.just"
25

6+
37
# copy&paste necessary for each command until proper forwarding of multiple args is implemented
48
# see https://github.com/casey/just/issues/1988
59

misc/just/lib.just

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,44 @@
1+
# Helper recipes
2+
13
import "build.just"
24
import "format.just"
35

6+
# Run language tests. `BASE_FLAGS` are used by default, `ALL_CHECK_FLAGS` are used if
7+
# `--all-checks` or `+` is passed along in `EXTRA_ARGS`
48
[no-cd, positional-arguments, no-exit-message]
59
@_codeql_test LANGUAGE BASE_FLAGS ALL_CHECKS_FLAGS EXTRA_ARGS:
610
{{ tsx }} "{{ source_dir() }}/codeql-test-run.ts" "$@"
711

12+
# Run all language tests in ROOTS for a language. This is intended to be called by CI
813
[no-cd, positional-arguments, no-exit-message]
914
@_language_tests EXTRA_ARGS SOURCE_DIR +ROOTS: _require_semmle_code
1015
{{ tsx }} "{{ source_dir() }}/language-tests.ts" "$@"
1116

12-
13-
17+
# Run integration tests. Requires an internal repository checkout
1418
[no-cd, no-exit-message]
1519
_integration_test *ARGS: _require_semmle_code (_run "$SEMMLE_CODE/tools/pytest" ARGS)
1620

21+
# Generic run command recipe that can be used by other recipes, with nice rendering
1722
[no-cd]
1823
_run +ARGS:
1924
{{ cmd_sep }}{{ ARGS }}{{ cmd_sep }}
2025

26+
# Run a command in a specific directory
2127
[no-cd]
2228
_run_in DIR +ARGS:
2329
{{ cmd_sep }}cd "{{ DIR }}"; {{ ARGS }}{{ cmd_sep }}
2430

31+
# Run a command in the internal repository checkout
2532
[no-cd]
2633
_run_in_semmle_code +ARGS: _require_semmle_code (_run_in "$SEMMLE_CODE" ARGS)
2734

35+
# Run a just recipe
2836
[no-cd, positional-arguments, no-exit-message]
2937
@_just +ARGS:
3038
echo "-> just $@"
3139
"{{ JUST_EXECUTABLE }}" "$@"
3240

41+
# Run a just recipe, but only if we are not on CI
3342
[no-cd, positional-arguments]
3443
@_if_not_on_ci_just +ARGS:
3544
if [ "${GITHUB_ACTIONS:-}" != "true" ]; then \

0 commit comments

Comments
 (0)