Skip to content

Commit 2cc1ea2

Browse files
authored
Release Build 0.1.235 Beta
Build 0.1.235 Beta
2 parents a8485e5 + 9e87ab3 commit 2cc1ea2

52 files changed

Lines changed: 1362 additions & 889 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dependency-reduced-pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>me.piitex</groupId>
55
<artifactId>RenJava</artifactId>
66
<name>RenJava</name>
7-
<version>0.1.195-beta</version>
7+
<version>0.1.235-beta</version>
88
<build>
99
<resources>
1010
<resource>

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>me.piitex</groupId>
88
<artifactId>RenJava</artifactId>
9-
<version>0.1.195-beta</version>
9+
<version>0.1.235-beta</version>
1010
<name>RenJava</name>
1111

1212
<properties>
@@ -113,7 +113,7 @@
113113
<dependency>
114114
<groupId>com.github.oshi</groupId>
115115
<artifactId>oshi-core</artifactId>
116-
<version>6.6.1</version>
116+
<version>6.6.5</version>
117117
</dependency>
118118
<dependency>
119119
<groupId>org.apache.maven</groupId>

src/main/java/me/piitex/renjava/Launch.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import me.piitex.renjava.configuration.RenJavaConfiguration;
2020
import me.piitex.renjava.gui.GuiLoader;
2121
import me.piitex.renjava.loggers.ApplicationLogger;
22+
import me.piitex.renjava.loggers.RenLogger;
2223
import org.reflections.Reflections;
2324
import org.reflections.scanners.Scanners;
2425
import org.reflections.util.ClasspathHelper;
@@ -34,6 +35,9 @@ public static void main(String[] args) {
3435
// Rough execution time (not accurate)
3536
start = System.currentTimeMillis();
3637

38+
// Initializes the Ren logger which is separated from the application logger.
39+
RenLogger.init();
40+
3741
InfoFile buildInfo = new InfoFile(new File(System.getProperty("user.dir") + "/renjava/build.info"), true);
3842
if (buildInfo.containsKey("main")) {
3943
String mainClass = buildInfo.getString("main");
@@ -42,10 +46,10 @@ public static void main(String[] args) {
4246
clazz = Class.forName(mainClass);
4347
loadClass(clazz, args, buildInfo);
4448
} catch (ClassNotFoundException e) {
45-
System.err.println("Failed to load class: " + e.getMessage());
49+
RenLogger.LOGGER.error("Failed to load class: {}", e.getMessage());
4650
}
4751
} else {
48-
System.err.println("Build info not found. Scanning for RenJava class. This will have noticeable performance impact on low end computers.");
52+
RenLogger.LOGGER.error("Build info not found. Scanning for RenJava class. This will have noticeable performance impact on low end computers.");
4953
// Scans for all classes in all packages. (We need to do all packages because this allows the author the freedom to do their own package scheme.)
5054
Collection<URL> allPackagePrefixes = Arrays.stream(Package.getPackages())
5155
.map(Package::getName)
@@ -69,30 +73,27 @@ public static void main(String[] args) {
6973

7074
private static void loadClass(Class<?> clazz, String[] args, InfoFile infoFile) {
7175
try {
72-
File file = new File(System.getProperty("user.dir") + "/renjava/build.info");
73-
if (!file.exists()) {
74-
file.createNewFile();
76+
if (!infoFile.exists()) {
77+
RenLogger.LOGGER.error("Could not create the 'build.info' file. This might be a first time setup. Once the application opens please exit and relaunch.");
78+
return; // This will exit the application.
7579
}
76-
7780
String jarPath = Launch.class
7881
.getProtectionDomain()
7982
.getCodeSource()
8083
.getLocation()
8184
.toURI()
8285
.getPath();
8386

84-
System.out.println("Path: " + jarPath);
87+
RenLogger.LOGGER.info("Jar path: {}", jarPath);
8588

8689
String[] split = jarPath.split("/");
8790
String fileName = split[split.length - 1];
8891

8992
infoFile.write("main", clazz.getName());
9093
infoFile.write("file", fileName);
9194

92-
} catch (IOException e) {
93-
System.err.println("Could not create the 'build.info' file. This might be a first time setup. Once the application opens please exit and relaunch.");
9495
} catch (URISyntaxException e) {
95-
System.err.println("Could retrieve runtime information.");
96+
RenLogger.LOGGER.error("Could retrieve runtime information.", e);
9697
}
9798

9899
try {
@@ -106,7 +107,7 @@ private static void loadClass(Class<?> clazz, String[] args, InfoFile infoFile)
106107
renJava.author = game.author();
107108
renJava.version = game.version();
108109
} else {
109-
System.err.println("ERROR: Please annotate your main class with 'Game'.");
110+
RenLogger.LOGGER.error("Please annotate your main class with 'Game'.");
110111
renJava.name = "Error";
111112
renJava.author = "Error";
112113
renJava.version = "Error";
@@ -118,7 +119,7 @@ private static void loadClass(Class<?> clazz, String[] args, InfoFile infoFile)
118119
RenJavaConfiguration configuration = new RenJavaConfiguration(conf.title().replace("{version}", renJava.version).replace("{name}", renJava.name).replace("{author}", renJava.author), conf.width(), conf.height(), new ImageLoader(conf.windowIconPath()));
119120
renJava.setConfiguration(configuration);
120121
} else {
121-
System.err.println("ERROR: Configuration annotation not found. Please annotate your main class with 'Configuration'");
122+
RenLogger.LOGGER.error("Configuration annotation not found. Please annotate your main class with 'Configuration'");
122123
RenJavaConfiguration configuration = new RenJavaConfiguration("Error", 1920, 1080, new ImageLoader("gui/window_icon.png"));
123124
renJava.setConfiguration(configuration);
124125
}
@@ -132,7 +133,7 @@ private static void loadClass(Class<?> clazz, String[] args, InfoFile infoFile)
132133
renJava.init(); // Initialize game
133134
launch(args);
134135
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
135-
System.err.println("ERROR: Could initialize the RenJava framework: " + e.getMessage());
136+
RenLogger.LOGGER.error("Could initialize the RenJava framework: {}", e.getMessage());
136137
}
137138
}
138139

0 commit comments

Comments
 (0)