From 856b8bdae104703194f1431f4d962bcccba424ea Mon Sep 17 00:00:00 2001 From: "Justin \"J.R.\" Hill" Date: Thu, 27 Jul 2023 09:27:38 -0700 Subject: [PATCH] chore(java): Run gradle fmt when building Java client --- Makefile | 3 ++- config/clients/java/template/Java/build.gradle.mustache | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index daf199f3..6a9e5a5c 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ GO_DOCKER_TAG = 1 DOTNET_DOCKER_TAG = 6.0 GOLINT_DOCKER_TAG = v1.51-alpine BUSYBOX_DOCKER_TAG = 1 +GRADLE_DOCKER_TAG = 8.2 PYTHON_DOCKER_TAG = 3.10 # Other config CONFIG_DIR = ${PWD}/config @@ -206,7 +207,7 @@ setup-new-sdk: .PHONY: build-client-java build-client-java: make build-client sdk_language=java tmpdir=${TMP_DIR} - # ... any other custom build steps ... + make run-in-docker sdk_language=java image=gradle:${GRADLE_DOCKER_TAG} command="/bin/sh -c 'gradle fmt'" .PHONY: test-client-java test-client-java: build-client-java diff --git a/config/clients/java/template/Java/build.gradle.mustache b/config/clients/java/template/Java/build.gradle.mustache index ae1bf385..43d789d0 100644 --- a/config/clients/java/template/Java/build.gradle.mustache +++ b/config/clients/java/template/Java/build.gradle.mustache @@ -89,4 +89,6 @@ spotless { // Use spotless plugin to automatically format code, remove unused import, etc // To apply changes directly to the file, run `gradlew spotlessApply` // Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle -tasks.register('fmt') +tasks.register('fmt') { + dependsOn 'spotlessApply' +}