Skip to content

Commit

Permalink
feat: rename to protoc-gen-go-aip-test
Browse files Browse the repository at this point in the history
  • Loading branch information
odsod committed Aug 19, 2021
1 parent be23fd8 commit d5128fd
Show file tree
Hide file tree
Showing 20 changed files with 131 additions and 58 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @odsod @ericwenn
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2

updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily

- package-ecosystem: gomod
directory: /
schedule:
interval: daily
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- "*"

jobs:
make:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ^1.17

- name: Setup Node
uses: actions/[email protected]
with:
node-version: 12

- name: Make
run: make

release:
needs: [make]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/[email protected]

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ^1.17

- name: Setup Node
uses: actions/[email protected]
with:
node-version: 12

- name: Run semantic-release
run: make semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run goreleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ buf-lint: $(buf)
$(info [$@] linting protobuf schemas...)
@$(buf) lint

protoc_gen_go_aiptest := ./bin/protoc-gen-go-aiptest
export PATH := $(dir $(abspath $(protoc_gen_go_aiptest))):$(PATH)
protoc_gen_go_aip_test := ./bin/protoc-gen-go-aip-test
export PATH := $(dir $(abspath $(protoc_gen_go_aip_test))):$(PATH)

.PHONY: $(protoc_gen_go_aiptest)
$(protoc_gen_go_aiptest):
.PHONY: $(protoc_gen_go_aip_test)
$(protoc_gen_go_aip_test):
$(info [$@] building binary...)
@go build -o $@ .

.PHONY: buf-generate
buf-generate: $(buf) $(protoc_gen_go_aiptest) $(protoc_gen_go) $(protoc_gen_go_grpc)
buf-generate: $(buf) $(protoc_gen_go_aip_test) $(protoc_gen_go) $(protoc_gen_go_grpc)
$(info [$@] generating protobuf stubs...)
@rm -rf proto/gen
@$(buf) generate --path proto/src/einride
8 changes: 4 additions & 4 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ version: v1beta1
plugins:
- name: go
out: proto/gen
opt: module=github.com/einride/protoc-gen-go-aiptest/proto/gen
opt: module=github.com/einride/protoc-gen-go-aip-test/proto/gen

- name: go-grpc
out: proto/gen
opt: module=github.com/einride/protoc-gen-go-aiptest/proto/gen
opt: module=github.com/einride/protoc-gen-go-aip-test/proto/gen

- name: go-aiptest
- name: go-aip-test
out: proto/gen
opt: module=github.com/einride/protoc-gen-go-aiptest/proto/gen
opt: module=github.com/einride/protoc-gen-go-aip-test/proto/gen
2 changes: 1 addition & 1 deletion buf.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: v1beta1

name: buf.build/einride/protoc-gen-go-aiptest
name: buf.build/einride/protoc-gen-go-aip-test

deps:
- buf.build/beta/googleapis
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/einride/protoc-gen-go-aiptest
module github.com/einride/protoc-gen-go-aip-test

go 1.15

Expand Down
4 changes: 2 additions & 2 deletions internal/plugin/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"path/filepath"

"github.com/einride/protoc-gen-go-aiptest/internal/xrange"
"github.com/einride/protoc-gen-go-aip-test/internal/xrange"
"google.golang.org/genproto/googleapis/api/annotations"
"google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/reflect/protoreflect"
Expand Down Expand Up @@ -76,7 +76,7 @@ func goImportPath(file *protogen.File) protogen.GoImportPath {
}

func writeHeader(file *protogen.File, f *protogen.GeneratedFile) {
f.P("// Code generated by protoc-gen-go-aiptest. DO NOT EDIT.")
f.P("// Code generated by protoc-gen-go-aip-test. DO NOT EDIT.")
f.P()
f.P("package ", file.GoPackageName+pkgNameSuffix)
f.P()
Expand Down
2 changes: 1 addition & 1 deletion internal/plugin/helper.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package plugin

import (
"github.com/einride/protoc-gen-go-aiptest/internal/xrange"
"github.com/einride/protoc-gen-go-aip-test/internal/xrange"
"go.einride.tech/aip/fieldbehavior"
"google.golang.org/genproto/googleapis/api/annotations"
"google.golang.org/protobuf/reflect/protopath"
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/einride/protoc-gen-go-aiptest/internal/plugin"
"github.com/einride/protoc-gen-go-aip-test/internal/plugin"
"google.golang.org/protobuf/compiler/protogen"
)

Expand Down
14 changes: 7 additions & 7 deletions proto/gen/einride/example/freight/v1/freight_service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions proto/gen/einride/example/freight/v1/resource_references.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions proto/gen/einride/example/freight/v1/shipper.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions proto/gen/einride/example/freight/v1/site.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/src/einride/example/freight/v1/freight_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package einride.example.freight.v1;

option go_package = "github.com/einride/protoc-gen-go-aiptest/proto/gen/einride/example/freight/v1;examplefreightv1";
option go_package = "github.com/einride/protoc-gen-go-aip-test/proto/gen/einride/example/freight/v1;examplefreightv1";
option java_multiple_files = true;
option java_outer_classname = "FreightServiceProto";
option java_package = "tech.einride.example.freight.v1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package einride.example.freight.v1;

option go_package = "github.com/einride/protoc-gen-go-aiptest/proto/gen/einride/example/freight/v1;examplefreightv1";
option go_package = "github.com/einride/protoc-gen-go-aip-test/proto/gen/einride/example/freight/v1;examplefreightv1";
option java_multiple_files = true;
option java_outer_classname = "ResourceDefinitionsProto";
option java_package = "tech.einride.example.freight.v1";
Expand All @@ -15,4 +15,3 @@ option (google.api.resource_definition) = {
singular: "billingAccount"
plural: "billingAccounts"
};

2 changes: 1 addition & 1 deletion proto/src/einride/example/freight/v1/shipper.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package einride.example.freight.v1;

option go_package = "github.com/einride/protoc-gen-go-aiptest/proto/gen/einride/example/freight/v1;examplefreightv1";
option go_package = "github.com/einride/protoc-gen-go-aip-test/proto/gen/einride/example/freight/v1;examplefreightv1";
option java_multiple_files = true;
option java_outer_classname = "ShipperProto";
option java_package = "tech.einride.example.freight.v1";
Expand Down
2 changes: 1 addition & 1 deletion proto/src/einride/example/freight/v1/site.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package einride.example.freight.v1;

option go_package = "github.com/einride/protoc-gen-go-aiptest/proto/gen/einride/example/freight/v1;examplefreightv1";
option go_package = "github.com/einride/protoc-gen-go-aip-test/proto/gen/einride/example/freight/v1;examplefreightv1";
option java_multiple_files = true;
option java_outer_classname = "SiteProto";
option java_package = "tech.einride.example.freight.v1";
Expand Down
2 changes: 1 addition & 1 deletion tools/protoc-gen-go-grpc/rules.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
grpc_go_cwd := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
protoc_gen_go_grpc := $(grpc_go_cwd)/bin/protoc-gen-go_grpc
protoc_gen_go_grpc := $(grpc_go_cwd)/bin/protoc-gen-go-grpc
export PATH := $(dir $(protoc_gen_go_grpc)):$(PATH)

$(protoc_gen_go_grpc): $(grpc_go_cwd)/../../go.mod
Expand Down

0 comments on commit d5128fd

Please sign in to comment.