dev/template: add template for creating new sub-projects
Fixes hexops/mach#473 Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
da9b08940a
commit
19fa5cee8c
9 changed files with 350 additions and 0 deletions
38
dev/template/README.md
Normal file
38
dev/template/README.md
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# mach/foobar - a project template
|
||||
|
||||
This repository is a separate copy of the same library in the [main Mach repository](https://github.com/hexops/mach), and is automatically kept in sync, so that anyone can use this library in their own project if they like!
|
||||
|
||||
## Getting started
|
||||
|
||||
### Adding dependency
|
||||
|
||||
In a `libs` subdirectory of the root of your project:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/hexops/mach-foobar
|
||||
```
|
||||
|
||||
Then in your `build.zig` add:
|
||||
|
||||
```zig
|
||||
...
|
||||
const foobar = @import("libs/mach-foobar/build.zig");
|
||||
|
||||
pub fn build(b: *Builder) void {
|
||||
...
|
||||
exe.addPackage(foobar.pkg);
|
||||
foobar.link(b, exe, .{});
|
||||
}
|
||||
```
|
||||
|
||||
## Join the community
|
||||
|
||||
Join the Mach community [on Discord](https://discord.gg/XNG3NZgCqp) or [Matrix](https://matrix.to/#/#hexops:matrix.org) to discuss this project, ask questions, get help, etc.
|
||||
|
||||
## Issues
|
||||
|
||||
Issues are tracked in the [main Mach repository](https://github.com/hexops/mach/issues?q=is%3Aissue+is%3Aopen+label%3Afoobar).
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions are very welcome. Pull requests must be sent to [the main repository](https://github.com/hexops/mach/tree/main/foobar) to avoid some complex merge conflicts we'd get by accepting contributions in both repositories. Once the changes are merged there, they'll get sync'd to this repository automatically.
|
||||
Loading…
Add table
Add a link
Reference in a new issue