-
Notifications
You must be signed in to change notification settings - Fork 7
feat(taskfile): Add more build tasks and rename others according to latest conventions: #70
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
Changes from all commits
dec0712
4aa941c
662e768
93c4d50
0a88c49
e4dc708
a3bc9d5
601c462
2e54cdb
f5e2b4b
89f53c1
1d313c3
2f9f30b
a63a4f2
847162f
5e55b58
77fc7ea
521c1f9
1c44077
c8a3c93
ef48733
f62ee82
7a625e7
277dc1d
f25859e
e94d6ae
36ab649
cafa9be
134b1e0
487844d
96b2811
07df644
9a7400c
caff1ae
630d389
6c55590
7f2745f
93b4a70
3ab6484
f449cce
b1243ed
d14bfdb
aea57aa
729db5c
43ee6cc
c4e67c4
cd7b3aa
2dbca54
22a27c8
56470ad
8183762
1e5b9bc
e9cbd7c
596beb5
28916c0
a9f7054
b329870
7c62982
1633044
ed60a76
d351128
ebb9984
95cb0a0
5b944b0
962c1e0
7198859
edecfb2
30ba595
0395b33
bb56c10
346dcfe
5a404d5
2de6525
f02a658
1637b6e
0688e49
0e0651e
7133493
1e7cd87
24ea39a
64f3929
7687b09
2066564
7d89e7e
8453a16
dbd5f01
a50a033
23bd52a
da59010
a8a6715
6de51cd
a6be036
e4d8ef0
8a9f7ec
f801197
b32a08d
724d94a
be182bf
692a7e1
57cc01a
aa40c4d
8e78ec0
27044bc
04c188f
4814964
926a20c
bd3b37f
5e94ac6
4800038
bd23999
bbf6d8f
a5d9eea
0aa2b0c
3f5ac82
41803a7
4146a03
6937f07
68ae65b
8e49388
69a7e8e
298ece0
8c45963
20c5ee2
c046aac
47adf89
1d5a47c
76d5f64
c6dccc2
ae58bfa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,6 +43,7 @@ Follow the steps below to develop and contribute to the project. | |||||||||
| * CMake 3.23 or higher | ||||||||||
| * Python 3.10 or higher | ||||||||||
| * [Task] 3.40.0 or higher | ||||||||||
| * [uv] 0.7.10 or higher | ||||||||||
|
|
||||||||||
| ## Set up | ||||||||||
| Initialize and update submodules: | ||||||||||
|
|
@@ -52,33 +53,32 @@ git submodule update --init --recursive | |||||||||
|
|
||||||||||
| If you want to open the project in an IDE, run the following command to install any necessary | ||||||||||
| dependencies from source: | ||||||||||
|
|
||||||||||
| ```shell | ||||||||||
| task deps:install-all | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ## Building | ||||||||||
|
|
||||||||||
| The library can be built directly using [CMake](#using-cmake) or indirectly using | ||||||||||
| [Task](#using-task). | ||||||||||
| The library can be built via [Task](#building-using-task) or directly with | ||||||||||
| [CMake](#building-using-cmake). | ||||||||||
|
|
||||||||||
|
Comment on lines
+63
to
65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Micro-wording tweak for flow -The library can be built via [Task](#building-using-task) or directly with
-[CMake](#building-using-cmake).
+The library can be built with [Task](#building-using-task) or with
+[CMake](#building-using-cmake).📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Bill-hbrhbr Thank you for the clarification! You're absolutely right - the distinction between "directly with CMake" (the native build system) and "via Task" (the task runner wrapper) is intentionally precise and technically accurate. I appreciate you explaining the reasoning behind the wording choice. ✏️ Learnings added
🧠 Learnings used |
||||||||||
| ### Using Task | ||||||||||
| ### <a id="building-using-task" />Using Task | ||||||||||
|
|
||||||||||
| To build all targets: | ||||||||||
| ```shell | ||||||||||
| task build:all | ||||||||||
| ``` | ||||||||||
| To build all libraries: | ||||||||||
|
|
||||||||||
| To build an executable containing all unit tests: | ||||||||||
| ```shell | ||||||||||
| task build:unit-test-all | ||||||||||
| task ystdlib:build-release | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| To build an executable containing a single library's unit tests: | ||||||||||
| To build a subset of libraries, set the [`ystdlib_LIBRARIES` parameter](#ystdlib_libraries). For | ||||||||||
| example: | ||||||||||
|
|
||||||||||
| ```shell | ||||||||||
| task build:unit-test-<lib_name> | ||||||||||
| task ystdlib:build-release ystdlib_LIBRARIES="containers;io_interface" | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ### Using CMake | ||||||||||
| ### <a id="building-using-cmake" />Using CMake | ||||||||||
|
|
||||||||||
| To build all libraries, run: | ||||||||||
|
|
||||||||||
|
|
@@ -87,37 +87,57 @@ cmake -S . -B ./build | |||||||||
| cmake --build ./build | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| To build a subset of libraries, set the variable `ystdlib_LIBRARIES` to a semicolon-separated (`;`) | ||||||||||
| list of library names. The library names match their [directory name in src/](./src/ystdlib). For | ||||||||||
| To build a subset of libraries, set the [`ystdlib_LIBRARIES` parameter](#ystdlib_libraries). For | ||||||||||
| example: | ||||||||||
|
|
||||||||||
| ```shell | ||||||||||
| cmake -S . -B ./build -Dystdlib_LIBRARIES="containers;io_interface" | ||||||||||
| cmake --build ./build | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| > [!NOTE] | ||||||||||
| > Internal dependencies of the libraries you choose will be automatically built, even if you don't | ||||||||||
| > explicitly specify them. In the example, specifying `io_interface` automatically adds | ||||||||||
| > `wrapped_facade_headers` to the build. | ||||||||||
|
|
||||||||||
| ## Installing | ||||||||||
|
|
||||||||||
| After [building](#building), install with: | ||||||||||
| The library can be installed via [Task](#installing-using-task) or directly with | ||||||||||
| [CMake](#installing-using-cmake). | ||||||||||
|
|
||||||||||
| ### <a id="installing-using-task" />Using Task | ||||||||||
|
|
||||||||||
| To build and install all libraries, run: | ||||||||||
|
|
||||||||||
| ```shell | ||||||||||
| task ystdlib:install-release INSTALL_PREFIX="$HOME/.local" | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| To build and install a subset of libraries, set the | ||||||||||
| [`ystdlib_LIBRARIES` parameter](#ystdlib_libraries). For example: | ||||||||||
|
|
||||||||||
| ```shell | ||||||||||
| task ystdlib:install-release \ | ||||||||||
| INSTALL_PREFIX="$HOME/.local" \ | ||||||||||
| ystdlib_LIBRARIES="containers;io_interface" | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ### <a id="installing-using-cmake" />Using CMake | ||||||||||
|
|
||||||||||
| After [building](#building-using-cmake), to install all built libraries, run: | ||||||||||
|
|
||||||||||
| ```shell | ||||||||||
| cmake --install "./build" --prefix "$HOME/.local" | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ## Testing | ||||||||||
|
|
||||||||||
| To build and run all unit tests: | ||||||||||
|
|
||||||||||
| ```shell | ||||||||||
| task test-all | ||||||||||
| task test:run-debug | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| To build and run unit tests for a specific library: | ||||||||||
| To build and run unit tests for a subset of libraries, set the | ||||||||||
| [`ystdlib_LIBRARIES` parameter](#ystdlib_libraries). For example: | ||||||||||
|
|
||||||||||
| ```shell | ||||||||||
| task test-<lib_name> | ||||||||||
| task test:run-debug ystdlib_LIBRARIES="containers;io_interface" | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| When generating a testing target, the CMake variable `BUILD_TESTING` is followed (unless overruled | ||||||||||
|
|
@@ -144,4 +164,39 @@ task -a | |||||||||
| ``` | ||||||||||
| Look for all tasks under the `lint` namespace (identified by the `lint:` prefix). | ||||||||||
|
|
||||||||||
| ## Build and install parameters | ||||||||||
|
|
||||||||||
| The following parameters are common between multiple tasks and CMake. | ||||||||||
|
|
||||||||||
| ### `ystdlib_LIBRARIES` | ||||||||||
|
|
||||||||||
| The parameter/variable `ystdlib_LIBRARIES` can be used to target a subset of libraries, by setting | ||||||||||
| it to a semicolon-separated (`;`) list of library names. The library names match their | ||||||||||
| [directory name in `src/`](./src/ystdlib). | ||||||||||
|
|
||||||||||
| > [!NOTE] | ||||||||||
| > Internal dependencies of the libraries you choose will be automatically built, even if you don't | ||||||||||
| > explicitly specify them. In the following examples, specifying `io_interface` automatically adds | ||||||||||
| > `wrapped_facade_headers` to the build. | ||||||||||
|
|
||||||||||
| #### Using Task | ||||||||||
|
|
||||||||||
| Set by adding it after the task name. For example: | ||||||||||
|
|
||||||||||
| ```shell | ||||||||||
| task ystdlib:build-release ystdlib_LIBRARIES="containers;io_interface" | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| Not all tasks support `ystdlib_LIBRARIES`. You can check if a task supports it by reading its | ||||||||||
| description (run `task -a` to view all tasks and descriptions). | ||||||||||
|
|
||||||||||
| #### Using CMake | ||||||||||
|
|
||||||||||
| Set using the `-D` flag in the generation step. For example: | ||||||||||
|
|
||||||||||
| ```shell | ||||||||||
| cmake -S . -B ./build -Dystdlib_LIBRARIES="containers;io_interface" | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might want to add a short section for |
||||||||||
| [Task]: https://taskfile.dev | ||||||||||
| [uv]: https://docs.astral.sh/uv | ||||||||||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.