Skip to content

Commit d10cd1f

Browse files
authored
Merge pull request #4809 from tronprotocol/fix/git-properties
Fix build failure issue
2 parents 039c95c + 4d07ef9 commit d10cd1f

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

framework/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ plugins {
33
id "com.gorylenko.gradle-git-properties" version "2.4.1"
44
}
55

6+
gitProperties.failOnNoGitDirectory = false;
7+
68
apply plugin: 'application'
79
apply plugin: 'checkstyle'
810

framework/src/main/java/org/tron/core/config/args/Args.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,23 @@ public static void clearParam() {
224224
*/
225225
private static void printVersion() {
226226
Properties properties = new Properties();
227+
boolean noGitProperties = true;
227228
try {
228229
InputStream in = Thread.currentThread()
229230
.getContextClassLoader().getResourceAsStream("git.properties");
230-
properties.load(in);
231+
if (in != null) {
232+
noGitProperties = false;
233+
properties.load(in);
234+
}
231235
} catch (IOException e) {
232236
logger.error(e.getMessage());
233237
}
234238
JCommander.getConsole().println("OS : " + System.getProperty("os.name"));
235239
JCommander.getConsole().println("JVM : " + System.getProperty("java.vendor") + " "
236240
+ System.getProperty("java.version") + " " + System.getProperty("os.arch"));
237-
JCommander.getConsole().println("Git : " + properties.getProperty("git.commit.id"));
241+
if (!noGitProperties) {
242+
JCommander.getConsole().println("Git : " + properties.getProperty("git.commit.id"));
243+
}
238244
JCommander.getConsole().println("Version : " + Version.getVersion());
239245
JCommander.getConsole().println("Code : " + Version.VERSION_CODE);
240246
}

0 commit comments

Comments
 (0)