Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
c105c71e
Commit
c105c71e
authored
2 years ago
by
mingjun97
Committed by
Melledy
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Fix building error
parent
41de6bd2
development
LintRatchet
stable
v1.4.4
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.3.1
v1.3.0
v1.2.2-dev
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build.gradle
+12
-15
build.gradle
with
12 additions
and
15 deletions
+12
-15
build.gradle
View file @
c105c71e
...
...
@@ -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"
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help