mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-27 08:36:38 +00:00
Fix building error
This commit is contained in:
parent
48b5873fee
commit
f16edfd58e
27
build.gradle
27
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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user