Commit 3447d5e9 authored by KingRainbow44's avatar KingRainbow44
Browse files

Change 'injectGitHash' task to properly format 'BuildConfig'

parent 44736059
......@@ -251,17 +251,19 @@ task injectGitHash {
def gitCommitHash = {
try {
return 'git rev-parse --verify --short HEAD'.execute().text.trim()
} catch (e) {
} catch (ignored) {
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 final class BuildConfig {
public static final String VERSION = \"${version}\";
public static final String GIT_HASH = \"${gitCommitHash()}\";
}"""
}
processResources {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment