Skip to content
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

V2 remove go generate from the build process #1802

Open
wants to merge 3 commits into
base: v2-maint
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@
// app.Run(os.Args)
// }
package cli

//go:generate make -C cmd/urfave-cli-genflags run
5 changes: 2 additions & 3 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,13 @@ step.

#### generated code

A significant portion of the project's source code is generated, with the goal being to
A significant portion of the project's source code is generated, to
eliminate repetitive maintenance where other type-safe abstraction is impractical or
impossible with Go versions `< 1.18`. In a future where the eldest Go version supported is
`1.18.x`, there will likely be efforts to take advantage of
[generics](https://go.dev/doc/tutorial/generics).

The built-in `go generate` command is used to run the commands specified in
`//go:generate` directives. Each such command runs a file that also supports a command
Generator scripts also support command
line help system which may be consulted for further information, e.g.:

```sh
Expand Down
2 changes: 1 addition & 1 deletion internal/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ func GenerateActionFunc(cCtx *cli.Context) error {
}

log.Println("--- generating Go source files ---")
return runCmd("go", "generate", cCtx.Path("top")+"/...")
return runCmd("make", "-C", cCtx.Path("top")+"/cmd/urfave-cli-genflags", "run")
}

func YAMLFmtActionFunc(cCtx *cli.Context) error {
Expand Down