forked from Slimefun/Slimefun4
-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5c0ddf
commit 420dfdd
Showing
5 changed files
with
71 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package city.norain.slimefun4.utils; | ||
|
||
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; | ||
import java.io.IOException; | ||
import java.util.Properties; | ||
import java.util.logging.Level; | ||
import lombok.experimental.UtilityClass; | ||
|
||
@UtilityClass | ||
public class EnvUtil { | ||
public static Properties gitInfo = null; | ||
|
||
public void init() { | ||
try (var resource = Slimefun.class.getClassLoader().getResourceAsStream("build.properties")) { | ||
var prop = new Properties(); | ||
prop.load(resource); | ||
|
||
gitInfo = prop; | ||
} catch (IOException e) { | ||
Slimefun.logger().log(Level.WARNING, "无法加载构建信息", e); | ||
} | ||
} | ||
|
||
public String getBuildTime() { | ||
return gitInfo == null ? "null" : gitInfo.getProperty("git.build.time"); | ||
} | ||
|
||
public String getBuildCommitID() { | ||
return gitInfo == null ? "null" : gitInfo.getProperty("git.commit.id.abbrev"); | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
src/main/java/city/norain/slimefun4/utils/SimpleTimer.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters