Skip to content

Commit 6946629

Browse files
xaionaro@dx.centerxaionaro@dx.center
authored andcommitted
fix: regenerate code for updated jni dependency, fix code generators
- Fix errcheck and ST1005 lint errors in mcp/auth.go, mcp/server_test.go, cmd/jnimcp/main.go - Fix protogen: unify service eligibility check (IsServiceEligible) used by both protogen and grpcgen (single source of truth) - Fix protogen: merge ProtoData from multiple specs targeting the same package instead of overwriting - Fix grpcgen: generate service-specific client types (ManagerClient, WindowManagerClient) instead of conflicting generic Client - Fix grpcgen: merge server/client data per package to handle multi-spec packages correctly - Fix grpcgen: support per-service jni imports in server template for packages where services come from different jni Go packages - Fix grpcgen: deduplicate composite entries and use package-prefixed field names in composite client to avoid collisions - Fix Makefile: clean stale generated files before regenerating - Fix .gitignore: anchor jnicli/jnimcp patterns to repo root - Update mcp/tools_workflow.go for renamed client API
1 parent 10f61a4 commit 6946629

751 files changed

Lines changed: 130293 additions & 607005 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ cover.out
66
examples/test_results/
77
go.work
88
go.work.sum
9-
jnicli
10-
jnimcp
9+
/jnicli
10+
/jnimcp
1111
build/

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,25 @@ protoc: proto
3030
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
3131
"$$dir$$pkg.proto"; \
3232
done
33+
@# Remove stale _grpc.pb.go files for protos that no longer define a service.
34+
@for dir in proto/*/; do \
35+
pkg=$$(basename "$$dir"); \
36+
grpc_file="$${dir}$${pkg}_grpc.pb.go"; \
37+
if [ -f "$$grpc_file" ] && ! grep -q 'service ' "$${dir}$${pkg}.proto"; then \
38+
echo "removing stale $$grpc_file"; \
39+
rm "$$grpc_file"; \
40+
fi; \
41+
done
3342

3443
# Run grpcgen — generates gRPC server and client wrappers
3544
grpc: protoc
45+
@rm -rf grpc/client/
46+
@find grpc/server/ -name 'server.go' -exec grep -l 'Code generated by grpcgen' {} \; -exec rm {} \; 2>/dev/null || true
3647
go run ./tools/cmd/grpcgen/ -specs $(JNI_DIR)/spec/java/ -overlays $(JNI_DIR)/spec/overlays/java/ -output . -go-module github.com/AndroidGoLab/jni-proxy -jni-module github.com/AndroidGoLab/jni
3748

3849
# Run cligen — generates jnicli cobra commands from Java API specs
3950
cli: grpc
51+
@grep -rl 'Code generated by cligen' cmd/jnicli/ 2>/dev/null | xargs rm -f
4052
go run ./tools/cmd/cligen/ -specs $(JNI_DIR)/spec/java/ -overlays $(JNI_DIR)/spec/overlays/java/ -output cmd/jnicli/ -go-module github.com/AndroidGoLab/jni-proxy
4153

4254
# Run only tool tests (no JDK needed)

0 commit comments

Comments
 (0)