Skip to content

Add a top-level Makefile in java-sdk to simplify running tests and linters #239

@SoulPancake

Description

@SoulPancake

Checklist

Describe the problem you'd like to have solved

Currently, contributors to the Java SDK need to manually run Gradle commands (e.g., ./gradlew test) or check the CI workflow to understand how to execute tests and lint locally.
Since other SDKs will include a unified Makefile, adding one here would make local testing and linting easier and more consistent across the ecosystem.

Describe the ideal solution

Add a top-level Makefile in the java-sdk repository that follows the same conventions used in the sdk-generator project, where Java testing already runs via Gradle.

A minimal version could look like:

.PHONY: test
test:
	./gradlew test

.PHONY: lint
lint:
	./gradlew check

.PHONY: fmt
fmt:
	./gradlew spotlessApply

Alternatively, to mirror the existing pattern in sdk-generator:

.PHONY: test
test:
	make run-in-docker sdk_language=java image=gradle:${GRADLE_DOCKER_TAG} command="/bin/sh -c 'gradle test'"

This enables contributors to simply run:

make test   # run all unit tests
make lint   # run static analysis / checkstyle
make fmt    # auto-format using Spotless

Alternatives and current workarounds

No response

References

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions