fix: include go:build directives in generation task

This commit is contained in:
Peter 2023-08-17 17:01:50 +02:00
parent 0ed4d13b00
commit 79c7927875
Signed by: prskr
GPG key ID: C1DB5D2E8DB512F9
4 changed files with 20 additions and 7 deletions

View file

@ -1,12 +1,21 @@
task "script" "go_fmt" {
inline = [
"go fmt ${join(" ", toset([for s in vcs.staged_files : "code.icb4dc0.de/buildr/api/${dirname(s)}" if ext(s) == ".go"]))}"
]
continue_on_error = true
}
task "script" "buf_generate" {
inline = [
"buf generate"
"buf generate",
"echo -e \"//go:build !wasi\\n\\n$(cat generated/rpc/v1/executor_grpc.pb.go)\" > generated/rpc/v1/executor_grpc.pb.go"
]
out_dir = repo.root
input_mapping = {
"api" = "api",
"rpc" = "rpc",
"buf.yaml" = "buf.yaml"
"buf.gen.yaml" = "buf.gen.yaml"
"buf.work.yaml" = "buf.work.yaml"
}
@ -27,7 +36,6 @@ task "script" "golangci_lint" {
depends_on = [
tasks.go_fmt.id,
tasks.go_generate.id,
]
input_mapping = {

6
.gitignore vendored Normal file
View file

@ -0,0 +1,6 @@
# buildr
.buildr/bin
.buildr/out
.buildr/logs
.buildr/.vaultpw
.buildr/state.sqlite

View file

@ -8,15 +8,15 @@ managed:
- buf.build/googleapis/googleapis
plugins:
- plugin: buf.build/protocolbuffers/go:v1.31.0
out: ./api/generated/
out: ./generated/
opt: paths=source_relative
- plugin: buf.build/grpc/go:v1.3.0
out: ./api/generated/
out: ./generated/
opt:
- paths=source_relative
- require_unimplemented_servers=false
- plugin: buf.build/community/planetscale-vtprotobuf:v0.4.0
out: ./api/generated/
out: ./generated/
opt:
- features=marshal+unmarshal+size+pool
- paths=source_relative

View file

@ -10,7 +10,6 @@ package rpcv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"