Skip to content

Commit 029867c

Browse files
authored
add debug options
1 parent 0b4670c commit 029867c

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/main/java/mods/Hileb/shotaasm/ShotaASM.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class ShotaASM implements IFMLLoadingPlugin {
2323
public static final String MOD_ID = Reference.MOD_ID;
2424
public static final ModMetadata MOD_METADATA = MetaDataDecoder.decodeMcModInfo(ShotaASM.class.getResourceAsStream("/mcmod.info")).get(MOD_ID);
2525
public static final Logger LOGGER = LogManager.getLogger(NAME);
26+
public static boolean DEBUG = Boolean.parseBoolean(System.getProperty("foundation.dump", "false"));
2627

2728
public static File source = null;
2829

src/main/java/mods/Hileb/shotaasm/api/ScriptFile.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ public static ScriptFile create(String name, String rawText) {
4747
map.put("compiler", "javaShota");
4848
}
4949

50+
if (ShotaASM.DEBUG) {
51+
ShotaASM.LOGGER.info("Script Debug : {}", name);
52+
ShotaASM.LOGGER.info("Processed Text : \n {}", nonCommentText.toString());
53+
}
54+
5055
return new ScriptFile(name, nonCommentText.toString(), map, new HashMap<>());
5156
} catch (Exception e) {
5257
ShotaASM.LOGGER.error("Error creating ScriptFile for '{}': {}", name, e.getMessage(), e);

src/main/java/mods/Hileb/shotaasm/impl/compiler/CompilerFactory.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ public CompilerFactory(URL[] classpath) {
2121
this.options.add("-classpath");
2222
this.options.add(buildClasspath(classpath));
2323
this.options.add("-Xlint:unchecked");
24+
25+
if (ShotaASM.DEBUG) {
26+
ShotaASM.LOGGER.info("Java Compiler Factory Debug.");
27+
String s0 = "";
28+
for (String s : this.options) {
29+
s0 + = s;
30+
}
31+
ShotaASM.LOGGER.info("Options : {}", s0);
32+
}
2433
}
2534

2635
public Compiler compiler(){

0 commit comments

Comments
 (0)