Skip to content

Commit 718b626

Browse files
xaionaro@dx.centerxaionaro@dx.center
authored andcommitted
fix: update jni to v0.0.5, fix nested package proto path
Update jni dependency to v0.0.5 which exports spec.Java/spec.Overlays embedded FS and ParseSpec/ParseOverlay functions. Fix proto filename for nested packages (e.g., health/connect): use filepath.Base to extract the last path segment for the filename instead of using the full package path, which created double-nested directories.
1 parent 42fb963 commit 718b626

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.24.0
55
toolchain go1.24.2
66

77
require (
8-
github.com/AndroidGoLab/jni v0.0.4
8+
github.com/AndroidGoLab/jni v0.0.5
99
github.com/spf13/cobra v1.10.2
1010
github.com/stretchr/testify v1.11.1
1111
google.golang.org/grpc v1.79.2

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
github.com/AndroidGoLab/jni v0.0.4 h1:DCDkxy8JeZYvYeZgOSeYHTVbeTIE5h+C0AeOe5OG9Ds=
22
github.com/AndroidGoLab/jni v0.0.4/go.mod h1:ZYHgM39mTiJ3JZVvhn1+4j8H3CiHRIq8l/s2gsK7JZw=
3+
github.com/AndroidGoLab/jni v0.0.5 h1:Z/jZ+xYfoQETxqPKsfnrjBYEqs28J4O121HgEI7yBNs=
4+
github.com/AndroidGoLab/jni v0.0.5/go.mod h1:ZYHgM39mTiJ3JZVvhn1+4j8H3CiHRIq8l/s2gsK7JZw=
35
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
46
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
57
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=

tools/pkg/protogen/generate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func TestGenerate_AllRealSpecs(t *testing.T) {
7373
continue
7474
}
7575

76-
protoPath := filepath.Join(outputDir, pkgName, pkgName+".proto")
76+
protoPath := filepath.Join(outputDir, pkgName, filepath.Base(pkgName)+".proto")
7777
data, err := os.ReadFile(protoPath)
7878
if err != nil {
7979
t.Errorf("%s (pkg=%s): proto file not created at %s: %v", baseName, pkgName, protoPath, err)

tools/pkg/protogen/protogen.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ func Generate(specPath, overlayPath, outputDir, goModule string) error {
3333
return fmt.Errorf("mkdir %s: %w", pkgDir, err)
3434
}
3535

36-
outputPath := filepath.Join(pkgDir, merged.Package+".proto")
36+
// Use only the last path segment as the filename (e.g., "health/connect" → "connect.proto").
37+
baseName := filepath.Base(merged.Package)
38+
outputPath := filepath.Join(pkgDir, baseName+".proto")
3739
if err := renderProto(data, outputPath); err != nil {
3840
return fmt.Errorf("render proto: %w", err)
3941
}

0 commit comments

Comments
 (0)