From f16edfd58e9c9aeebc4592246c9f1da72fcb1ffe Mon Sep 17 00:00:00 2001 From: mingjun97 Date: Tue, 10 May 2022 23:55:40 -0700 Subject: [PATCH] Fix building error --- build.gradle | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index ffb6a498e..3a8d2c34d 100644 --- a/build.gradle +++ b/build.gradle @@ -229,25 +229,22 @@ javadoc { } task injectGitHash { - doLast { - def gitCommitHash = { - try { - return 'git rev-parse --verify --short HEAD'.execute().text.trim() - } catch (e) { - return "GIT_NOT_FOUND" - } + def gitCommitHash = { + try { + return 'git rev-parse --verify --short HEAD'.execute().text.trim() + } catch (e) { + return "GIT_NOT_FOUND" } - new File(projectDir, "src/main/java/emu/grasscutter/BuildConfig.java").text = """ - package emu.grasscutter; - public class BuildConfig { - public static final String VERSION = \"${version}\"; - public static final String GIT_HASH = \"${gitCommitHash()}\"; - } - """ } + new File(projectDir, "src/main/java/emu/grasscutter/BuildConfig.java").text = """ + package emu.grasscutter; + public class BuildConfig { + public static final String VERSION = \"${version}\"; + public static final String GIT_HASH = \"${gitCommitHash()}\"; + } + """ } processResources { dependsOn "generateProto" - dependsOn "injectGitHash" }