summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Sartori <alberto.sartori@huawei.com>2024-06-28 16:10:55 +0200
committerAlberto Sartori <alberto.sartori@huawei.com>2024-06-28 20:28:37 +0200
commit20fab4540271abf9216bb22f604e7d48800e4e0b (patch)
treec11dd955df9eb3c029a827a55b2487887ccf29df
parent1a8211bda5c14ef0b2bff3af062c049d5598f02f (diff)
downloadrules-rust-20fab4540271abf9216bb22f604e7d48800e4e0b.tar.gz
rules-rust: update README.md
Add a section on how to import the repository.
-rw-r--r--README.md27
-rw-r--r--etc/gen_readme.py27
2 files changed, 54 insertions, 0 deletions
diff --git a/README.md b/README.md
index 7a8ae1e..c893911 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,33 @@
A collection of rules for building Rust libraries, binaries and unit tests.
+## How to use this repository
+There are two ways to import this repository. You can generate your
+`repos.json` from a template (`repos.template.json`) by importing
+the `rules-rust` repository with the tool `just-import-git`
+
+```sh
+$ just-import-git -C repos.template.json --as rules-rust -b master https://github.com/just-buildsystem/rules-rust > repos.json
+```
+
+Alternatively, the `rules-rust` repository can be added manually to
+your `repos.json`.
+
+``` jsonc
+...
+ , "rules-rust":
+ { "repository":
+ { "type": "git"
+ , "branch": "master"
+ , "repository": "https://github.com/just-buildsystem/rules-rust"
+ , "commit": "1a8211bda5c14ef0b2bff3af062c049d5598f02f"
+ , "subdir": "rules"
+ }
+ }
+...
+```
+
+
### `["rust", "binary"]`
A Rust binary.
diff --git a/etc/gen_readme.py b/etc/gen_readme.py
index 66618a3..deb661c 100644
--- a/etc/gen_readme.py
+++ b/etc/gen_readme.py
@@ -25,6 +25,33 @@ def main():
"""# Rust rules for the [`just`](https://github.com/just-buildsystem/justbuild) build system
A collection of rules for building Rust libraries, binaries and unit tests.
+
+## How to use this repository
+There are two ways to import this repository. You can generate your
+`repos.json` from a template (`repos.template.json`) by importing
+the `rules-rust` repository with the tool `just-import-git`
+
+```sh
+$ just-import-git -C repos.template.json --as rules-rust -b master https://github.com/just-buildsystem/rules-rust > repos.json
+```
+
+Alternatively, the `rules-rust` repository can be added manually to
+your `repos.json`.
+
+``` jsonc
+...
+ , "rules-rust":
+ { "repository":
+ { "type": "git"
+ , "branch": "master"
+ , "repository": "https://github.com/just-buildsystem/rules-rust"
+ , "commit": "1a8211bda5c14ef0b2bff3af062c049d5598f02f"
+ , "subdir": "rules"
+ }
+ }
+...
+```
+
""",
file=f,
)