Skip to content

Commit

Permalink
grpc-compiler: upgrade golang to 1.17 & use new module system for build.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaodongw committed Dec 8, 2021
1 parent 370f0ac commit d38c2bc
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 9 deletions.
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/build/Plugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ fun Project.grpcPluginSupport(pluginName: String) {
tasks.register("buildPlugin") {
doLast {
exec {
workingDir = file("src/main/go")
environment = environment + mapOf("GOOS" to goOs(os), "GOARCH" to goArch(arch))
commandLine = listOf("go", "build", "-o", pluginPath, "src/main/go/main.go")
commandLine = listOf("go", "build", "-o", pluginPath, "main.go")
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions kert-grpc-compiler/src/main/go/generator/generator.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package generator

import (
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/protoc-gen-go/descriptor"
plugin "github.com/golang/protobuf/protoc-gen-go/plugin"
"google.golang.org/protobuf/proto"
descriptor "google.golang.org/protobuf/types/descriptorpb"
plugin "google.golang.org/protobuf/types/pluginpb"
"io/ioutil"
"strconv"
"strings"
Expand Down
4 changes: 2 additions & 2 deletions kert-grpc-compiler/src/main/go/generator/service-generator.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package generator

import (
"./templates"
"bytes"
"github.com/golang/protobuf/protoc-gen-go/descriptor"
descriptor "google.golang.org/protobuf/types/descriptorpb"
"leap.ws/kert-grpc-compiler/generator/templates"
"path"
"strings"
"text/template"
Expand Down
5 changes: 5 additions & 0 deletions kert-grpc-compiler/src/main/go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module leap.ws/kert-grpc-compiler

go 1.17

require google.golang.org/protobuf v1.27.1
8 changes: 8 additions & 0 deletions kert-grpc-compiler/src/main/go/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
6 changes: 3 additions & 3 deletions kert-grpc-compiler/src/main/go/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package main

import (
"./generator"
"./util"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
"io/ioutil"
"leap.ws/kert-grpc-compiler/generator"
"leap.ws/kert-grpc-compiler/util"
"os"
)

Expand Down

0 comments on commit d38c2bc

Please sign in to comment.