Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ire4ever1190/doit
Make files are good, but lets complicate them for no reason
https://github.com/ire4ever1190/doit
Last synced: 11 days ago
JSON representation
Make files are good, but lets complicate them for no reason
- Host: GitHub
- URL: https://github.com/ire4ever1190/doit
- Owner: ire4ever1190
- Created: 2022-11-23T03:01:09.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-12T05:08:05.000Z (over 1 year ago)
- Last Synced: 2024-05-02T02:34:21.339Z (6 months ago)
- Language: Nim
- Size: 43 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Do it
![Just do it? Mkay](https://media3.giphy.com/media/UqZ4imFIoljlr5O2sM/giphy.gif?cid=ecf05e476ep7oe79xztdvjrq8ae63lj4dxz57nnlhfa3jjyc&rid=giphy.gif&ct=g)
Was bored over summer holidays and decided to finally build the build system I had in my head. Think `make` but with bit more spice.
Is mostly file based (So language agnostic) since my main use for `make` was compiling random scripts and tex files together for assignments.This really is more of just a hobby thing for personal use so don't expect it to be too fancy
#### Basic usage
First make sure you have both [Nim](nim-lang.org/) and [nimble](https://github.com/nim-lang/nimble) installed and then install `doit` by running `nimble install https://github.com/ire4ever1190/doit`
Then you create a file called `doit.nim` and put this basic structure in it
```nim
import doit/api# targets and tasks go here
run()
```You can write any Nim code in here but since you are using this you'll probably want to write some targets and tasks.
- **target**: Code that takes in some **requirement** files and produces a **target file**
- **task**: Code that always runs when its a requirementA basic Nim project would look like this
```nim
import doit/apitarget("program", ["program.nim", "other.nim"]):
cmd "nim c program.nim"task("clean"): # Just like .PHONY in make, means this always runs
rm "./program"run()
```Running `doit program` will then compile the program (Running it again will do nothing since it detects no modification) and `doit clean` will remove it
#### Roadmap
- [x] Basic make like operations
- [ ] Detecting cycles in operations
- [ ] Expand the API
- [ ] Documentation
- [ ] Pattern matching
- [ ] Lazy loading of dependencies
- [x] Automatic finding of dependencies for different file types (Maybe through some form of a hooks system for file extensions)