fix: include go:build directives in generation task
This commit is contained in:
parent
0ed4d13b00
commit
79c7927875
4 changed files with 20 additions and 7 deletions
|
@ -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" {
|
task "script" "buf_generate" {
|
||||||
inline = [
|
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
|
out_dir = repo.root
|
||||||
|
|
||||||
input_mapping = {
|
input_mapping = {
|
||||||
"api" = "api",
|
"rpc" = "rpc",
|
||||||
|
"buf.yaml" = "buf.yaml"
|
||||||
"buf.gen.yaml" = "buf.gen.yaml"
|
"buf.gen.yaml" = "buf.gen.yaml"
|
||||||
"buf.work.yaml" = "buf.work.yaml"
|
"buf.work.yaml" = "buf.work.yaml"
|
||||||
}
|
}
|
||||||
|
@ -27,7 +36,6 @@ task "script" "golangci_lint" {
|
||||||
|
|
||||||
depends_on = [
|
depends_on = [
|
||||||
tasks.go_fmt.id,
|
tasks.go_fmt.id,
|
||||||
tasks.go_generate.id,
|
|
||||||
]
|
]
|
||||||
|
|
||||||
input_mapping = {
|
input_mapping = {
|
||||||
|
|
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# buildr
|
||||||
|
.buildr/bin
|
||||||
|
.buildr/out
|
||||||
|
.buildr/logs
|
||||||
|
.buildr/.vaultpw
|
||||||
|
.buildr/state.sqlite
|
|
@ -8,15 +8,15 @@ managed:
|
||||||
- buf.build/googleapis/googleapis
|
- buf.build/googleapis/googleapis
|
||||||
plugins:
|
plugins:
|
||||||
- plugin: buf.build/protocolbuffers/go:v1.31.0
|
- plugin: buf.build/protocolbuffers/go:v1.31.0
|
||||||
out: ./api/generated/
|
out: ./generated/
|
||||||
opt: paths=source_relative
|
opt: paths=source_relative
|
||||||
- plugin: buf.build/grpc/go:v1.3.0
|
- plugin: buf.build/grpc/go:v1.3.0
|
||||||
out: ./api/generated/
|
out: ./generated/
|
||||||
opt:
|
opt:
|
||||||
- paths=source_relative
|
- paths=source_relative
|
||||||
- require_unimplemented_servers=false
|
- require_unimplemented_servers=false
|
||||||
- plugin: buf.build/community/planetscale-vtprotobuf:v0.4.0
|
- plugin: buf.build/community/planetscale-vtprotobuf:v0.4.0
|
||||||
out: ./api/generated/
|
out: ./generated/
|
||||||
opt:
|
opt:
|
||||||
- features=marshal+unmarshal+size+pool
|
- features=marshal+unmarshal+size+pool
|
||||||
- paths=source_relative
|
- paths=source_relative
|
||||||
|
|
|
@ -10,7 +10,6 @@ package rpcv1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
|
|
||||||
grpc "google.golang.org/grpc"
|
grpc "google.golang.org/grpc"
|
||||||
codes "google.golang.org/grpc/codes"
|
codes "google.golang.org/grpc/codes"
|
||||||
status "google.golang.org/grpc/status"
|
status "google.golang.org/grpc/status"
|
||||||
|
|
Loading…
Reference in a new issue