Skip to content

Commit

Permalink
Remove GOPATH
Browse files Browse the repository at this point in the history
xxx

Signed-off-by: Kazuyoshi Kato <[email protected]>
  • Loading branch information
kzys committed Aug 12, 2023
1 parent 7e123b2 commit 3ddedc0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
- name: Setup environment
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Check out code
Expand Down Expand Up @@ -69,7 +68,6 @@ jobs:
- name: Setup environment
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Check out code
Expand Down Expand Up @@ -118,7 +116,6 @@ jobs:
- name: Setup environment
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Check out code
Expand Down
3 changes: 3 additions & 0 deletions Protobuild.toml
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,6 @@ target = "examples/next.pb.txt"
# [[descriptors]]
# target = "examples/foo/descriptors.pb.txt"
# prefix = "github.com/containerd/protobuild/examples/foo"

[parameters.go]
paths = "source_relative"
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ func main() {
includes = append(includes, gopathJoin(gopath, pkg))
}

includes = append(includes, gopath)
includes = append(includes, pkg.Dir)
includes = append(includes, c.Includes.After...)

protoc := protocCmd{
Generators: generators(c.Generators, outputDir),
Generators: generators(c.Generators, pkg.Dir),
Files: pkg.ProtoFiles,
OutputDir: outputDir,
Includes: includes,
Expand Down Expand Up @@ -246,7 +246,7 @@ func main() {
}

var (
genDescriptors = shouldGenerateDescriptors(importDirPath)
genDescriptors = shouldGenerateDescriptors(pkg.GoImportPath)
dfp *os.File // tempfile for descriptors
)

Expand Down Expand Up @@ -291,7 +291,7 @@ func main() {
}

for path, set := range descriptorSets {
if strings.HasPrefix(importDirPath, path) {
if strings.HasPrefix(pkg.GoImportPath, path) {
set.add(desc.File...)
}
}
Expand Down
5 changes: 5 additions & 0 deletions v2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ generators = ["go", "go-grpc"]
[[descriptors]]
prefix = "github.com/containerd/protobuild/examples/v2"
target = "examples/v2/next.pb.txt"

# The default mode is paths=import which makes a directory that mirrors its Go import path.
# https://protobuf.dev/reference/go/go-generated/
[parameters.go]
paths = "source_relative"

0 comments on commit 3ddedc0

Please sign in to comment.