33`gobake` operates on a simple principle: **Your build system should be as robust as your application.**
44
55Instead of relying on fragile shell scripts or complex Makefiles, `gobake` uses:
6- 1. **Engine:** The core Go library that manages tasks.
7- 2. **Context:** A helper object passed to every task, providing access to the shell, logging, and metadata .
6+ 1. **Engine:** The core Go library that manages tasks and metadata .
7+ 2. **Context:** A helper object passed to every task, providing access to the shell, logging, and environment .
883. **Recipe:** The `Recipe.go` file (using `//go:build gobake`) that ties it all together.
99
1010# CLI Command Reference
1111
1212## Project Management
1313
14- * **`gobake init`**: Initialize a new project in the current directory. Automates `go mod` and dependencies .
14+ * **`gobake init`**: Initialize a new project in the current directory. Automates `go mod` and dependency setup .
1515* **`gobake version`**: Show the current version of gobake.
1616* **`gobake help`**: Show the list of available commands and project tasks.
17- * **`gobake template <git-url>`**: Clone a repository and initialize it.
17+ * **`gobake template <git-url>`**: Clone a repository and initialize it as a gobake project .
1818
1919## Dependency & Tool Management
2020
2121* **`gobake add-tool <url>`**: Adds a tool to the `(tools)` list in `recipe.piml`.
22- * **`gobake add-dep <url>`**: Adds a library dependency to `go.mod`.
2322* **`gobake remove-tool <url>`**: Removes a tool from `recipe.piml`.
24- * **`gobake remove-dep <url>`**: Removes a dependency.
23+ * **`gobake add-dep <url>`**: Adds a library dependency using `go get`.
24+ * **`gobake remove-dep <url>`**: Removes a library dependency.
2525
2626## Versioning
2727
@@ -35,7 +35,7 @@ The `recipe.piml` file is the single source of truth for your project.
3535(name) my-project
3636(version) 1.2.3
3737(authors)
38- > Ahmed <ahmed@example.com>
38+ > Fezcode
3939(tools)
4040 > github.com/swaggo/swag/cmd/swag@latest
4141```
@@ -52,3 +52,13 @@ You can define tasks that depend on other tasks using `bake.TaskWithDeps`.
5252bake.Task("test", "Run tests", func(ctx *gobake.Context) error { ... })
5353bake.TaskWithDeps("build", "Build app", []string{"test"}, func(ctx *gobake.Context) error { ... })
5454```
55+
56+ ## Cross-Compilation
57+
58+ Use `ctx.BakeBinary(os, arch, output, flags...)` for simple cross-compilation tasks.
59+
60+ ```go
61+ bake.Task("release", "Cross-compile", func(ctx *gobake.Context) error {
62+ return ctx.BakeBinary("linux", "amd64", "bin/app")
63+ })
64+ ```
0 commit comments